[test] Improve driver option coverage (#192861)
Split the Linux GNU-linker assertions into a dedicated file and extend
them with previously-untested passthrough flags handled by
gnutools::Linker::ConstructJob: -s, -u sym, -rdynamic (-export-dynamic),
-Wl,-z keyword pairs.
LoongArch on Linux previously had no test for -X / --no-relax, which are
emitted by Gnu.cpp for LoongArch and RISC-V.
[LPM][LegacyPM] Reenable LCSSA Verification
This was disabled about a decade ago due to issues with LoopSink.
LoopSink has since had its LegacyPM version removed and is now a
function pass due to not needing too much loop infrastructure. So we can
try enabling this again to prevent backsliding on important cases while
we work on switching to the NewPM which does enforce these things.
Eventually we will want to add assertions here for LoopStrengthReduce,
but given it does not correctly preserve LCSSA, postpone that for now.
Reviewers: arsenm, Meinersbur, nikic, fhahn
Pull Request: https://github.com/llvm/llvm-project/pull/191667
[CIR] Fix __builtin_clz/__builtin_ctz poison_zero to respect target
CIR was hardcoding poisonZero=true for all clz/ctz builtins, ignoring
the target's isCLZForZeroUndef(). This caused incorrect UB on targets
like AArch64 where clz/ctz of zero is well-defined.
Also add support for __builtin_c[lt]zg fallback (2-arg) variants with
compare+select, and add NYI stubs for elementwise variants.
[ConstantFold] Support byte values in `bitcast` constant folding (#188030)
Add support for constant folding `bitcast` instructions including
`ConstantByte` values. This patch handles bitcasts between byte types
and integer, FP, and other byte types in both directions.
`poison` source bytes are preserved, rather than letting the generic
integer fold refine them to `undef` or zero. This is because some
threading optimizations just compare the result of constant folding
(e.g., https://github.com/llvm/llvm-project/pull/114280).
Folds are skipped for byte `bitcast`s where element counts don't divide
evenly and the source contains `poison` values. Some of these casts can
be folded. However, this is left for a future PR.
[NFC][Loop] Remove unused verbose loop debug output
This has been defined out using the preprocessor for ~14 years. Given it
doesn't look like it has gotten any use since then, just remove it to
clean the code up a bit.
Reviewers: nikic
Pull Request: https://github.com/llvm/llvm-project/pull/192830
[lldb] Rally around triple rather than arch in the API tests (#192818)
This PR removes as much uses of arch as possible, in favor of using
triple directly. Most of the changes are in the builder, which no longer
passes ARCH to Make, and of course in Makefile.rules.
This significantly simplifies the remote Darwin test suite, as it
previously had to try and piece together the triple from the platform
and the arch. As an added benefit, we now go through the same code path
for host and remote test runs.
I have tested this on Darwin and Linux and made the changes with the
remote test suites in mind, but it's possible I missed something not
caught by my local testing.
[LSR] Autogenerate some tests
pr25541.ll - Was a regression test for a crash. Make a note and
autogenerate the tests.
bin_power.ll - Was essentially doing what UTC would do already, minus
one test where the assembly output is somewhat large, but the large
assembly output shouldn't be an issue with an autoupdate script and
isn't big enough to justify not including in my opinion.
This makes updating some tests easier for planned changes to LCSSA
preservation.
Reviewers: fhahn, nikic
Pull Request: https://github.com/llvm/llvm-project/pull/191664
[CIR] Emit inbounds nuw flags on GetMemberOp GEP lowering (#186738)
Struct member accesses via GetMemberOp are always inbounds and cannot
unsigned-wrap, matching LLVM's IRBuilder::CreateStructGEP behavior.
[CIR] Emit inbounds nuw flags on GetMemberOp GEP lowering
Struct member accesses via GetMemberOp are always inbounds and cannot
unsigned-wrap, matching LLVM's IRBuilder::CreateStructGEP behavior.
[ToolChains][FreeBSD] Pass -s to Linker
Clang now supports pass -s to Linker instead of using -Wl,-s. This
change is in sync with Gnu Toolchain's behavior.
[libc++] Enable `mdspan::operator[]` constraint tests for AppleClang (#192475)
Although I couldn't find a corresponding AppleClang release note, this
issue appears to be fixed in AppleClang 16.
[VPlan] Support plain CFG plans in the verifier. (#181817)
Update the verifier to support verifying plain CFG plans in the verifier
and add missing support for switch opcodes in type analysis.
This allows the verifier to handle early plain-CFG plans, allowing using
RUN_PASS wrapper for early transforms.
PR: https://github.com/llvm/llvm-project/pull/181817
[mlir] Support full commutative operation equality (#192652)
Previous, commutative equality only works if the operand lists are
exact permutations of one another.
By treating the `equivalentValues` map as a map onto a common set of
values, we can achieve full commutative equality.