Hexagon: Remove dead kill flag maintenance in HexagonQFPOptimizer
The operands are virtual registers, which can no longer carry kill
flags.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RISCV: Fix ensureDominates crashes on operands without a vreg def (#241034)
ensureDominates used an unchecked getVRegDef on every register
operand. This crashed on physical register uses or undef vregs. Also
fix dropping an incoming undef flag which would fail the verifier.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Revert "[RISCV][clang] Support XSfmm ABI attributes (#206260)" (#241096)
This reverts commit 09dcbfb936c629a1285fb04fff9974456f041804. Revert for
now and investigate why compile time increase.
Attributor: Decide which instructions access memory in the opcode switch
initializeInformationCache already switches over the opcode of every
instruction, and then called mayReadOrWriteMemory out of line for each
one. Decide in the switch instead, where only calls need to check their
memory effects.
Instruction counts (callgrind) with other pending attributor-light
changes applied: attributor-light sqlite3 -0.79%, kimwitu++ k -0.32%,
SPASS cnf -0.31%, consumer-typeset z08 -8.59%; the full attributor
-0.02% to -0.08%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Make IRPosition::verify inline without expensive checks (#241087)
IRPosition::verify only checks anything with EXPENSIVE_CHECKS, but
every IRPosition constructor still called it out of line. This
prevented keeping the position in registers plus the cost of the call.
Instruction counts (callgrind) over 68 llvm-test-suite TUs, with other
pending attributor-light changes applied, median:
attributor-light -0.71% (-0.45%), attributor-light-cgscc -0.31%
(-0.38%), attributor -0.35% (-0.45%).
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lldb] Don't cache symtabs for memory modules w/ corefile (#237050)
In https://github.com/llvm/llvm-project/pull/229305 I added a new
setting, `symbols.enable-lldb-index-cache-memory-modules` which creates
a DataFileCache symtab file for memory-read modules. Reading the symbol
table out of memory is a serious performance issue, and caching those
tables on the debug host is worth doing by default.
This is not the correct tradeoff if we are doing corefile debugging,
where reading memory is cheap. In that case we need to ignore the
`symbols.enable-lldb-index-cache-memory-modules` setting and not create
the symtabs, unless the user has set
`symbols.enable-lldb-index-cache` themselves.
This patchset is a little tricky because the layers where we can make
this judgement (DynamicLoader or Process) is pretty far away from the
place where we create the Symtab, `ObjectFile::GetSymtab` and there is
another scenario I want to override the default for in the future that
is only knowable to the DynamicLoader (if the DynamicLoader believes ALL
[28 lines not shown]
Use maskTrailingOnes() for the largest operand count
There's nothing in <bit> that builds a mask, but maskTrailingOnes() does,
and it's what Bitfield uses for the field's own mask. Unlike a shift or a
rotate, it's also right for a field as wide as an unsigned.
Assisted-by: Claude Opus 5.5
[Clang][CodeGen] Fix crash in implicit assignment operators after a `noreturn` member copy (#240447)
Fixes #111612
When an implicit assignment operator copies a member or base through a
`noreturn` `operator=`, `EmitStmt` emits `unreachable` and clears the
insertion point. `AssignmentMemcpyizer` then batches the trivially
copyable members that follow into one memcpy and emits it directly, so
the field GEPs were built on a null block.
`FieldMemcpyizer::emitMemcpy` now drops the batch when there is no
insertion point, as `EmitStmt` does for any other unreachable statement.
The operator then ends with the call and `unreachable`, like a
hand-written one with the same statements.
AI Assisted!
[libc++] Mark LWG2166 as "Nothing To Do" (#236422)
LWG2166 formalised the binary heap layout such that `for 0 < i < N`,
`comp(a[(i-1)/2], a[i])` is `false`. libc++’s heap algorithms already
implement this layout, so this patch is NFC and mainly adding test
coverage for heap property.
Closes: https://github.com/llvm/llvm-project/issues/99969
---------
Co-authored-by: A. Jiang <de34 at live.cn>
[opt] Register only legacy-pinned pass names as options (#234529)
opt registers every legacy pass name as an option, but only names that
shouldPinPassToLegacyPM accepts can start the legacy pipeline. The other
206 of 600 still occupy option spellings; a library option with the same
spelling aborts opt at startup. Register only the pinned names.
```
Command Before After
opt -instcombine "use -passes=" error unknown argument
opt -arm-parallel-dsp -dce runs both under the legacy PM -dce is unknown
opt -codegenprepare runs runs
opt -passes=instcombine runs runs
```
Tests that ran an unpinned pass next to a pinned one now use -passes= or
pipe into a second opt.
LLM-aided
[LoopSimplify] Don't separate nested loops on targets with branch divergence (#235627)
When a loop header has multiple backedges, LoopSimplify may call
`separateNestedLoop` to move some of them into a new inner loop. On
targets
with branch divergence, if those backedges are selected by a divergent
condition (e.g. a divergent `continue`), the new inner loop gets a
divergent
exit, and loop-carried values that were uniform (e.g. the loop counter)
can
become divergent. On AMDGPU this turns scalar values into VGPRs and adds
an
extra exec-mask loop level.
Skip `separateNestedLoop` when `TTI->hasBranchDivergence(F)` is true and
fall
back to `insertUniqueBackedgeBlock`. Degenerate header PHIs are now also
folded before inserting the unique backedge block, as
`separateNestedLoop`
[14 lines not shown]
RuntimeLibcalls: Don't apply generic memory attributes to AEABI variants
__aeabi_memcpy, __aeabi_memmove and __aeabi_memset are implementations
of the generic memcpy, memmove and memset libcalls, but they do not
return the destination and __aeabi_memset takes its value and length
arguments in the opposite order. Don't give them the attributes of the
standard functions, which mark the destination as returned.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
RuntimeLibcalls: Add missing attributes to memory and allocator libcalls
Add the attributes inferLibFuncAttributes would give these functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>