[clang] make evaluation of type constraint a SFINAE context (#197523)
Otherwise, errors when substituting a type constraint could
unintentionally make the program ill-formed.
This also strenghtens the assert which checks, when we are instantiating
templates, that we either have a code synthesis context, or that we are
in a SFINAE context.
[VPlan] Add helper to define CastInfo for casting to VP mixins (NFC) (#197494)
Add new generic VPMixinCast that can be used to define CastInfo from a
base class (like VPRecipeBase) to a mixin class (like VPIRMetadata)
through a list of supported recipe types.
Overall that makes defining the cast machinery quite a bit more compact.
It also adds a static_assert to prevent mis-use using std::is_base_of_v
PR: https://github.com/llvm/llvm-project/pull/197494
[clang][deps] Consolidate types into new `DependencyGraph.h` (#197567)
This PR pulls the types forming the dependency graph from three
different headers into a single new header `DependencyGraph.h`. This
makes the code organization a bit clearer, and is NFC otherwise.
[BOLT] Define hugify option in CommandLineOpts.cpp (#197702)
#195272 added a reference to opts::Hugify from LongJmp.cpp. This
broke shared-library builds because LLVMBOLTPasses does not link
against LLVMBOLTRuntimeLibs, where the option was previously defined.
Move the opts::Hugify definition to CommandLineOpts.cpp, alongside
the other global BOLT command-line options. This keeps the option
available to LLVMBOLTPasses through its existing LLVMBOLTUtils
dependency without adding a dependency on the runtime library layer.
[PowerPC][GlobalISel] Remove dependency on legal ruleset (#197375)
This fills in always legal rules, to remove the dependency on the legacy
ruleset. This is not guaranteed to be all the rules, just the ones that
appear in tests.
[clang] NFC: add asserts and fixes for enforcing template parameters have valid positions (#197598)
Some tests are violating these assertions, so they are commented out.
For the test in `clang/test/SemaTemplate/concepts.cpp`, that was broken
by #195995 and needs a partial revert at least.
[ARM][GlobalISel] Remove dependency on legal ruleset. (#197370)
This fills in always legal rules, to remove the dependency on the legacy
ruleset. The trunc rule might make some differences but it looks like
i64 zext / sext are not well supported at the moment. This is not
guaranteed to be all the rules, just the ones that appear in tests.
[clang][AArch64] Use structured bindings in feature parsing code (#197689)
Clearer than having to know that first is a CPU and second is the
feature list.
[PowerPC] Match intrinsics ppc_amo_st[dw]at with a pattern
The intrinsics are 1:1 to the instructions except for the order of
the operands, thus it is easy to match them with a pattern.
However, the intrinsics are defined as reading and writing to
memory, but the instructions explicitly set mayLoad to false.
Looking at the ISA description it seems to me that the latter
is not true. In any case, the side effect flags must be the
same, otherwise the pattern is rejected.
[libc] Annex K: Add constraint handler unit test class
This unit test class will be useful for the tests related to Annex K.
The functions in Annex K may call a constraint handler, so this new unit
test class will facilitate the checks that the constraint handling
mechanism is working as expected.
[libc++] Replace ranges::find_first_of with std::find_first_of in __try_constant_folding (#197641)
This reduces the time it takes to instantiate `std::format` from ~160ms
to ~120ms in my testing.
[AMDGPU][NFC] Remove redundant hasMadU64U32NoCarry helper (#197682)
Use hasMadNC64_32Insts() (backed by SubtargetFeature) for MAD 64_32
no-carry and drop the old helper.
[libc] Include correct headers in type_traits (#197691)
Otherwise we end up with errors like the following when building with
bazel:
```c++
In file included from external/+_repo_rules+llvm-project/libc/src/__support/CPP/type_traits/is_move_constructible.h:12:
external/+_repo_rules+llvm-project/libc/src/__support/CPP/type_traits/is_constructible.h:32:14: error: no template named 'bool_constant'
32 | : public bool_constant<__is_constructible(T, Args...)> {};
```
[DAG] SimplifyMultipleUseDemandedBits - fold (mul X, 1) -> X (#197677)
Use DemandedElts + KnownBits to match hidden identity patterns - helps
especially with reduction patterns padded by legalisation
Once #197455 has landed, I'm intending to convert this (plus
SMIN/SMAX/UMIN/UMAX and the existing ISD::ADD case) to use
isIdentityElement directly.
[LV][NFC] Remove instcombine from RUN lines in AArch64 tests (#197448)
This PR continues other work I've been doing trying to remove
unnecessary extra passes from the RUN lines in order to make it easier
to map the expected vectoriser output to the CHECK lines. As a result it
has exposed some potential optimisations that we may be able to perform
in VPlan.
Here is a summary of the changes I've noticed:
1. instcombine likes to canonicalise GEPs into certain forms. I'm not
sure if there is value in VPlan trying to guess what the canonical form
should be.
2. In tests like sve-cond-inv-loads.ll, etc. the pattern sub(urem) is
often replaced with and(sub). This is potentially something the
vectoriser could improve although I don't know if it would change the
cost model.
3. There is poor codegen in gather_nxv4i32_ind64_stride2 in the file
sve-gather-scatter.ll, which is due to
[19 lines not shown]
[PowerPC] Update base crypto builtins and intrinsics (#197017)
Update the base crypto builtins and LLVM intrinsics to drop the mma_
prefix. Also fix the builtin definitions for dmsha2hash, dmsha3hash,
and dmxxshapad to use the correct immediate constraints.
[CodeGen] Debug insns must not affect liveness analysis (#193104)
Register references in debug instructions can affect LiveRegUnits
analysis. Skip over debug instructions.
Tests in this PR would fail due to calls to LiveRegUnits::stepBackward
in RegisterScavenging, DeadMachineInstructionElim, and
AArch64InstrInfo.cpp getOutlinableRanges().
Other call-sites to stepBackward may also pass debug instructions to
LiveRegUnits::stepBackward, but LIT testing did not fail when
-debugify-and-strip-all-safe was enabled by default.
---------
Signed-off-by: John Lu <John.Lu at amd.com>