[VPlan] Remove constant branches early. (#183397)
Simplify constant branches early, after introducing the check in the
middle block.
This removes any trivial branches in the input CFG (e.g. over-reduced
test cases) early and also folds branches on true/false created by
addMiddleChecks. This allows to check if there's a scalar tail instead
to check if the tail has been folded, as mentioned in
https://github.com/llvm/llvm-project/pull/182507
This requires to remove recipes in the new unreachable blocks, as
otherwise we would fail during verification, due to uses in unreachable
blocks. Alternatively, we may be able to skip verification for uses in
unreachable blocks.
Depends on https://github.com/llvm/llvm-project/pull/181252.
PR: https://github.com/llvm/llvm-project/pull/183397
[llvm-readobj][ELF] Remove redundant error in reportWarning
If MapOrError contains no error, calling takeError() results in
undefined behavior and may crash the program.
[llvm-readobj][ELF] Use WrappedError to filter duplicates
Switch from StringError to WrappedError. Errors of the form "Prefix:
Error" can now be filtered out based on the underlying error while
preserving distinct prefixes, resulting in clearer llvm-readobj output.
[Object][ELF] Pass Error to WarningHandler
Warning consumers may need to handle errors based on their type. Pass
the Error object instead of a string representation to enable this. This
also brings WarningHandler in line with Support/WithColor.h.
[LV] Fix the cost of first order recurrence splice (#192473)
The index had the wrong sign (for splice.right, the sign is negative),
which meant that it calculates the cost of a splice.left operation. For
SVE this makes a difference because a splice.left is lowered using an
unpredicated EXT instruction, whereas a splice.right is lowered using a
predicated SPLICE instruction, which needs a slightly higher cost.
The change in `reduction-recurrence-costs-sve.ll` happens because the
vector loop is now less profitable (higher cost) and therefore requires
a higher trip-count to be profitable (hence the extra umax).
[LifetimeSafety] Handle xvalue operand of LValueToRValue cast (#192312)
Under C++23, P2266 wraps the operand of `return p;` in an xvalue NoOp
cast for by-value parameters. The `CK_LValueToRValue` branch in
FactsGenerator guarded on `!SubExpr->isLValue()`, breaking origin flow
and silencing the suggestion for `int* id(int* p) { return p; }`.
Use `isGLValue()`, matching how origins are built and stripped elsewhere
in the analysis.
Only add a RUN in suggestion test file, since some tests in
`warn-lifetime-safety.cpp` cause a hard error under C++23. For example:
`MyObj& f() { MyObj s; return s; }`. `error: non-const lvalue reference
to type 'MyObj' cannot bind to a temporary of type 'MyObj'`.
Fixes: #176292
System: Gateways: Configuration: add nosync option
Excluding gateways from synchronization can be useful in cases
where a different default upstream gateway is used to keep
connectivity when failing over in a HA setup.
[Flang] Adding first lowering for the allocation and deallocation of coarrays (#182110)
This PR add support of coarray allocation and deallocation in Flang and
adds two new operations to MIF:
- `mif::AllocaCoarrayOp` : Allocates a coarray
using `prif_allocate_coarray` PRIF procedure.
- `mif::DeallocaCoarrayOp` : Deallocates a coarray
using `prif_deallocate_coarray` PRIF procedure
This PR does not yet handle allocation for the following cases (which
will be added in future PRs):
- Coarrays with ALLOCATABLE and/or POINTER components (PRIF has
procedures (`prif_(de)allocate`) for this).
- Coarray dummy arguments (PRIF has also procedures for this)
- Finalization of coarrays
- non-ALLOCATABLE SAVE coarrays outside the scoping unit of the main
program (e.g. non-ALLOCATABLE coarrays declared in a module or a
procedure)
[5 lines not shown]
[mlir][arith] Add rounding mode flags to binary arithmetic operations (#188458)
Add rounding mode flags for `addf`, `subf`, `mulf`, `divf`. This
addresses a TODO in the op description.
The folder now takes into account the specified rounding mode. If no
rounding mode is specified, the folders/canonicalizations default to
`rmNearestTiesToEven`. (This behavior has not changed.) This is
documented in the top-level arith dialect documentation. The default
arith rounding mode applies only to "internal" transformations such as
foldings/canonicalizations. In case of an unspecified explicit rounding
mode, the runtime behavior is up to the target backend.
Also add a lowering to LLVM intrinsics such as
`llvm.intr.experimental.constrained.fadd`.
Assisted-by: claude-4.6-opus-high
[LV] Replace "BinOp" with "ExtendedOp" in partial reduction transforms (NFCI) (#192422)
"BinOp" as not been accurate for a while (as it's sometime just an
extend). After #188043, it can now also be an "abs" in some cases.
This patch renames "BinOp" to "ExtendedOp" (in line with
matchExtendedReductionOperand). It also updates some doc comments and
tweaks matching the "ExtendedOp" in transformToPartialReduction.
system: experiment/refactor on cron controller
Importer lint pass says "Cron" isn't used if we use getModel() so
let's see if this holds up. $internalModelClass has the full path.
[MLIR] make One-Shot and SCF bufferization TensorLikeType-aware (#189073)
Fix bufferization inconsistencies between builtin tensor types and
custom TensorLikeType implementations across One-Shot analysis/module
paths and SCF bufferization interfaces.
The main issue was a mix of TensorType/RankedTensorType checks in places
that need TensorLikeType-aware handling. This could leave
function-boundary equivalence/aliasing incomplete for custom tensor-like
types, leading to spurious SCF loop equivalence verification failures.
This change:
- switches relevant One-Shot analysis/module checks from TensorType/
RankedTensorType to TensorLikeType;
- updates generic/default aliasing utilities to treat TensorLikeType
consistently;
- updates SCF BufferizableOpInterface implementations
(for/while/if/yield related paths) to use TensorLikeType/BufferLikeType
where appropriate;
[16 lines not shown]
[mlir][vector] Fold poison operands into vector.shuffle mask (#190932)
Fold poison operands into the `vector.shuffle` mask. This commit also
splits up the `vector::ShuffleOp::fold` implementation into multiple
helper functions.
Assisted-by: claude-4.6-opus-high