[JumpThreading] Avoid unnecessary map resizing in gatherIncomingValuesToPhi (#173596)
Previously, `gatherIncomingValuesToPhi` populated the `IncomingValues`
map with *all* non-undef incoming values from the PHI node. For PHI
nodes with a large number of incoming blocks, this caused the
`SmallDenseMap` to grow significantly, triggering expensive resizing and
rehashing operations, even when the caller
(`redirectValuesFromPredecessorsToPhi`) was only interested in a small
subset of predecessors.
This patch optimizes the logic to prevent this unnecessary map growth.
Instead of collecting all values, we now:
1. Initialize the `IncomingValues` map specifically for the blocks in
`BBPreds` (setting them to `nullptr` initially).
2. Iterate through the PHI node and update the map entries only if the
incoming block is already present in the map.
This ensures that the size of the map is bounded by the size of
[5 lines not shown]
[InstCombine][profcheck] Preserve !prof metadata when folding select. (#177707)
The new select `InstCombinerImpl::foldBinOpSelectBinOp` reuses the same
condition in the same BB as the original so the profile info can be
trivially copied over.
[RISCV] Add OPC_C0/C1/C2 named values to tablegen. NFC (#178325)
This adds named opcodes for the compressed instructions like we have for
the 32-bit instructions.
[clang][driver][darwin] Switch back to using CanonicalName to identify the SDK instead of SupportedTargets (#178115)
The SDK's SupportedTarget for its CanonicalName doesn't necessarily have
an LLVMTargetTripleSys/LLVMTargetTripleEnvironment that matches the
CanonicalName. e.g. sometimes new SDKs use arm64-apple-ios1.0 during
bringup, but their CanonicalName is set to the new platform. Go back to
using CanonicalName to identify the SDK as a Triple::OSType, and expose
the Triple::EnvironmentType used to build the SDKPlatformInfo when
SupportedTargets isn't present.
[RISCV] Make sure Zvk* and Zvb* predicates are always paired with a GetVTypePredicates<vti>.Predicates. NFC (#178269)
We were inconsistent about this. Being consistent reduces the
number of unique predicate checks in the generated file.
NFC because illegal types don't make it to isel.
[libclc] Make output filename configurable; rename top-level targets (#178119)
This PR relates to c5cb48c39701.
Pass `OUTPUT_FILENAME` to `add_libclc_builtin_set` to allow downstream
output naming (e.g. libspirv in
https://github.com/intel/llvm/tree/sycl/libclc).
Rename top-level target to `libclc-${ARG_TRIPLE}` to avoid collision
with `library-${ARG_ARCH_SUFFIX}` in our downstream when libclc TRIPLE
matches libspirv ARCH_SUFFIX.
---------
Co-authored-by: Copilot <175728472+Copilot at users.noreply.github.com>