[X86] Use integer VT for second argument of X86ISD::VPERMILPV in combineConcatVectorOps. (#228257)
Found by adding SDTCisInt support to verifySDNode
Assisted-by: Claude
[orc-rt] Use the Error matchers in CallSPSCITest (#228353)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in CallSPSCITest.
Targets: Remove redundant TRI arguments from InstrInfo helpers
This is directly available in TargetInstrInfo.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
[Attributor] Treat a use by an externally visible global as an escape (#228283)
AAGlobalValueInfo collects the in-module uses of a local function, and
AAIndirectCallInfo uses them to drop !callees targets whose address
cannot reach the call. It follows uses through global initializers
without checking whether the global is visible outside the module, so it
misses an address that escapes that way.
For an internal function whose address is stored in an external global
and that is called through a pointer argument, the Attributor drops the
only !callees target and replaces the call with unreachable. This
happens in the module pass, in the CGSCC pass when the function and the
caller are in one SCC, and in OpenMPOpt, which runs the Attributor on
OpenMP device code at -O1 and above.
Treat a use by a global without local linkage as an escape unless the
module is a closed world.
[lldb] Decode debuggee bytes to Python str with "replace" (#224010)
Reading a C string that is not valid UTF-8 raises `SystemError`, even
though
the read succeeded and the `SBError` reports success:
```
(lldb) script
>>> process.ReadCStringFromMemory(addr, 2048, lldb.SBError())
SystemError: <built-in function SBProcess_ReadCStringFromMemory> returned
NULL without setting an exception
```
The `argout` typemap built the result with `PythonString`, which
requires
valid UTF-8. On failure `PythonString::SetString` consumes the error,
and
`PythonException`'s constructor has already called `PyErr_Clear()`, so
the
[18 lines not shown]
[orc-rt] Use the Error matchers in SimpleSymbolTableTest (#228343)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in SimpleSymbolTableTest.
The isA<StringError>() checks become Failed<StringError>(), with the
message checks folded in as a Property matcher on StringError::toString
so that both the type and the message are still verified.
[lldb] Step through inlined code when stepping out of inline frame N > 0 (#226910)
To step out of an inline frame N > 0, ThreadPlanStepOut first steps out
to frame N, then queues a plan that steps through the inlined block. Due
to a bug, ShouldStop marks the plan complete right after it queues that
plan, so the thread stops as soon as it reaches frame N, with no stop
reason.
In fact, the comment next to that code describes the intended behavior
while implementing something different: only call the StepOut plan done
if the "step out from line" plan cannot be queued.
For example, consider this backtrace:
```
frame #0: 0x00000001000003c0 deep`sink(x=81) at deep.c:4:6 [opt]
frame #1: 0x0000000100000418 deep`level3(a=48) at deep.c:11:3 [opt] [inlined]
frame #2: 0x0000000100000404 deep`level2(b=37) at deep.c:20:3 [opt] [inlined]
frame #3: 0x00000001000003f0 deep`level1(c=42) at deep.c:28:3 [opt] [inlined]
frame #4: 0x00000001000003dc deep`main at deep.c:33:3 [opt]
[8 lines not shown]
[lldb] Step through inlined code when stepping out of inline frame N > 0 (#226910)
To step out of an inline frame N > 0, ThreadPlanStepOut first steps out
to frame N, then queues a plan that steps through the inlined block. Due
to a bug, ShouldStop marks the plan complete right after it queues that
plan, so the thread stops as soon as it reaches frame N, with no stop
reason.
In fact, the comment next to that code describes the intended behavior
while implementing something different: only call the StepOut plan done
if the "step out from line" plan cannot be queued.
For example, consider this backtrace:
```
frame #0: 0x00000001000003c0 deep`sink(x=81) at deep.c:4:6 [opt]
frame #1: 0x0000000100000418 deep`level3(a=48) at deep.c:11:3 [opt] [inlined]
frame #2: 0x0000000100000404 deep`level2(b=37) at deep.c:20:3 [opt] [inlined]
frame #3: 0x00000001000003f0 deep`level1(c=42) at deep.c:28:3 [opt] [inlined]
frame #4: 0x00000001000003dc deep`main at deep.c:33:3 [opt]
[8 lines not shown]
[RISCV] Eliminate redundant materializations after register comparison (#227673)
`RISCVRedundantCopyElimination` can eliminate redundant immediate
materializations when a branch establishes a known immediate value, but
does not handle register-register `BEQ`/`BNE` when one operand is a
non-zero immediate materialized in a register.
Extend the pass to recognize `ADDI` from `X0` and `QC_LI`
materializations before the branch. On the equality edge, reuse that
known immediate so an identical materialization in the successor can be
removed. `X0` is excluded as a target register because writes to it are
discarded.
Tests cover `BEQ`/`BNE`, both operand orders, clobbers, `X0`, RV32/RV64,
and the relevant Xqci and XAndes variants.
AI tool usage: OpenAI Codex assisted with this contribution. I reviewed
and take responsibility for the final changes.
Assisted-by: OpenAI Codex
PR misc/60836 - Be more careful with /etc/ifconfig.* cloner configs
Only config cloner interfaces when an /etc/ifconfig.${cloner}N file
exists, if N is completely numeric.
[clang-repl] Evaluate a void expression that has no trailing semicolon (#228334)
An expression statement without a semicolon at the end of an input is
replaced by a call to `__clang_Interpreter_SetValueNoAlloc` that
captures its value. For an expression of type `void`, the expression was
not an argument of that call and was dropped, so `f()` did not call `f`.
Build `(E, __clang_Interpreter_SetValueNoAlloc(...))` instead.
Fixes #219800.
Assisted-by: Claude Opus 5.5
[orc-rt] Use the Error matchers in SimpleNativeMemoryMapTest (#228335)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in SimpleNativeMemoryMapTest.
Revert "[ORC] Use __unw_add_dynamic_eh_frame_section/__unw_remove_dyn… (#227894)
…amic_eh_ frame_section in RegisterEHFrames.cpp (#212260)"
Revert commit d49626c811c304c047e028a80cedc0d377f49dfb due to link
failures on some platforms (see discussion in PR).
[AMDGPU] Add getCmpSelInstrCost override to re-enable SimplifyCFG speculation for vector types (#208043)
Commit ["[CostModel] Handle all cost kinds in
getCmpSelInstrCost"](https://github.com/llvm/llvm-project/commit/0967957d7a94e1b5c749c6e963bdca25f3c6d749)
changed the base cost model to consider the type in the costs for
non-throughput cost kinds. This caused SimplifyCFG to stop folding
branches to selects on AMDGPU, since
vector selects now report higher costs that exceed the folding
threshold.
Add an getCmpSelInstrCost override for AMDGPU to partially restore the
old behavior by returning a constant unit cost for cost kind
`TCK_SizeAndLatency`. This affects speculative execution in SimplifyCFG
and SpeculativeExecution.
[orc-rt] Add VettedPeer, require it for the socket transport (#228336)
The controller at the other end of a channel can make the executor run
arbitrary code, so attaching to it is a trust decision.
VettedPeer<ChannelT> makes that decision explicit: it can only be made
through one of three named factories -- inherited, checked or unchecked
-- each naming the reason the peer is trusted.
createSimpleRemoteCAOverSocket now takes a VettedPeer<SocketHandle>
rather than a bare SocketHandle.
VettedPeer neither verifies nor records the reason. The factories exist
so that the decision can't be skipped by omission, and so that every
choice is visible in the source.
The socket:adopt connector trusts its socket as inherited, and documents
the resulting precondition on its callers.
Assisted-by: Claude