[VPlan] Use VPlan-based cost for more replicated memory ops. (#241573)
Stop falling back to the legacy cost model in
VPReplicateRecipe::computeCost for predicated loads and stores. The
costs of the mask extracts and branches is included in both the region
cost and legacy cost computations, so it is counted twice.
In the changed tests, the costs where too high becasue the mask extracts
and branches for predicated stores were counted twice.
PR: https://github.com/llvm/llvm-project/pull/241573
[Remarks] Reject remarks of type Unknown in the bitstream parser (#242617)
The bitstream remark parser only rejected type values above
`Type::Last`, so a record with type 0, `Type::Unknown`, parsed as a
valid remark. Writing such a remark as YAML reaches
`llvm_unreachable("Unknown remark type")` in `YAMLRemarkSerializer.cpp`,
which is how `llvm-remarkutil bitstream2yaml` crashes on a container
with a zeroed type field. The YAML parser already rejects a remark
without a type.
Reject type 0 with the existing "Unknown remark type." error. The new
test serializes a remark without a type and expects that error.
Assisted-by: Claude Code (Claude Fable 5.2)
[Mips] Report tail call support only where the backend makes tail calls (#241817)
The MIPS backend makes tail calls only with -mips-tail-calls, which is
off by default, and never in MIPS16 code, and a call marked `musttail`
that it can't make is a fatal error. `MipsTTIImpl` doesn't override
`supportsTailCalls`, though, so it reports tail calls as supported, and
CoroSplit marks the resume call of every symmetric transfer `musttail`.
Any C++20 coroutine that resumes another one by symmetric transfer, as
from an `await_suspend` that returns a `coroutine_handle`, then fails to
compile for every MIPS ABI, at every optimization level:
```
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
```
#198943 closed #47971, an earlier report of this, by making the resume
functions use the C calling convention, but the backend refuses every
tail call without -mips-tail-calls.
[6 lines not shown]
[mlir][SPIR-V] Add ComplexToSPIRV lowering for complex.pow (#242263)
Decomposes complex.pow using its polar-form decomposition into the real
and imaginary components, following the same pattern as the other
transcendental complex ops in this file
[SCCP] Only invalidate calls of a function when its return value is reset (#241671)
Fixes #241244.
When FunctionSpecializer resets the lattice of a function's return
value, SCCPInstVisitor::invalidate added every user of the function to
the invalidation list. That includes uses that only pass the function's
address, like `call @g(ptr @k)`. Nothing solves such a call again, so
its result stayed undef and IPSCCP folded it to undef.
Only direct calls of the function whose signature matches depend on its
return value, so invalidate now walks only those. The walk is separate
from the one for ordinary values.
[RISCV][P-ext] Custom lower v8i8/v4i16 MUL on RV64. NFC (#242390)
Lower RV64 `v8i8`/`v4i16` multiplication through the existing
multiply-parts nodes and `PPAIRE`, extending the lowering used for
`v8i8` multiply-high operations. This replaces the nested machine
instructions in the TableGen patterns.
[llubi][NFC] Extract arithmetic and vector intrinsic helpers (#242610)
This PR factors division/remainder, vector reductions, and trailing-zero
element counting into dedicated helpers to make them reusable for later
VP implementation.
Extracted from #229351.
[Remarks] Return the error when the bitstream parser cannot enter a block
`BitstreamBlockParserHelperBase::enterBlock` tested the `Error` from `BitstreamCursor::EnterSubBlock` as a boolean and never consumed it. A container that ends right after a block header makes `EnterSubBlock` fail, and a build with `LLVM_ENABLE_ABI_BREAKING_CHECKS` then aborts with "Program aborted due to an unhandled Error" instead of reporting a parse error.
`enterBlock` now returns the error from `EnterSubBlock`, as the other bitstream readers do. The new test cuts a container written by the serializer after every 32-bit word and expects each prefix to fail. Without the fix it aborts in a build with ABI-breaking checks.
Assisted-by: Claude Code (Claude Fable 5.2)