[libc] Fix vasprintf_internal null check (#245388)
vasprintf_internal mistakenly checked ret instead of *ret which may lead
to null dereference in the case malloc fails.
[InstCombine] Do not constant fold musttail calls unless trivially dead (#242905) (#245573)
When preparing the worklist in `InstCombinerImpl::prepareWorklist`,
constant propagation replaces all uses of instructions with their
constant-folded value before checking whether the instruction can
actually be deleted via `isInstructionTriviallyDead`.
For `musttail` calls with side effects (such as libcalls like `sin` or
`cos`, which may write to `errno`), the call cannot be removed
(`wouldInstructionBeTriviallyDead` returns `false`). Replacing the
returned value with a constant in the immediately following `ret`
instruction left behind an unreturned `musttail` call, violating the
LLVM IR verification requirement that the result of a `musttail` call
must be returned.
Fixes #242905.
[CodeGen][Rematerializer] Fix region bounds tracking logic
This addresses a few edge-case/rare issues with keeping the bounds of
rematerialization regions valid and up-to-date as rematerializations
happen.
1. An upper region boundary deleted through dead-def elimination needs
to be pushed to the next valid instruction.
2. Updating any region boundary in any case may require updating
boundaries of other "touching" regions to keep them valid too. Issues
could typically happen when a rematerialization region's end would be
the beginning of the next one. Receeding the beginning of the latter
region also requires receeding the ending of the former region to
keep them non-overlapping.
Added unit-tests would crash without changes.
ExpandVariadics: Report a change when rewriting a function without calls
This only reported a change if it rewrote a call, but it always
rewrites the function itself. In lowering mode a variadic function
without callers was changed without being reported.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ExpandVariadics: Invalidate function analyses individually
Avoid discarding analyses that never need to be invalidated, such as
TargetLibraryInfo. Clear the analyses of erased functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AArch64] Add feature guards to SVE and SME intrinsics
This PR adds streaming/non-streaming feature guards to the SVE and SME
intrinsics. A new verifier pass is added to rejects calls to intrinsics
whose type signature is unavailable for the function's mode and feature
flags.
Some codegen tests needed updating to avoid using types that don't
map to any legal ACLE types.
More as an optional feature; this PR adds a check to Clang's SveEmitter
to ensure that a builtin's type/target maps to a compatible LLVM intrinsic
variant, under the compatible feature flags so that incorrect mappings
are caught during TableGen generation.
I'm happy to split this PR up, but I wasn't sure that was necessarily
going to be more helpful.
[X86][APX] Keep hoist-folded-copy test effective
inline-spiller-hoist-folded-copy.ll reproduces a null VNInfo
dereference in HoistSpillHelper that needs greedy to fold a spill
into the COPY inserted by an NDD reload fold. SlotIndexes compaction
shortens the outer loop in index space, greedy spills differently,
and the test passes even with the fix reverted.
Add four empty asm statements to lengthen the loop again. The test
then crashes without the fix whether compaction is on or off.
[CodeGen][Rematerializer] Region upper-bounds are not rematerializable
Upper-bounds of rematerialization regions should not be considered
rematerializable instructions since they are semantically outside the
regions they delimitate. Rematerializing them would make region bounds
invalid.
[lldb] Speed up the XML parser
Add ASCII fast paths when decoding the input and reading names, refer to
attribute values in the input when they don't need to be normalized,
reuse attribute and text buffers across elements, and check for
duplicate attributes with a linear scan when there are only a few.
AllocToken: Only invalidate analyses of instrumented functions
AllocToken tried to preserve the CFG analyses, but did not preserve the
function analysis manager proxy, so all function analyses were
invalidated.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[GlobalISel] Set exposesReturnsTwice in IRTranslator (#240861)
Set the flag when the function calls a returns_twice function, as
FunctionLoweringInfo::set() does for SelectionDAG. Without it, passes
such as StackSlotColoring could miscompile code around setjmp.
Inliner: Reserve the clone value map from the callee block count
The value map used to clone the callee starts small and grows as
instructions are cloned. Growing it moves each entry's value
handles. Give a size estimate up front, which on tramp3d-v4 averages
4-5 map entries per block.
Instructions retired by opt -O3:
tramp3d-v4, x86_64-linux: -0.11%, -0.03% without likely_module_local
hints, -0.09% with -g
CTMark geomean, arm64: -0.06%, -0.08% with -g
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
sysutils/syslog-ng: Update to 4.13.0
This includes optional enablement of the syslog-ng supplied ivykis
which is off by default.
Original tarball submitted by:
Peter Czanik (CzP) <peter.czanik at oneidentity.com>
One Identity (Balabit) / syslog-ng upstream
[X86][APX] Test the relocation of an NF add
test_regclass_not_updated_by_regalloc_2 only produced an NDD/NF add
with a GOT operand because the allocator happened to give the add a
destination different from its source. With SlotIndexes compaction it
picks the same register, so the add is compressed to the legacy form
and the CODE_6 TODO lost its test.
Add a function whose add keeps its source live, so it stays NDD and
becomes NF under any allocation.
[X86] Enable SlotIndexes compaction by default
Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.
Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.
Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for.