[DebugInfo] Remove unused DWARFDebugLoc::Locations (NFC) (#243719)
The last uses were removed on November 8, 2019 in commit
01bb3b07c346c4215a83893d15f3c6022773ef83. This patch also removes the
now-unused LocationLists and LocationList.
Assisted-by: Antigravity
[CodeGen] Remove unused FaultMaps::faultTypeToString (NFC) (#243718)
The last caller was removed on June 28, 2025 in commit
d93aff42c23069c27dae411fd0f60bd19ad04ad9.
Assisted-by: Antigravity
[Hexagon] Ignore debug instructions in GenInsert distance calculations (#232188)
GenInsert prunes candidates based on instruction distance. Counting
debug instructions against that limit lets debug information change
whether insert instructions are formed.
Cache non-debug block sizes and skip debug instructions in partial
ranges while preserving pseudo-probe and bundle accounting. The
regression test covers both distance paths across multiple blocks.
Assisted-by: OpenAI Codex 5.6 Sol
Assisted-by: Claude (review)
[AArch64][SME] Ignore debug instructions between streaming mode pairs (#232187)
A debug instruction between matching SMSTART and SMSTOP instructions
resets the peephole candidate, so debug information keeps an otherwise
redundant streaming-mode pair.
Ignore debug instructions while scanning between the pair. The
regression test checks that the pair is removed across a debug record.
Assisted-by: OpenAI Codex 5.6 Sol
Assisted-by: Claude (review)
[ARM][MVE] Erase predicate constants whose only remaining uses are debug uses (#242639)
`ReplaceConstByVPNOTs` replaces a predicate constant that is the inverse
of
an earlier one with a `VPNOT` of the earlier predicate, or reuses an
earlier
predicate with the same value, then erases the constant's `COPY` and
`t2MOVi`/`t2MOVi16` if nothing else uses them. Those checks use
`use_empty()` and `hasOneUse()`, which count `DBG_VALUE`s, so a debug
use
keeps a dead `movw` under `-g`. This happens in ordinary C when an
`mve_pred16_t` variable holds a predicate whose inverse is also used.
Use `use_nodbg_empty()` and `hasOneNonDBGUse()` in both places. The
erased
instructions' `DBG_VALUE`s are left in place; LiveDebugVariables drops
them
later, as for other erased definitions.
[7 lines not shown]
[MachineCombiner] Do not take a DBG_VALUE as the user of an accumulator chain (#242642)
`getAccumulatorReassociationPatterns` checks that the root has one
non-debug user and then rejects the root if that user has the same
opcode,
because the chain continues there. It takes the user with
`use_instr_begin()`, which can return a `DBG_VALUE`. The same-opcode
check
then passes, a value in the middle of the chain is treated as its end,
and
the chain is reassociated only under `-g`. This happens in C when a
variable
holds a `vabal` accumulator whose chain continues in a later block.
Use `use_instr_nodbg_begin()`, matching the `hasOneNonDBGUser()` check.
The new function in `machine-combiner-reassociate-accumulators.mir` is
the
`uabal_accumulation` chain with its last `UABAL` given a `DBG_VALUE` and
[14 lines not shown]
[ARM] Do not let a DBG_VALUE start the A15 S->D rewrite (#242636)
`A15SDOptimizer::runOnInstruction` runs on every instruction, including
`DBG_VALUE`s, and `getReadDPRs` does not skip them. A debug value of a D
register built from two S registers therefore starts the rewrite and
adds
`vdup`/`vext` under `-g` only. This happens when a variable holds a
`<2 x float>` vector built from two floats.
Return early for debug instructions.
The new function in `a15-SD-dep.ll` builds a `<2 x float>` from two
floats, and a new RUN line repeats the run with the optimization enabled
under `-debugify-and-strip-all-safe`, which gives the vector a debug
use.
Without the change that run emits `vdup.32`/`vext.32`; with it no
instruction is added.
This PR is assisted by Claude and reviewed by yqtian-se.
[ARM] Do not count debug instructions in the MLx expansion hazard window (#242650)
`ExpandFPMLxInstructions` keeps the last few instructions in a window to
decide whether a `VMLA`/`VMLS` should be expanded into a multiply and an
add. It skips positions, implicit defs and copies, but not `DBG_VALUE`s,
so
debug instructions push the dependent instruction out of the window and
the
`vmla` is kept under `-g` only (`-mcpu=cortex-a9`). Two variables that
hold
the multiply-add result are enough.
Skip debug instructions along with the other instructions that emit no
code, so the window holds only real instructions and the expansion
decision
is the same with and without debug info.
The new function in `fmacs.ll` has `#dbg_value`s of two variables after
the multiply-add. Without the change the hard-float Cortex-A9 run emits
[7 lines not shown]
[IR] Destroy token none before value metadata (#229280)
A `ValueAsMetadata` may wrap the context-owned `ConstantTokenNone`.
`TheNoneToken` is a `unique_ptr` member and was previously destroyed
only after the `LLVMContextImpl` destructor body, but the
`ValuesAsMetadata` entries are deleted inside that body. The later
`Value` destruction therefore looked up a dangling entry and
double-freed it.
Destroy `TheNoneToken` with the other context-owned constants before
tearing down `ValuesAsMetadata`. Add a minimal assembler regression
test.
Fixes #229065
[AArch64] Ignore debug labels when folding settag SP updates (#230904)
With AArch64 MTE stack tagging, a source label can place a `DBG_LABEL`
between the final tag store and the epilogue SP update.
`TagStoreEdit::emitCode` currently checks only the instruction
immediately after the tag stores. This patch skips consecutive
`DBG_LABEL`s when looking for the update, while emitting the loop at its
original position so the labels remain after the tag stores. It does not
skip `DBG_VALUE`, which may describe the SP before the update. The new
IR test checks the folded instruction and excludes the redundant SP
updates.
[VPlan] Support interleaving early exit loops with side effects
We couldn't do this on main previously because the exit mask `active-lane-mask(0, FirstActiveLane(Cond))` doesn't get unrolled properly across parts. Now that we use mask.beforefirst we can unroll it properly in a chain. The unrolled form is:
unroll(mask.beforefirst, P) = mask.beforefirst(cond[P] | broadcast(anyof(not(unroll(mask.beforefirst, P-1)))))
On AArch64 this can be combined to brkpb in another patch.
aw_thermal: Add support for the H6
Add the thermal sensor controller of the H6, which has two sensors, for
the CPU and the GPU.
The controller has other registers than the one of the supported SoCs.
The efuse has the temperature of the factory test and the value of each
sensor at this temperature, from which the calibration value of each
sensor is computed and written to the controller.
The alarm and shutdown thresholds and the interrupts are not supported
yet.
Tested on: Pine H64 (CPU and GPU temperatures, idle and under load)
aw_thermal: Make the data register and the alarm support per SoC
The controller of the H6 has its data registers at another offset and
other alarm, shutdown and interrupt registers.
Add the offset of the first data register to the SoC configuration,
and a flag for the alarm handling (interrupt, alarm and shutdown
thresholds and the cpufreq throttling), set for all the SoCs
currently supported.
No functional change intended.
aw_thermal: Add an init function to the SoC configuration
Move the initialisation of the controller to a function of the SoC
configuration, as the controller of the H6 is different from the one
of the other supported SoCs.
No functional change intended.
aw_sid: Add the thermal sensor calibration fuse of the H6
The thermal sensor controller of the H6 gets its calibration data from
the 8 bytes of the efuse at offset 0x14, referenced by the
ths_calibration nvmem cell. Add it so the thermal driver can read it.
Tested on: Pine H64 (thermal sensor calibration)
aw_sid: Add the CPU speed grade fuse of the H6 and H616
The OPP tables of the H6 and H616 use the speed grade, stored in the
efuse, to select the voltage of each OPP. Add it as a fuse so it can be
read from the cpu_speed_grade nvmem cell, and expose it in a sysctl.
The speed grade of the H616 is the 2 first bytes of the efuse and
overlaps with the root key. Match the size too when looking up the
fuse of an nvmem read.
Tested on: Pine H64 (sysctl dev.aw_sid.0.speedgrade)
ccu_h6: Add the bus gates of UART1, UART2 and UART3
The firmware only leaves the gate of UART0 on. The UARTs of the H6 are
snps,dw-apb-uart and uart_snps enables the bus clock of the device, but
the clock does not exist, so the gate of the other UARTs stays off. With
a device tree where one of them is enabled (the Bluetooth UART of the
Pine H64 model B), uart_bus_probe() accesses the registers of a gated
UART and the boot hangs.
Add the gates of UART1 to UART3. The one of UART0 is left out for now,
with it uart_snps gets the clock rate and detects a 256 bytes FIFO, and
the input of the console is delayed.
Tested on: Pine H64 (model B device tree, UART1)
[HLSL] Add QuadAll Emulation support (#240645)
This PR completes parity with DXC in support of the QuadAll builtin.
QuadAll's dedicated op was implemented for SM 6.7+ in #236932, but this
PR adds emulation support by using QuadRead in the X, Y, and diagonal
directions. This can work even from SM 6.0.
Also adds derivative mode when applicable.
Some test updates were needed due to a failing validator, the validator
change was introduced by
https://github.com/KhronosGroup/SPIRV-Tools/pull/7033
Fixes https://github.com/llvm/llvm-project/issues/99215
Assisted by: Github Copilot
---------
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
Copilot-Session: 365638e8-2291-4925-8f1e-1b5c23220818
[AMDGPU][Docs] Fix terminology for memory model and DMA operations (#243428)
- Define operations in terms of actions performed by dynamic instances.
- Use consistent wording for effects and their propagation.
- Clean up section headings, scope properties, and minor wording.
- Normalize async load/store names in stages, examples, and scheduling.
Assisted-by: AI
[RISCV][P-ext] Unroll v2i32 vselect to and/not/or on RV32. (#243654)
Also unroll non-splat v2i32 sshlsat to avoid regression. If we make
vselect custom without this, the v2i32 sshlsat gets expanded to vector
operations that then get scalarized. Since we support i32 sshlsat, we
should use that directly.
Assisted-by: Claude
[RISCV] Use fcvt.w(u).s for (i32 (fp_to_(s/u)int (f16/bf16 X)) even when f16/bf16 isn't a legal type. (#243664)
Previously we emitted fcvt.l(u).w.
We can't convert f16/bf16 directly to i32 so we emit a libcall to
convert f16/bf16 to f32, then convert f32 to integer. With
Zfhmin/Zfbfmin/Zhinxmin the f16->f32 libcall is an instruction.
We should use the same f32->int conversion instruction for both
cases.
Using fcvt.w(u).s produces a sign extended value that may help
removal of sext.w in some cases. fcvt.l.w was emitted with an
AssertSExt i32 which is why only the fcvt.lu.w tests are affected.
Assisted-by: Claude