[SLP]Vectorize single-user instructions as the last-attempt seeds
Instructions with the single user cost one extract per lane, so they are
vectorized after all other roots in the function are exhausted, grouped by
the key/subkey pairs. Loads, addresses, compares and the operations, folded
away or contracted into the scalar FMA, are excluded. The rejected bundles
and the members of the priced minimal nodes are not retried, unless the
tree was dropped by the repacking overhead rather than by the members.
Reviewers: hiraditya, RKSimon, bababuck
Pull Request: https://github.com/llvm/llvm-project/pull/212579
[lldb][Python] Inline `lldb_iter` for better type inference (#214000)
Currently, the `lldb_iter` helper is used for providing `__iter__` in
the Python bindings:
```python
def lldb_iter(obj, getsize, getelem):
"""A generator adaptor to support iteration for lldb container objects."""
size = getattr(obj, getsize)
elem = getattr(obj, getelem)
for i in range(size()):
yield elem(i)
```
A type checker or LSP can't see through this function. Currently, that's
no problem, because it doesn't know the return type of any Swig wrapper,
but when we add type annotations (hopefully with Swig 4.5 in #213463),
`__iter__` remains untyped. So iterating through the wrappers won't show
the correct type.
As the functionality is fairly simple, it's easier to inline it. That's
what this PR does. Then a type checker can infer the return type.
[CostModel][X86] getArithmeticReductionCost - ensure we test the vXi1 reductions types before legalisation (#211043)
Pre-AVX512 these will be legalized to wider vector types and might match
against other reductions tables.
Noticed while working on improving logic reductions, but hit a case
with/without popcnt for bool sum reduction patterns - I've added a AVX2
test pass to check the (corrected) costs are still working
[NFC][CIR] Propagate SymbolTables better (#213972)
This came up during self-build, we are spending a lot of time in some
cases looking up using the global symbol table, which does no caching.
Previously we'd propagated this in a few places, but this patch removes
all uses of SymbolTable::lookup and adds the cache everywhere.
This involved changing the tablegen to include it in each of our
rewriters, plus the CirAttr lowering everywhere.
The only thing we have to take care of is to make sure we invalidate the
cache/update the cache whenever we add something with a name (see
createLLVMFuncOpIfNotExist).
This is NFC, as it isn't observable, other than being a build time
improvement.
[RISCV] Fix Xqci Fusions with Frame Indexes (#213815)
Pre-RA, the ADDI can contain a frame index rather than a register, which
causes `getReg()` to assert. These were missing the `CheckIsRegOperand`
that most other fusions have.
[CIR] Lower variadic calls in CallConvLowering for x86_64 (#213315)
CallConvLowering classified each function once from its declared
signature and reused that classification at every call site. An argument
passed through an ellipsis has no entry in the callee's parameter list,
so on x86_64 an ellipsis argument that needed an extension attribute, a
register coercion, or a byval slot was emitted unchanged whenever the
callee's declared parameters happened to need no rewrite, and reported
NYI when they did.
An ellipsis argument competes for the same registers as a declared one,
so the same two-eightbyte record goes in a register pair early in the
list and byval once the integer registers are gone. Variadic call sites
under the x86_64 driver are now classified from the call's own operand
types, and the declared parameter count reaches
`llvm::abi::FunctionInfo::create` as its `NumRequired` argument, which
is what lets the classifier tell a named argument from one passed
through the ellipsis. Today that flag only decides whether a large
vector goes in a register, and the CIR type bridge admits no vector
[25 lines not shown]
Merge tag 'integrity-v7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
Pull integrity fixes from Mimi Zohar:
"Two IMA bug fixes: one addresses a potential integer underflow, the
other instantiates two LSM hooks"
* tag 'integrity-v7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
ima: Instantiate file_truncate and path_truncate hooks
ima: fix out-of-bounds read in xattr_verify()
[InstCombine]Fold fcmp+select to min/max if its zero sign is missing
Look through phis, chained selects and the loop back edge to the
select itself and fold if no use can observe the sign of zero of the
result. This restores the fold for loop-carried and unrolled running
min/max values (fcsel -> fminnm on AArch64) lost to the signed zero
handling fix in matchSelectPattern (#210077).
Reviewers: nikic, dtcxzyw
Pull Request: https://github.com/llvm/llvm-project/pull/213133
[OpenMP] Simplify generic microtask dispatch (#214004)
Replace the generic microtask dispatcher's handwritten function-pointer
types and calls with a variadic-template helper and a macro for each
supported argument count.
The dispatcher still casts each microtask to the exact fixed-arity
signature required by platforms such as WebAssembly. This is intended as
a refactor only: the existing limit of 15 microtask arguments and the
diagnostic for larger argument counts remain unchanged.
This reduces the repetitive code and makes future changes to the
supported argument range easier to review.
Split out from #211071
[CostModel][AArch64] Add initial costs for `masked.compressstore` (#213712)
This adds an initial cost model for `masked.compressstore`. The tests
are based on `masked_expand_load.ll`, which covers all configurations
for the `expand`/`compact` instructions.
Note: Right now, we only report valid costs for `masked.compressstore`
operations that can be lowered with SVE1 (as that's all we handle ISEL
for at the moment).
[LoopPeel] Peel last iteration to enable load widening
In loops that contain multiple consecutive small loads (e.g., 3 bytes
loading i8's), peeling the last iteration makes it safe to read beyond
the accessed region, enabling the use of a wider load (e.g., b32) for
all other N-1 iterations.
Patterns such as:
```
%a = load i8, ptr %p
%b = load i8, ptr %p+1
%c = load i8, ptr %p+2
...
%p.next = getelementptr i8, ptr %p, 3
```
Can be transformed to:
```
%wide = load b32, ptr %p ; Read 4 bytes
[19 lines not shown]