[SCEV] Return a SCEVUse from getMulExpr and propagate use flags. (#221486)
Same as https://github.com/llvm/llvm-project/pull/220007 but for
getMulExpr:
add option to pass SCEVUse-specific flags to getMulExpr and propagate
them through, if valid conservatively. That is, the final expression
multiples the same operands (potentially in different order). For
example, it is not valid to propagate the use flags if other
(sub-)expressions have been inlined.
It also includes a few mechanical changes, to update users that still
expected const SCEV *.
PR: https://github.com/llvm/llvm-project/pull/221486
linuxkpi: Compile `x86_match_cpu()` on amd64 and i386 only
This fixes the build on other architectures where `struct x86_cpu_id` is
unavailable.
Sponsored by: The FreeBSD Foundation
[AArch64] Improve scalar fixed-point int-to-fp codegen (#220299)
[AArch64] Improve scalar fixed-point int-to-fp codegen
Select the scalar FPR shifted conversion forms when the integer input
is already in an FPR, and keep the GPR forms for integer inputs in
GPRs.
Add coverage for intrinsic and sitofp/uitofp fixed-point conversions.
Select scalar FP/SIMD-register conversion forms when a fixed-point
int-to-fp conversion uses a value extracted from a SIMD vector.
This avoids moving the reduction result through a GPR before
converting to floating point.
[NFC][analyzer] Do not spell out unreachable statement kinds in `shouldJustCallCheckers` (#223473)
The function `shouldJustCallCheckers` introduced recently in
e829049823905405779c6b908437b200e7ed1b2e returns true by default and
returns false for statement kinds where it is inappropriate to call the
PreStmt and PostStmt checkers in the "normal" pattern.
Unreachable statement kinds (e.g. control flow statements that never
appear as non-terminator statements in a CFGBlock) were covered by
explicit cases in `shouldJustCallCheckers`, but this was needless
complexity, so this commit removes it. These statement kinds run into
`llvm_unreachable` in `ExprEngine::Visit`, so the behavior of
`shouldJustCallCheckers` is completely inconsequential.
[AArch64][CostModel] Update SVE inserelement/extractelement costs (#220627)
This updates the costs for inserting/extracting elements into/from
fixed-length SVE vectors when the lane exceeds the index for the
NEON mov lane (dup/ins) instructions.
[IR] Do not track metadata uses of ConstantData (#223303)
A ConstantData is never RAUW'd or deleted (#137313 removed its use list
for that reason), so the use list of its ConstantAsMetadata node is
written but never read. Stop tracking these uses.
In a module with debug info the PoisonValue node had the largest use
lists: a debug record is retargeted to poison when the instruction it
describes is deleted (`Instruction::~Instruction`) or its location is
killed.
Aided by Opus 5
[Clang] Make Unlabeled the default control flow branch label scheme (#223297)
The work on "func-sig" label scheme is discontinued, so it's better to
switch the default to unlabeled at this time.
LowerAtomic: Preserve the volatile flag when lowering atomicrmw and cmpxchg
These utility functions built the replacements without copying the volatile
flag from the original instruction.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[X86] Fix FP `stackifier` crash on invalid `x87` inline `asm` constraints (#221881)
Fixes #149371
When an x87 inline asm uses the stack registers in a layout the FP
stackifier can't model, for example an input tied to `st(1)` while
`st(0)` and `st(1)` are both outputs, the pass reports "fixed input regs
must be last on the x87 stack" and then keeps going as if nothing
happened. It simulates the pops and pushes with counts taken from masks
it has just found to be non-contiguous, so the input never leaves the
stack model and the same register gets pushed again as an output. The
model now holds a duplicate entry, and the next `adjustLiveRegs` trips
"Live count mismatch". The odd `R0` constraint in the report isn't the
culprit, by the way; it resolves to a plain integer register and leaves
the tied `1` as the only x87 input.
Once any of these errors has been reported, the asm is no longer
simulated. The pass pops the inputs the asm kills and pushes its
outputs, which keeps the stack model consistent with what the register
[7 lines not shown]