[VPlan] Append recipes created via builder to worklist
The previous PR appended the top most created recipe to the worklist, and this PR extends it to any other nested recipes that were created, similar to InstCombine.
This removes the header mask in a good few more places on RISC-V as measured on SPEC CPU 2017, e.g. for the following loop:
```c
long f(const int *p, const int *q, long n) {
long a = 0, b = 0;
for (long i = 0;; i++) {
if (p[i] && q[i]) { a += i; b += i; }
if (i + 1 == n) break;
}
return a + b;
}
```
Before:
[49 lines not shown]
Switch to SmallVector with space on stack
SmallVector allows for much larger small sizes than SetVector, so use 256 to match InstructionWorklist.
We don't need to worry about duplicate worklist entries until we add users to the worklist.
[VPlan] Process simplifyRecipes in a worklist
This brings simplifyRecipes further in line with InstCombine, and asides from unlocking more simplifications it also helps avoid spurious test churn whenever passes are moved around simplifyRecipes.
For now just push the new recipe onto the worklist, not its users.
This uses a post order traversal so we maintain the same simplification order as before.
I've gone through and checked every simplification we do is a canonicalisation that converges, and I checked on llvm-test-suite + SPEC CPU 2017 in various configurations that we don't hit any cycles.
[MLIR][Linalg] Improve morphism semantics (#222959)
As exposed on the issues linked, the linalg morphism semantics could be
improved.
This PR changes the following semantics:
* Completes support for `-linalg-morph-ops` to include contractions and
ternary elementwise.
* Adds a `-linalg-categorize-ops`, which moves both named and generic
ops to category.
* Adds the possibility of "stopping at category" for both specialization
and generalization (not accessible from command line options but used by
the new categorize / old morph-ops pass).
* Removes the morphism options structure, since it's just a Boolean
flag.
* Improve test coverage, and make sure that `-linalg-morph-ops` does the
same thing as the other options.
It does NOT:
[10 lines not shown]
Reapply "clang: Use TargetID parsing from AMDGPUTargetParser" (#213824) (#213847)
This reverts commit 8f82ba2c79f4e6a69a884cc9e19bd0b8c0bbe932.
Clang subarch patches have landed, so the prematurely build bots should be OK now.
[TargetInstrInfo] Disable size verification for EH_LABEL (#223641)
EH_LABEL may produce a nop if using async exceptions and followed
by a trapping instruction.
Suppress the verification error until the incorrect size reporting
is fixed.
IR: Introduce "exception-model" module flag (#220052)
Add an "exception-model" IR module flag intended to replace
TargetOptions::ExceptionModel, such that the ABI is fully
computable from the IR alone. Add the basic documentation and
verifier/linker tests, but doesn't wire up the consumers.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
LICM: Drop -licm-force-thread-model-single in favor of the module flag (#223158)
Now that the threading model is carried by the "thread-model" IR module
flag, the hidden -licm-force-thread-model-single override is redundant: a test
can select the single-threaded model by setting the module flag directly.
isThreadLocalObject reads only Module::getThreadModel.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[LLVM][CodeGen][SVE] Add isel for constrained cast operations. (#221976)
Implements lowering for constrained variants of fpext, fptosi, fptoui,
fptrunc, rint, sitofp and uitofp. Support covers scalable vectors of
half, float and double element type, with bfloat support due in a
follow-up PR.
[SPIR-V] Emit extra DebugExpression ops under NonSemantic.Shader.DebugInfo.200
Map DWARF ops beyond Fragment only when -spirv-nonsemantic-debug-info-version=200.