[SystemZ] Remove the `softPromoteHalfType` override (#175410)
`softPromoteHalfType` is being phased out because it is prone to
miscompilations (further context at [1]). SystemZ is one of the few
remaining platforms to override the default, so remove it here.
This only affects SystemZ when the `soft-float` option is used.
[1]: https://github.com/llvm/llvm-project/pull/175149
[clang-repl] Fix OrcRuntime lookup for Solaris and unit tests. (#175435)
The out-of-process execution in the interpreter depends on the orc
runtime. It is generally easy to discover as it is in the clang runtime
path. However, the clang runtime path is relative to clang's resource
directory which is relative to the clang binary. That does not work well
if clang is linked into a different binary which can be in a random
place in the build directory structure.
This patch performs a conservative approach to detect the common
directory structure and correctly infer the paths. That fixes the
out-of-process execution unittests. The patch also contains a small
adjustment for solaris.
Another take on trying to fix the issue uncovered by #175322.
[CIR][AArch64] Add lowering for unpredicated svdup builtins (#174433)
This PR adds CIR lowering support for unpredicated `svdup` SVE builtins.
The corresponding ACLE intrinsics are documented at:
* https://developer.arm.com/architectures/instruction-sets/intrinsics
(search for svdup).
Since LLVM provides a direct intrinsic for svdup with a 1:1 mapping, CIR
lowers these builtins by emitting a call to the corresponding LLVM
intrinsic.
DESIGN NOTES
------------
With this change, ACLE intrinsics that have a corresponding LLVM intrinsic can
generally be lowered by CIR by reusing LLVM intrinsic metadata, avoiding
duplicated intrinsic-name definitions, unless codegen-relevant SVETypeFlags are
involved. As a consequence, CIR may no longer emit NYI diagnostics for
intrinsics that (a) have a known LLVM intrinsic mapping and (b) do not use such
[47 lines not shown]
[Support] Add KnownBits::isNonPositive() helper and exhaustive test coverage for sign predicates (#175284)
This patch adds:
1. KnownBits::isNonPositive() - Returns true if this value is known to
be non-positive (i.e., the signed maximum value is <= 0). This is
implemented using getSignedMaxValue().isNonPositive().
2. SignPredicatesExhaustive test - An exhaustive test that validates the
correctness of isNegative(), isNonNegative(), isStrictlyPositive(),
isNonPositive(), and isNonZero() by iterating through all possible
KnownBits combinations for 1-bit and 4-bit widths and verifying that the
predicates return true if and only if all possible values represented by
the KnownBits satisfy the predicate.
Fixes #175203
[clang] [unittest] Fix linking against dylib (#175317)
Fix a regression introduced in #174513 that would cause `BasicTests` to
link directly to static `LLVMTargetParser` library instead of using the
component linking, to respect dylib.
Signed-off-by: Michał Górny <mgorny at gentoo.org>
[TargetLowering] Change the `softPromoteHalfType` default to `true` (#175149)
The default `f16` lowering has some issues that result in incorrect
float behavior, so over time most targets have switched to use
`softPromoteHalfType`. Swap to soft promotion by default and add
overrides for SystemZ and AMDGPU, which are the two remaining backends
that still depend on this behavior.
All basic `f16` op tests now pass on all remaining experimental arches.
Fixes: https://github.com/llvm/llvm-project/issues/97981
Fixes: https://github.com/llvm/llvm-project/issues/97975
[UTC] Align label var handling of old lines to new lines (#173850)
BB labels have been treated as variables in newer UTC versions.
However, UTC previously handled BB labels in old lines differently from
new lines, causing incorrect `remap_metavar_names`.
E.g.,
- New lines var `exit:` and `label %exit`: UTC generalized them as
`[[@@]]` and `[[@@]]`.
- Old lines var `[[EXIT]]:` and `label %[[EXIT]]`: UTC generalized them
as `[[@@]]:` and `label %[[@@]]`, which mismatched with the
generalization of new lines.
This mismatch might cause unexpected variable name remappings, even if
the new lines are indeed equivalent to the old lines.
This PR aligns label var handling of old lines to new lines, i.e.,
generalizes `[[EXIT]]:` and `label %[[EXIT]]` as `[[@@]]` and `[[@@]]`.
[LV] Handle live-ins in findRecipe.
Skip live-ins in findRecipe to prevent a crash for cases with degenerate
reductions (where the backedge value is a live-in). Such reductions
should be removed, but this requires further changes.
Fixes https://github.com/llvm/llvm-project/issues/175229.