[SystemZ][z/OS] Add AMODE to PR symbols
Contrary to the documentation, setting the AMODE at PR symbols is
required. The symptom is that references to variables `optind` and
`optarg` (from include `<getopt.h>`, the LE-provided C runtime)
results in "missing symbol" errors.
Fix is to add AMODE to PrAttr, analog to LdAttr.
[SSAF][SourceEdit] The last patch of expression rewrite rules for the initial version
Add a list of rewrite rules:
- '&var'/'&member' is rewritten to 'addr_of(var)', if it needs to have
bounded type;
- 'this' is rewritten to 'make_single(this)', if it needs to have
bounded type;
- A non-empty list-initializer flowing into a bounded_array LHS gets an
extra '{...}' layer;
- A union with a transformed variant member gets a '= {}' default
initializer added to one member, if necessary;
- 'delete e' gets '.data()' appended to 'e' when its base is
transformed.
Final step of
rdar://187125348
[BOLT] Share one LSDA type table across function fragments
## Motivation
The type table, the action table and the type index table of an LSDA are all
per-function. BOLT copies the first and the last verbatim from the input and
re-encodes the type table, but it emits a whole LSDA per fragment, so every one
of those tables is duplicated once per fragment even though the copies are
identical.
## Change
Emit the type table and the type index table once per function, after the LSDA
of the last fragment. Each fragment header points at that one @TType base. This
works because the base is an unsigned forward offset, because all LSDAs go to a
single section, and because the fragments of a function are emitted one after
another.
The action table stays per fragment. The personality routine locates it
[10 lines not shown]
AMDGPU: Use LiveIntervals in SIOptimizeVGPRLiveRange when available
LiveVariables has been long deprecated. Use LiveIntervals if available.
With the current pass structure, this will use LiveVariables.
Co-authored-by: Claude (Claude-Opus-4.8)
InferAddressSpaces: Replace -assume-default-is-flat-addrspace cl::opt with pass parameter (#223480)
Migrate the pass-specific command-line option to a new pass manager
pass parameter, exposed as
infer-address-spaces<assume-default-is-flat-addrspace>.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[clang-repl] Fix FindMangledNameSymbol test on Darwin/arm64e (#223410)
Fix the FindMangledNameSymbol unit test by comparing values as
llvm::orc::ExecutorAddrs.
This test was using comparing a pointer cast to uintptr_t and the result
of an ExecutorAddr::getValue call, but those can be different on
Darwin/arm64e due to pointer authentication. Comparing as ExecutorAddr
values eliminates this difference (pointer authentication bits are
stripped from both sides).
[libc] Fix sendfile argument order (#223059)
The previous implementation had the arguments swapped. This PR fixes it
and also adds a test to ensure we don't regress.
[LV] Add more tests with phis that could be FORs or predicated IVS (NFC) (#223539)
Extend test coverage with more cases where a phi can be both a FOR and a
predicated IV.
Test coverage for https://github.com/llvm/llvm-project/pull/201208.
[clang-repl] Use ExecutorAddr::toPtr to get function ptr (#223395)
Fixes the pretty-print.cpp testcase on Darwin/arm64e.
This testcase was crashing on Darwin/arm64e when it tried to call a
value's destructor via an unauthenticated pointer.
Fix the issue by updating Value::Value to use ExecutorAddr::toPtr to get
an authenticated pointer to the destructor (rather than using
ExecutorAddr::getValue, which yields a raw address with no
authentication bits)
LowerAtomic: Preserve the volatile flag when lowering atomicrmw and cmpxchg
These utility functions built the replacements without copying the volatile
flag from the original instruction.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
AMDGPU: Remove volatile from atomic tests
This is testing basic operation lowering, not volatileness.
Avoids a lot of test churn in a future change. Currently the codegen
is not actually seeing the volatile.
PPC: Replace EnableAIXExtendedAltivecABI with "target-abi" module flag (#221670)
Continue purging ABI-influencing TargetOptions fields. Eliminate this
case by migrating to a module flag, reusing the generic target-abi module
flag with a new value.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[HLSL] Add CustomTypeChecking and improve sema for texture builtins (#221060)
This PR makes the texture builtins (for load, sample, gather) use
CustomTypeChecking, and adds additional semantic checks for them to make
them more strict and conform with the way sema checks are done for other
builtins.
The main benefit of CustomTypeChecking is preventing
DefaultArgumentPromotion from occurring due to the builtins being
declared `void(...)`; primarily, the promotion of float/half to double
is undesirable.
Floating-point scalar operands in codegen (`CGHLSLBuiltins.cpp`) for
these builtins always had a check and cast of the form `if
(Op->getType() != FloatTy) Op = CreateFPCast(Op, FloatTy);` to
compensate for that, which looked like a code smell to me.
The DefaultArgumentPromotion also affected diagnostics, which would
report the promoted type (double) instead of the type the user provided
(float) (e.g., https://hlsl.godbolt.org/z/Yec3dKh14). These diagnostics
were not exercised before, and this PR adds tests to exercise them.
[14 lines not shown]
AMDGPU: Remove volatile from atomic tests
This is testing basic operation lowering, not volatileness.
Avoids a lot of test churn in a future change. Currently the codegen
is not actually seeing the volatile.
[CIR][AMDGPU] Add support for AMDGCN fmed3 builtins (#223101)
Adds codegen for the following AMDGCN fmed3 builtins:
- __builtin_amdgcn_fmed3f (float)
- __builtin_amdgcn_fmed3h (half)
These are lowered to the corresponding `llvm.amdgcn.fmed3` intrinsic.
[DWARF] Add DW_MSPACE_LLVM_* memory space encodings (#220766)
DW_AT_LLVM_memory_space is already defined in Dwarf.def, and the memory
space encodings it takes are already specified in
docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst, but the values
had no names in the source, so llvm-dwarfdump printed the attribute as a
bare integer.
Add the encodings via a HANDLE_DW_MSPACE macro alongside the existing
HANDLE_DW_ASPACE, define the MemorySpace enum, and add MemorySpaceString
and getMemorySpace. AttributeValueString then resolves the attribute, so
no changes are needed in the DWARF consumers themselves.
Unlike address spaces, memory space encodings are target-independent, so
MemorySpaceString takes no triple.
CodeGen: Clear physreg ranges after SplitCriticalEdge (#223172)
After critical edge spliting replaces a terminator, clear referenced
physreg ranges. The block's terminators may be replaced, and may
reference physical registers (e.g. WebAssebly's ARGUMENTS. When
LiveIntervals is available, repairIntervalsInRange only repairs virtual
registers, so the tracked physreg units were stale.
It feels like a bug that repairIntervalsInRange doesn't touch physregs,
but I've left that for a future change.
Co-Authored-By: Claude claude-opus-4.8 <noreply at anthropic.com>
[CIR] Accept a union whose empty member is [[no_unique_address]]
The record-wide reject for a member CIRGen marks empty is there for the
struct arm of mapCIRType, which reads such a member as an unnamed
bit-field standing for the bytes it occupies. This does not apply to a
union, so the reject moves into the struct branch.
Which variants the classifier sees then falls to the union arm, and it
now reads that from each variant's own storage rather than from its
mark. A zero-sized variant and one that is empty for the ABI are
skipped. One whose mark says empty over storage that holds data is not.
Assisted-by: Cursor / claude-opus-5