[APINotes][Unversioned] Capture presence of versioned slices separately, and track different slice groups (#224860)
## Group versioned slices by lookup
Under `-fswift-version-independent-apinotes`, Clang attaches every
APINotes slice unapplied, wrapped in `SwiftVersionedAdditionAttr` or
`SwiftVersionedRemovalAttr`, and leaves the version selection to the
client. To redo that selection the client has to know which slices
compete with each other across different APINote lookups, and nothing in
the attributes said so.
The slices a client must choose between are the ones a single *lookup*
produced, not the ones a single APINotes reader supplied. Sema runs
selection once per lookup and applies every winner, and there can be
more than one lookup for the same declaration against the same reader. A
global function with a `Where:` parameter selector gets two: the broad
lookup, and the exact one.
For example, consider module `Bar`:
[102 lines not shown]
[SelectionDAG] zext/trunc size of memory libcalls to target pointer size (#226672)
Fixes #226666
For `memcpy`, `memmove`, and `memset`, the value for the number of bytes
for the operation ("Size") used the type of the intrinsic. When the type
of Size was narrower than that of the "length" parameter of the libcall,
the value would be widened with ANY_EXTEND. On RISC-V, this can
materialize as a sign extension, which leads to writing `2^33` times as
many bytes.
Changes
- Zero-extends or truncates the Size to the target pointer width (Note
that GISel already does this correctly).
- Added new RISC-V/AArch64 tests, and updated existing ones.
Note that this also fixed an AArch64 crash. With `-mattr=+mops`, SD
crashed with any non-constant i32 length argument to one of these
libcalls with "unimplemented reg-to-reg copy"
[AArch64] Adjust costs for masked CompressStore and ExpandLoad (#226950)
Currently, costs for the `llvm.expand.compressstore` and
`llvm.masked.expandload` are costs simply at 2 x the type legalization
cost. However, this does not properly represent the instructions that
are generated for these intrinsics.
The costs have been adjusted to better represent the cost of using these
intrinsics with SVE Instructions.
[clang-repl] Don't check printf output order in pretty-print.cpp (#228349)
The test added in #228334 checked the output of a JIT'd printf() with
CHECK-NEXT between lines that clang-repl prints itself. The C runtime
buffers the JIT'd code's stdout separately, so the order is not
guaranteed: on llvm-clang-x86_64-sie-win, "foo()" came after all of
clang-repl's output.
Remove that case. The case before it already checks that a void call
without a semicolon is executed (through the value of a variable it
sets), and so does the unit test ValueOfVoidCallExecutesTheCall.
Assisted-by: Claude Opus 5.5
Follows up on #228334, which introduced failures on Windows:
```
The Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-win while building clang.
[67 lines not shown]
[NFC][SPIR-V] Fix more CHECK lines that never fire in tests (#227962)
Follow-up to #227332
FileCheck ignores these lines, so the behavior they describe was
untested
- Typo `-NO:`, `-:`, `ACHECK:` and `OpCabilitity` (discard.ll,
inline_asm.ll, intel-usm-addrspaces.ll, merge-exit-break.ll,
SPV_KHR_bit_instructions.ll)
- Invalid directive `CHECK-4` (fp-simple-hierarchy.ll)
- Prefix no RUN line enables (cl_intel_sub_groups.ll,
cl_intel_subgroup_local_block_io.ll, negative.ll)
X86: Mark the tile register defs of PLDTILECFGV dead (#227602)
ldtilecfg invalidates all tile registers, which the pseudo models by
listing them in Defs. Nothing reads them from the configuration
instruction itself, so mark them dead where the pseudo is built instead
of leaving it to be re-inferred.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
Triple: Move getSjLjDataSize off TargetMachine
This eliminates the TargetMachine dependence of SjLjEHPrepare.
The pass had the questionable behavior of just proceeding with the
default size without a TargetMachine. VE is the only user and changes
the integer bitwidth used, and this doesn't seem worthwhile of a
virtual function. Move to the triple in keeping with migrating
ABI parameters out of codegen.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[Mips] Convert index to pointer type in lowerMSACopyIntr. (#228332)
The MipsISD::VEXTRACT_[SZ]EXT_ELT nodes expect a pointer sized index.
Found while trying to implement SDTCisPtrTy checking in verifySDNode.
[llvm-c][ocaml] Move DataLayout bindings from Target to Core/IR (#227714)
DataLayout is part of IR (or "Core" in C API terminology), so bindings
for it should be defined there as well. They were part of Target for
historical reasons.
This is to avoid any layering issues with referencing DataLayout from IR
APIs.