Revert "[AMDGPU] Add implicit EXEC use to convergent inline asm (#242981)" (#243343)
This reverts commit daba4935fe66785f5452a3280c65925223b1c888.
This is not how this should be implemented
[AMDGPU] Ignore call clobbers in `fixShift64HiggRegBug` hazard check
The check for `fixShift64HighRegBug` checks the reg mask to find if
the next higher register is in use. This can give false positives.
Update it to only check for the actual registers which are used,
which is more conservative in some cases, but should help avoid miscompiles.
This bug was found due to a wrong result being computed in device libs with ASAN enabled.
[KnownFPClass][NFC] Move KnownFPClass::square out-of-line (#243342)
Moves `KnownFPClass::square` out-of-line. The only change is that
`applyOutputDenormalMode` is applied after `propagateNonNaN` and
`knownNot(fcNegative)`, but this change is unobservable.
[LoongArch] Legalize BUILD_VECTOR into a broadcast when all non-undef elements are identical (#169755)
When a BUILD_VECTOR consists of the same element (ignoring undefs),
it is better emitting a broadcast instead of multiple insertions.
Some cases which suffer performance regressions or have no benefits are
excluded in this commit.
[RuntimeLibcalls] Model wchar_t arguments in libcall signatures
RuntimeLibcalls could describe int, size_t and several other C types
but had no way to describe wchar_t, so a libcall taking one could not
be declared with the correct parameter type and extension attribute.
The width of wchar_t is not a property of the triple alone: it can be
overridden by the wchar_size module flag, as -fshort-wchar does.
Add a WChar FuncArgType that converts to an integer of
Module::getWCharSize() bits, and derive its extension attribute in
RuntimeLibcallsInfo::getExtAttrForWCharParam.
Declare wmemset using the new type. A wchar_t as wide as int is
sign-extended wherever int is, so targets such as RISC-V, MIPS, PowerPC
and SystemZ now get signext on it, while AIX, z/OS and VE, where it is
unsigned, get zeroext.
Assisted-by: Claude
[lld-macho] Keep branch-range extension thunks out of the symbol table
Make every branch-range extension thunk a local symbol. Until now,
thunks to external functions were added to the global symbol table as
private externs, and thunks to local functions had no symbol in the
output at all. This matches ld64 and ld-prime, which both emit every
branch island as a local symbol.
This also means that address assignment no longer adds anything to the
global symbol table, so code that reads it can run concurrently with
address assignment without any synchronization. A follow-up uses this to
prepare the export trie and the symbol table section while addresses are
being assigned.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[lldb] Remove empty/corrupt DataFileCache symtab/dwarf-index (#242081)
The symtab and dwarf-index DataFileCache files have the full filepath
and arch of the file used in the filename, and then in the contents of
the file there is a CacheSignature. The CacheSignature is intended to
change when the file is rebuilt, so we can detect that a binary has been
rebuilt and remove the old cached results.
This CacheSignature is performed in ManualDWARFIndex::Decode and
Symtab::Decode,
```
bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr,
bool &uuid_mismatch);
```
This method sets `uuid_mismatch=true` when that has been detected. It
returns false when the file is empty or corrupt. The callers only
handled the first case,
[17 lines not shown]
[RuntimeLibcalls] Take the module in libcall signature converters (NFC)
The converters that turn declaration C type descriptions into IR types
and attributes take a context, a triple and a data layout. A libcall
declaration can also depend on properties recorded in the module itself
rather than in the triple, so pass the module instead and derive all
three from it.
Change getDefaultFunctionTy, getFunctionTy, getVariableType and the
static helpers they use to take a Module, and update the callers. No
functional change intended.
Assisted-by: Claude
[mlir][test] Lower SCF before arith in test-tensor-e2e.mlir (#243330)
Fixes a2ab97c563d8 (#241196).
Buffer deallocation now emits a @dealloc_helper with scf.for loops, and
lowering them in -convert-scf-to-cf creates arith ops after
-convert-arith-to-llvm has already run. Run -convert-scf-to-cf first, as
the sibling tests do.
Assisted-by: Gemini
[RISCV] Fix VL optimizer crash on frame-index slide amount (#243340)
Fixes #237044.
`RISCVVLOptimizer` runs before PrologEpilogInserter, so an
alloca-derived
`vslidedown` slide amount reaches `getMinimumVLForVSLIDEDOWN_VX` as
`ADDI %stack.N, -1`. The helper called `getReg()` on the ADDI's first
operand
without checking that it is a register, which asserts on the frame
index.
Bail out when the operand is not a register. `VSLIDEDOWN` reads past VL,
so
the caller conservatively demands VLMAX, as before.
Tests:
- `CodeGen/RISCV/rvv/vl-opt.mir`: new frame-index MIR case (fails with
the
[7 lines not shown]
[lldb] Share the nlist parser with the shared cache locals (#242604)
On embedded, ParseSymtab had a second copy of the nlist parser for the
local symbols that the shared cache keeps out of the mapped image. No
macOS build compiles that copy and it had drifted from the main one.
Hoist ParseSymbolLambda, add ParseNListsLambda for the two-pass walk,
and call it for both tables.
This changes behavior on embedded:
- The unmapped locals pick up the fixes the copy missed: the two-pass
merge, N_WEAK_REF, and the section check before recording a symbol
address.
- Symbol IDs are LC_SYMTAB indexes again. 4bddca306a45 restarted them at
zero after skipping the mapped locals, so they no longer matched the
indexes the stub lookup uses.
- The unmapped locals are parsed after LC_SYMTAB and numbered from
nsyms. They all had ID 0 before. Symtab::FindSymbolByID is a binary
[2 lines not shown]
[libclc] Fix fmod returning NaN for subnormal inputs (#225351)
#124145 changed these functions to use __builtin_isfpclass for better
vectorization. However, some targets mislower isfpclass for subnormals
when denormals are enabled, causing isfinite(subnormal) to return false.
This breaks fmod (#222369), whose |x| < |y| path can return NaN instead
of the subnormal input, e.g.
fmod(-0x1.26e13p-128, -0x1.2afc64p+16) -> nan, expected -0x1.26e13p-128
Replace is_fpclass with simple comparisons:
isnan(x) -> x != x
isinf(x) -> fabs(x) == INFINITY
isfinite(x) -> fabs(x) < INFINITY
These forms still vectorize while avoiding the isfpclass issue.
isnormal/issubnormal continue to use isfpclass because they need to
[13 lines not shown]
[IR] Remove unused private member variables (NFC) (#243324)
ModuleSummaryIndex::HasSyntheticEntryCounts: The last uses were removed
on September 6, 2024 in commit d4ddf06b0c7f38612f334db71ef1d7a58a3cc8e0.
AssemblyWriter::SlotTrackerStorage: The last uses were removed on
September 2, 2015 in commit 0ffea9d47f27cf519e6a13786f3cf73b285733e2.
Assisted-by: Antigravity
[IR] Remove unused isLongDoubleX87 (NFC) (#239682)
The last uses of isLongDoubleX87 were removed on October 29, 2026 in
commit 3488dd178aefe79dc3037de57445f7c4aa75ec1d.
Assisted-by: Antigravity
[lldb] Add a `--one-shot` option to target stop-hook add (#242932)
A script that has to do something once the process stops, for example
read memory that isn't there yet when the script is loaded, can use a
stop hook, but the hook then runs at every stop. It can't stay out of
the decision to continue: returning `True` or `None` from handle_stop
votes to stay stopped, so a hook that is done keeps blocking the other
hooks' requests to continue. Deleting itself means finding out its own
ID, which no API gives it, and running `target stop-hook delete` from
inside `handle_stop`.
This patch adds `--one-shot`, which deletes the stop hook the first time
it runs, as `--one-shot` does for breakpoints. The hook runs for the
first thread it applies to, and LLDB deletes it before running it, so a
hook that resumes the process can't run again at the stop that follows.
This also fixes an issue where we have to prime a new target from the
dummy target before loading its executable: priming it after running the
executable's dSYM script lost the stop hooks that the script registered.
Assisted-by: Claude
[lldb] Show static variables of inlined functions (#242792)
Clang describes a function-local static variable once, under the
abstract instance of its function, because its location is the same in
every instance. LLDB only read the variables of the concrete instance,
so `frame variable` and `expr` could not find the variable in an inlined
frame or in the out-of-line copy of a function that is also inlined.
Add the variables that a block's abstract origin describes with a
location to the block.
Take the declaration context of a block from its own abstract origin
when it has one. It was inferred from a child with an abstract origin,
and a block that only holds a static variable has no such child, so
`expr` could not find the variable.
With this, LLDB shows the variables that #242742 keeps in the dSYM. The
dSYM variant of the test depends on that change.
rdar://192832573
Assisted-by: Claude
AMDGPU: Promote 16-bit arguments to i32 in the calling convention (#242694)
Promote i16, f16 and bf16 arguments to i32 in the calling convention
when they are inreg or real true16 is not used, instead of special
casing the copy type in LowerFormalArguments. The manual call lowering
code can now rely on LocVT / ArgVT.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc++] Handle IFUNC symbols in the ABI list script
GNU readelf only prints IFUNC for libraries marked as GNU, and the
Android library is marked as UNIX - System V, so readelf prints <OS
specific>: 10 instead. ABI script expects the symbol type to be a
single word, so it crashes on Android for IFUNC. This change maps
<OS specific>: 10 to IFUNC, records IFUNC symbols as FUNC since
callers see them as regular functions.
Link: https://github.com/llvm/llvm-project/pull/215813
Assisted-by: Gemini