[flang] Fix build on MacOS (#238284)
```
flang/lib/Lower/Support/ReductionProcessor.cpp:1134:31: error: use 'template' keyword to treat 'lookupSymbol' as a dependent template name
01:06:39 1134 | builder.getModule().lookupSymbol<OpType>(reductionName)) {
01:06:39 | ^
01:06:39 | template
01:06:39 1 error generated.
```
I instead split the expression to match other code in the file.
[SCEV] Don't recurse into isKnownPredicate from IsKnownPredicateViaAddRecStart
isKnownViaNonRecursiveReasoning is meant to use non-recursive checks, but
one of them, IsKnownPredicateViaAddRecStart, proves a predicate on two
AddRecs by calling isKnownPredicate on the AddRecs start values.
The start values may themselves be AddRecs of another loop.
For example, when a loop's IV starts at the exit value of the previous loop's IV.
Then that query recurses into every loop of such a chain, and each level
tries several proofs, so the number of queries grows exponentially with
the length of the chain.
Now prove the predicate on the start values with
isKnownViaNonRecursiveReasoning too, instead of isKnownPredicate.
This is less precise.
Before, isKnownPredicate could also prove the query by splitting the predicate,
and by induction.
[3 lines not shown]
[GlobalISel] Combine shifted power-of-two division and nonnegative signed div/rem (#236601)
Fold unsigned division by a shifted power-of-two constant into a logical
right shift. Convert signed division and remainder to unsigned
operations when both operands are known nonnegative.
Add MIR regression coverage and update AMDGPU assembly checks.
Fixes #236481
Assisted by: Claude Opus 5.5
[CIR] Fix complex promoted division for double (#234289)
While working on long double format attribute, I wanted to make sure CIR
passes pick up and use the info correctly, however the possible affected
place where we figure out long double type on the fly was always
hardcoded to use `long_double<double>` type. It should use targetinfo's
long double instead, taking `-mlong-double` options into account.
Assisted-by: claude
[X86] combineKSHIFT - move kshiftr(extract_subvector(X,C1),C2) handling to SimplifyDemandedVectorElts (#237324)
The combineKSHIFT fold didn't ensure that we retain zero in the
upper/shifted elements - we're better off handling this in
SimplifyDemandedVectorElts where we can still fold if we don't need the
zero'd elements
Fixes #235657
[AArch64] Make all fixed-width masked loads/stores legal on SVE targets (#232757)
The loop vectoriser already generates calls to illegal fixed-width
masked loads and stores regardless of whether the TTI hook says
they are legal or not. Presumably it's because this is preferrable
to manually scalarising the operation at the IR level by introducing
blocks and control flow. However, it does mean that when SVE is
available the code quality is poor, particularly for wider-than-legal
types such as <32 x i8>. This patch returns true from the TTI hook
for all fixed-width types to prevent the ScalarizeMaskedMemIntrin
pass prematurely scalarising the masked operations when we can
use SVE instead.
This PR also makes it easier for us to use SVE in future for
wide masked loads with deinterleaving or wide masked stores with
interleaving. In such cases we should be able to lower the IR to
the SVE masked ld2/st2/etc instructions.
[IndVarSimplify][NFC] Add a test for a predicate on AddRec starts
Add a test where a predicate on two AddRecs of an inner loop
is implied from the predicate on their start values,
which are IVs of the outer loop, and that predicate can
be proven by induction over the outer loop.
Assisted-By: Claude
[SPIR-V] Emit ID decorations on function parameters as OpDecorateId (#229089)
Reuse the global decoration path so parameters get `<id>` operands too
Depends on #229056 and #229058
rpki-client: use strncmp() after x509_location()
Now that the protocol (always expected to be https:// or rsync://) is
normalized, we can do a simpler check.
Prompted by a report by Ties de Kock
ok claudio
rpki-client: reject short URIs in x509_location()
Reject URIs not long enough to hold https:// or rsync://. While "a:///b/c"
is in principle legal, this isn't plausibly a valid URI that should occur
in the wild. Reject certs containing this.
pointed out by/ok claudio
[Offload][Omp] Use libomptarget values to initialize the Device Environment (#238271)
Use the values for total devices and device id from the libomptarget
side instead of the Plugin Interface.
With this not only we remove another usange of the Plugin Interface, but
make it more correct. As those values were only correct if only one RTL
was being used (probably 99.9% of the cases). This is a likely a
leftover of when it was initialized on the
Plugin side.
New test created by Claude.
rpki-client: normalize known URI schemes in x509_location()
RFC 3986 was written under full influence of the robustness principle,
necessarily making all code handling URIs complicated and fragile. This
is further exacerbated by RFC 5280 explicitly mentioning that scheme and
host part of a URI are case-insensitive (for SAN, not explicitly for a
URI accessLocation, but that seems implied).
The schemes explicitly specified by RFC 6487 and friends are rsync and
https and that's the only ones the callers do anything with. Normalize
these to be lower case and accept other schemes (and currently no scheme)
for simplicity. This avoids hitting an errx() in queue_add_from_cert().
Reported by Ties de Kock
ok claudio
NAS-144958 / 28.0.0-BETA.1 / Fix more UPS tests (#20087)
Production code issue: `handle_upssched_event` would shutdown the system
if `upsc` exits 1 while `upsd` restarts or the driver reconnects.
Forced shutdown flag was then persistently stored in `upsd` and
interfered with further tests.
Additionally, `ups.status` flags were compared as strings, not sets,
which was fragile.
[Offload][Omp] Replace usages of Plugin getName (#237269)
Create a new class `PlatformTy` to add liboffload platform related
operations. Add a new `getName` method and use it substitute lingering
and already substituted `GenericPluginTy::getName` usages.
The new method also fixes a bug where we were printing an extra `NULL`
character with the platform name.
Assisted by Claude.
[LV] Allow runtime checks for low trip count loops without scalar epilogues (#197391)
Previously, under `CM_EpilogueNotAllowedLowTripLoop`, any loop with a
trip count below `TinyTripCountVectorThreshold` that required runtime
checks was barred from vectorization. However, vectorization should
still be considered profitable as long as the runtime check overhead
does not exceed the actual vectorization gains.
This patch makes `CM_EpilogueNotAllowedLowTripLoop` rely directly on the
minimum profitable trip count check. After this patch, vectorization is
only prohibited if the trip count is below the minimum profitable trip
count. `CM_EpilogueNotAllowedLowTripLoop` will focuse on preventing
scalar epilogue generation rather than restricting runtime checks.
TODO: Refine the cost calculation for scalar epilogues to eventually
remove `CM_EpilogueNotAllowedLowTripLoop`.
This change was suggested by Alexey Bataev in #176754 .
[Clang][OpenMP] Fix capture of variables under nested default(firstprivate) (#216329)
This patch fixes a data-sharing attribute lookup in isOpenMPCapturedByRef
to use the default data-sharing attribute at the capture level being
considered, instead of that of the innermost directive. The adjacent
check for an explicit data-sharing attribute already queries that level.
Previously, a construct with default(firstprivate) or default(private)
nested inside e.g. a 'parallel' region would cause the 'parallel'
region to capture the scalar variables it shares by copy, rather than
by reference. Writes made through the copy via several routes were then
silently lost; the result of a reduction on the nested construct, a
write to a variable listed in a 'shared' clause on the nested construct, or a
write made by the 'parallel' region itself after the nested construct
had referenced the variable (the capture kind is decided by the first
reference). This affects globals and function-scope statics as well as
local variables, and happens under plain -fopenmp (currently defaulting
to OpenMP 5.1).
[8 lines not shown]