[SystemZ] Use VMSLG for i128 multiply-accumulate of 64-bit products
Add a DAG combine that turns
(add (add (mul x0, y0), (mul x1, y1)), c)
on i128, where all x and y have their upper 64 bits known zero, into
a single VECTOR MULTIPLY SUM LOGICAL (VMSLG) instead of two MLG(R)
plus two VAQ. Requires vector-enhancements-1 (z14).
Assisted by: IBM Bob
[NVPTX] Avoid double rounding in integer to bf16 conversions (#244801)
Below sm_90, int to bf16 is lowered through f32, which rounds twice and can
be off by one ulp, e.g. `uitofp i32 16842753` gives 0x4B80 instead of 0x4B81.
Convert to f32 rounding towards zero and set the lowest bit if inexact
(round to odd), so the final rounding to bf16 is correct. Operands known to
fit in 24 bits keep the direct conversion. The first commit adds the tests.
Fixes #244593
Assisted-by: Claude Code (Claude Opus 5.5)
[ORC][C API] Add LLVMOrcThreadSafeContextWithContextDo (#232676)
LLVMOrcThreadSafeContextGetContext was removed in 0bfa0bcd79f7 along
with ThreadSafeContext::getContext, but no C API replacement for
ThreadSafeContext::withContextDo was added. As a result, C API clients
have no way to safely access the LLVMContext wrapped by an existing
LLVMOrcThreadSafeContextRef, e.g. to create a new module in it.
This patch adds LLVMOrcThreadSafeContextWithContextDo, which mirrors
LLVMOrcThreadSafeModuleWithModuleDo: the given callback is invoked with
the wrapped LLVMContext while the context lock is held.
Assisted-by: Claude Opus 5.5
Co-authored-by: Lang Hames <lhames at gmail.com>
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Replace it with the newly introduced eArgTypeDarwinLogFilter and declare
the options of the command in TableGen like the other commands.
This was the only use of eArgRawInput as an argument type. The
corresponding entry in the option argument table is kept so that
`help raw-input` still works.
The multi-line description of --filter contains manual formatting, but
apparently it has been broken since 23dffff4 (tracked by #246769).
Assisted-by: Claude
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Replace it with the newly introduced eArgTypeDarwinLogFilter and declare
the options of the command in TableGen like the other commands.
This was the only use of eArgRawInput as an argument type. The
corresponding entry in the option argument table is kept so that
`help raw-input` still works.
The multi-line description of --filter contains manual formatting, but
apparently it has been broken since 23dffff4 (tracked by #246769).
Assisted-by: Claude
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Replace it with the newly introduced eArgTypeDarwinLogFilter and declare
the options of the command in TableGen like the other commands.
This was the only use of eArgRawInput as an argument type. The
corresponding entry in the option argument table is kept so that
`help raw-input` still works.
The multi-line description of --filter contains manual formatting, but
apparently it has been broken since 23dffff4 (tracked by #246769).
Assisted-by: Claude
[lld][MachO] Reuse symbol string offsets in STABS
`SymtabSection::emitStabs()` calls `stringTableSection.addString()` for
every defined symbol's name, even though `SymtabSection::finalizeContents()`
already added those exact strings to the string table for the ordinary
symbol table. On large debug links, repeating the hash and `DenseMap`
probe for every STABS symbol accounts for a substantial share of
`__LINKEDIT` finalization.
This PR carries each symbol's existing `strx` alongside its `fileId` in
`symbolsNeedingStabs` (fitting in the existing struct padding) and reuses
it directly in `emitStabs()`.
We reuse `strx` unconditionally, including under
`-no-deduplicate-symbol-strings`. That flag (`c676104875f3`) was added as
a link-time speedup trade-off rather than to force STABS entries to
duplicate ordinary symbol names. Re-appending STABS strings in that mode
bloated outputs by 15-40% and slowed down several links due to extra
output writing and code signing; reusing `strx` avoids both while keeping
[2 lines not shown]
[VectorCombine] Fix crash on bitcasts of pointer vectors
foldBitcastShuffle divides by the scalar sizes of the source and
destination element types, which are zero for pointers. A bitcast of a
shuffled pointer vector, or one between a byte vector and a pointer
vector, then crashes with a division by zero. Take the sizes from the
DataLayout, so these bitcasts are folded too.
Fixes #246659
Assisted-by: Claude Code (Claude Opus 5.5)
[apinotes-test] Switch to OptTable (#246760)
Parse the command line with OptTable instead of cl::opt, as part of
removing cl::opt from clang/. Help output uses the OptTable format, and
LLVM's global options (e.g. -debug-only, --version) are no longer
accepted.
LLM-aided
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatform options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of RSync/Caching/SSH there.
Assisted-by: Claude
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare objc class-table dump options in TableGen (NFC)
Move the options of `language objc class-table dump` to a new
AppleObjCRuntimeOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatform options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of RSync/Caching/SSH there.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformCaching options in TableGen (NFC)
Move the --local-cache-dir option of OptionGroupPlatformCaching to
TargetOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformRSync options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of OptionGroupPlatformRSync there.
Assisted-by: Claude
[lldb] Declare OptionGroupValueObjectDisplay options in TableGen
The --dynamic-type option is an enum, but it was declared without an
argument type, so `help` printed "-d <none>" and the option was not
described as an enumeration:
```
$ (lldb) help dwim-print
-d <none> ( --dynamic-type <none> )
Show the object as its full dynamic type, not its static
type, if available.
Values: no-dynamic-values | run-target | no-run-target
$ (lldb) help <dynamic-value-type>
error: '<dynamic-value-type>' is not a known command.
```
This is now fixed, as shown in the added test.
Assisted-by: Claude
[BasicAA] Add fast path for constant-offset i8 GEPs (NFC) (#246754)
This patch adds a fast path for two-operand constant-offset i8 GEPs in
DecomposeGEPExpression.
Without this patch, we initialize a GEP type iterator and scale the
index by the element stride even for canonical i8 GEPs. Note that
accumulateConstantOffset already uses a similar fast path.
This reduces CTMark geomean instruction counts by 0.13% at -O3 and
0.19% with ThinLTO. Instruction counts on tramp3d-v4 drop by up to
0.60%.
Assisted-by: Antigravity
[AMDGPU][NFC] Split the GCN tracker path out of getRegisterPressures
With the GCN trackers, getRegisterPressures encoded the banked ArchVGPR
and AGPR numbers into the VGPR_32 and AGPR_32 slots of the pressure-set
vector, so that initCandidate could read them back out. Those slots are
meant to hold generic RegPressureTracker results indexed by pressure set.
Keep getRegisterPressures for the generic tracker only, and add
getGCNTrackerPressure, which returns the GCN trackers' GCNRegPressure.
initCandidate now computes the SGPR, ArchVGPR and AGPR pressure directly
from that GCNRegPressure when the GCN trackers are in use, without going
through the pressure-set vector.
Co-authored-by: Cursor <cursoragent at cursor.com>
[KnownFPClass] Rule out subnormal fmul results for constant scale-ups (#246718)
A finite constant with magnitude at least 1 cannot turn a non-subnormal
input into a subnormal product. Teach `KnownFPClass::fmul` to use this
fact for constant multipliers.
I need this for a NVPTX optimization to prove it is safe to use a ftz
ex2 intrinsic call.
[lldb] Declare darwin-log enable options in TableGen
The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.
Add eArgTypeLogFilter for a single filter rule and declare the options
of the command in TableGen like the other commands. The multi-line
description of --filter relies on newlines being escaped correctly in
the generated code. eArgRawInput is kept: command help still points at
'help raw-input' to explain the raw-input convention.
The usage line now lists the options in def name order.
Assisted-by: Claude
[lldb] Declare objc class-table dump options in TableGen (NFC)
Move the options of `language objc class-table dump` to a new
AppleObjCRuntimeOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformCaching options in TableGen (NFC)
Move the --local-cache-dir option of OptionGroupPlatformCaching to
TargetOptions.td.
Assisted-by: Claude
[lldb] Declare OptionGroupPlatformRSync options in TableGen (NFC)
Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of OptionGroupPlatformRSync there.
Assisted-by: Claude