[AVR][MSP430] Explicitly specify the underlying type of wchar_t (NFC) (#240653)
Make the choice deliberate instead of relying on the default.
The changes are covered by existing preprocessor tests.
MC: Handle XCOFF directives in the null streamer (#239821)
MCNullStreamer only overrode emitXCOFFSymbolLinkageWithVisibility, so
llc -filetype=null on AIX hit the llvm_unreachable in the MCStreamer
base implementations of .lcomm, .ref, .except and .info emission.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[VPlan] Transform reverse loads into vp.strided.load with -1 stride
Rebased from the WIP on loop-vectorize/reverse-vp-strided-load.
After simplifyReverses pulls reverses out of elementwise recipes, look
through single-use elementwise trees under a reverse to the reverse
consecutive loads at their leaves (live-ins are allowed as splats), and
replace each load with a vp.strided.load with a negative stride when it
is legal and cheaper than the loads plus the reverse. This is the VPlan
equivalent of RISC-V's performReverseEVLCombine.
Fixes #204154.
[VPlan] Pull permutations through elementwise ops with single scalar operands
pullOutPermutations previously only treated live-ins as splats, but we can generalize this to single scalars. This allows eliminating reverses through e.g. invariant loads.
Attributor: Query the memory effects of a call site once
Instead of separately checking mayRead / mayWrite, directly compute
the full memory effects.
attributor-light is 0.1-0.25% faster (callgrind).
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Reserve the initial worklist of the fixpoint iteration
CTMark instructions:u with -attributor-enable=light changes by O3 -0.02%,
ThinLTO -0.02%. attributor-light is 0.3-1.0% faster.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Skip looking for callback uses if the callee has no callbacks
getAssociatedArgument collected the callback uses of the call even if
the callee has no !callback metadata. Return the callee argument
directly in that case.
CTMark instructions:u with -attributor-enable=light changes by O3 -0.03%,
ThinLTO -0.04%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
MustExecute: Don't set up the visited set of the end iterator
The end iterator of every explorer inserted a null instruction into
its visited set and allocating it, though it never explores anything.
CTMark instructions:u with -attributor-enable=light changes by O3 -0.07%,
ThinLTO -0.14%; the Attributor creates an explorer for every run.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Don't copy the triple to check for GPUs
AA::isGPU and the GPU address space helpers copied the module's target
triple on every call, unnecessarily allocating a string.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[RISCV][P-ext] Disable useRVVForFixedLengthVectors when P is enabled. (#240636)
We haven't done anything to select priority for P or RVV. Right now the
setOperation action calls run for both and leave things in a weird
state.
This patch disables useRVVForFixedLengthVectors when P is enabled so we
only run one set of setOperationAction calls for fixed vectors. This is
the lowest effort fix and I suspect there are still more issues.
Fixes #240534.
[InferAddressSpaces] Use a new value map for each rewritten constant (#240662)
When the pass rewrites a flat constant expression, it remaps the
instructions that use it through other constant expressions with a
`ValueMapper`. All rewritten constants shared one map, and the mapper
caches every constant that it visits, including the ones that it maps to
themselves. So when one instruction uses two rewritten constants, the
remap for the first one caches the part with the second one as
unchanged, and the remap for the second one reuses that entry. For
example, if a call has `addrspacecast`s of two flat pointers that are
based on the same `addrspace(3)` global, only one argument is folded.
This PR uses a new map for each rewritten constant.
This PR was assisted by AI but I reviewed all the changes.
[obj2yaml][COFF] Add BBAddrMap support to coff2yaml (#239461)
Decode .llvm_bb_addr_map sections into Entries and PGOAnalyses with the
shared BBAddrMap decoder, mirroring elf2yaml and the yaml2coff support
added in #224504.
Make `SectionData` optional so decoded and empty BBAddrMap sections omit
it, and reject explicitly empty `SectionData` alongside `Entries` or
non-empty `StructuredData`.
The tests are mirrored from their ELF counterparts.
Attributor: Don't keep a reference into the function information map
getFunctionInfo kept a reference to the map entry while initializing the
information, which can add other functions to the map. If that grows the
map, the reference dangles and the function information is read from freed
memory.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Revert "[HIP] Add __exp2f to the HIP math header (#236328)" (#240703)
This reverts commit dbb0418043e246d31aaab324dbe0c1e7097be391.
This does not exist in CUDA and I do not think it's appropriate to add
extensions in the global namespace with so little discussion