[alpha.webkit.UncountedLocalVarsChecker] Don't skip the else branch of an if statement with a condition variable and a trivial then branch (#227262)
Previously, when an `if` statement had a condition variable and a
trivial then branch, `TraverseIfStmt` skipped the entire statement. That
is correct for the condition variable, which is null in the else branch,
but it also skipped the else branch, which caused a missing warning for
any raw pointer/reference local variable declared there. This still
exempts the condition variable but traverses the else branch when it is
not trivial.
[lldb/Interpreter] Report scripted hook failures via Debugger::ReportError (#227508)
This patch addresses post-merge feedback on #225292.
`ReportScriptedHookError` formatted the error through a
`CommandReturnObject` whose immediate streams pointed at the hook's
output stream. Since no command is involved, this patch reports the
failure with `Debugger::ReportError` instead, which is the diagnostic
channel other scripted extensions already use when they have no caller
to return an error to.
This patch also makes the default `HandleModuleLoaded` and
`HandleModuleUnloaded` implementations in `ScriptedHookInterface` return
`llvm::errc::not_supported` rather than success, since they are only
invoked when the scripted class implements the corresponding method.
The scripted stop hook tests now assert on the diagnostic event rather
than on the debugger's output.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[RISC-V][MC] Validate instructions prior to emission in AsmParser
This ensures that broken AsmParser pseudo expansions trigger an error.
Noticed this while adding Y extension support where expanding pseudos
generated instructions that were failing predicates and/or using the
wrong register class, but since the encoded .o bit pattern as well as
the assembly output are the same for mode-dependent instructions, this
was not immediately obvious and only shows up with --show-inst.
Verify predicates and operand register classes prior to emission when
-riscv-verify-mcinst is enabled (which defaults to true under
EXPENSIVE_CHECKS).
Ideally we would do this in a target-independent way, but for now this
only checks RISC-V outputs.
[RISC-V][MC][RVY] Update base RVY to v0.9.10 specification
Update the experimental 'Y' extension version to 0.9.10 (0p910) and sync
the base RVY instruction encodings and mnemonics with the v0.9.10 draft
specification (https://github.com/riscv/riscv-cheri/releases/tag/v0.9.10-ar20260929):
* Replace `SRLIY` and the `yhir` alias with a dedicated 2-operand `YHIR`
instruction (`funct7 = 0b1111010`, `funct5 = 0b00111`), and remove the
now-unused `uimm7_eq_xlen` operand support.
* Drop `PACKY` in favor of `YHIW` (`rd = YGPR`, `rs1 = GPR`, `rs2 = GPR`).
* Rename `YSUNSEAL` to `YUNSEALS` and add `YSEALE` (`funct7 = 0b0010111`,
`rs1 = x0`).
This commit was created with the help of AI tools
[lldb] Fix unbounded recursion on an empty thread list (#227396)
ThreadPlanStackMap::Update runs inside UpdateThreadListIfNeeded, but
looked up threads with FindThreadByID, which refreshes the list again.
UpdateThreadListIfNeeded always refreshes an empty list, so a stop that
reports no threads recursed until the stack overflowed.
Look threads up without refreshing. PruneThreadPlans relied on that
lookup to refresh the list, so have it refresh the list itself.
PS: I ran into this when stepping through a Wasm module running under
the WebAssembly Micro Runtime (WAMR). The new test case mimics that
interaction.
rdar://157254463
[SelectionDAG] Keep inline asm clobbers live when read by a glued CopyFromReg (#227203)
PR #227026 marks every clobber def dead, but a flag output such as X86
`={@ccz}` is lowered to a glued `CopyFromReg $eflags` whose only
definition is the `~{flags}` clobber. With EXPENSIVE_CHECKS the verifier
reports "Using an undefined physical register" for the SETcc that reads
EFLAGS (bittest-intrin.ll, inline-asm-flag-output.ll, pr40737.ll).
Don't set the dead flag on a clobber that overlaps a physical register
read by a glued CopyFromReg.
Aided by Opus 5.5
[Sema] Return RecoveryExpr for ARC atomic ownership error (#224849)
`BuiltinAtomicOverloaded` returned a bare `ExprError()` on the ARC
ownership check and made CodeGen hit `llvm_unreachable`.
so return a `RecoveryExpr` instead so bad data can't reach codegen.
Fixes #222528.
[libc++] Run Linux benchmarks on the premerge k8s runner set (#227547)
The Linux benchmarking machine was still using the
llvm-premerge-libcxx-runners runner set, which doesn't exist anymore.
Moving to K8s also requires specifying the Docker image to use in
machines.json.
As a drive-by, drop the manual Python installation since a suitable
version of Python should already exist in the image.
[RISCV] Model Zvzip VPAIR shuffle costs (#227177)
Model pair-even and pair-odd shuffle costs using vpaire.vv and
vpairo.vv when the Zvzip extension is available.
Add a new file `RISCVVectorUtils.h` to share shuffle-mask
helpers between ISel lowering and TTI. Also move `isPairEven`
and `isPairOdd` into the new file and reuse them in TTI.
This is the second PR split out from #224991.
Assisted-by: TRAE CLI (GPT-5)
[Offload] Fix dangling memory references / leaks (#227411)
Summary:
Two small tweaks. First, the allocator creates memory for the type via
placement new, but does not deallocate it with the destructor. This is
UB and is fixed by explicitly callling the type's destructor. Second,
the plugins were only 'released', which was likely just being confused
with `reset`. Release returns the pointer, essentially giving up
ownership, but we never take the pointer so it just dangles. The correct
spelling is 'reset'.
[Plugins] Load pass plugins after parsing the command line (#226773)
opt and llc load -load-pass-plugin plugins from a cl::opt callback while
parsing argv, so that the options a plugin registers are recognized
later on the command line. cl::callback is to be removed to enable
migration to a TableGen-based option representation
(https://discourse.llvm.org/t/rfc-declare-library-command-line-options-in-tablegen-one-struct-per-library/91877/5).
Load plugins after cl::ParseCommandLineOptions. A loaded plugin's
options are no longer accepted as ordinary options; pass them with
-plugin-arg=<plugin>,<arg> instead. Prefix each Polly option in Polly
tests with -plugin-arg=Polly, and each IRTransforms example option with
-plugin-arg=SimplifyCFG,.
LLM-aided
[RISCV] Model interleave2 and deinterleave2 costs with Zvzip (#225752)
This PR extends the RISC-V TTI cost model to recognize
`llvm.vector.interleave2` and `llvm.vector.deinterleave2` when the Zvzip
extension is available.
The cost is computed based on the operand that holds the interleaved
data: the destination operand of `vzip.vv`, and the source operand of
`unzipe.v` or `unzipo.v`.
This is the first PR split out from #224991.
Assisted-By: Trae CLI (GPT-5)
[InstCombine] Fold `-X / -Y` to `X / Y` when it cannot overflow (#224025)
Fold:
```
(-X) / (-Y) -> X / Y
```
Do not combine when X may be INT_MIN and Y may be -1, as the result
could introduce signed division overflow.
For AMDGPU example:
https://godbolt.org/z/6jj6E8T5T
[lld][AArch64] Support R_AARCH64_TLSLE_ADD_TPREL_LO12 (#227173)
AArch64 local-exec TLS code sequences compiled with -mtls-size=12 use
the non-NC R_AARCH64_TLSLE_ADD_TPREL_LO12 relocation (emitted for 'add
xN, xN, :tprel_lo12:sym'), but lld only handles the _NC variant, so
linking such objects fails with 'unknown relocation'.
Add the relocation to the TLS LE group in scanSectionImpl (R_TPREL, same
group as the other TLSLE relocations, so it is also rejected for
-shared) and resolve it like the _NC variant, but with an unsigned
12-bit range check as the non-NC form requires the full offset to fit
into the imm12 field.
[Clang][HLSL] Reject matrix layout modifiers on array typedefs (#227364)
Fixes #226251
Require row_major and column_major modifiers to apply directly to a
matrix type rather than accepting an array typedef whose element type is
a matrix.
This preserves valid declarations of arrays of annotated matrix elements
while rejecting attempts to apply a layout modifier to the array type
itself.
[runtimes] Add llvm-dis to compiler-rt test dependency (#227212)
A recent commit 9a0c255ce1ef introduced dependency on llvm-dis to
compiler-rt test instrprof-thinlto-indirect-call-promotion.cpp. This
caused error "llvm-dis: command not found" in CI testing. Fix by adding
llvm-dis to the dependency list for compiler-rt test.
[orc-rt] Flatten C addressing regression tests. NFC. (#227529)
Move the tests out of same-object/ and cross-object/ subdirectories into
addressing/, and mark tests of references to entities in other objects
with a -cross-obj suffix. This keeps the variants of a construct
together, e.g. global-function-call.c next to
global-function-call-cross-obj.test, so gaps in coverage are easier to
spot.