[all-commits] [llvm/llvm-project] be831e: [TargetLowering] Prevent expandVectorFindLastActiv...
Craig Topper via All-commits
all-commits at lists.llvm.org
Tue Apr 14 08:01:05 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: be831e2a674397bea730c56d4a2c9ffd150a74c9
https://github.com/llvm/llvm-project/commit/be831e2a674397bea730c56d4a2c9ffd150a74c9
Author: Craig Topper <craig.topper at sifive.com>
Date: 2026-04-14 (Tue, 14 Apr 2026)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
M llvm/test/CodeGen/RISCV/rvv/vector-extract-last-active.ll
Log Message:
-----------
[TargetLowering] Prevent expandVectorFindLastActive from creating illegal vector types during vector op legalization. (#190914)
This code needs to create a step vector but we only have a mask vector
type. If the step vector is too large it might not be an MVT. This
causes the getSimpleVT() call for getTypeAction to fail. We can replace
that with the EVT version of getTypeAction, but we'll still fail trying
to legalize the vselect. The getOperationAction query will return Expand
for non-simple VTs. ExpandVSELECT will try to unroll the vselect which
will fail for scalable vectors. We could hack that to not unroll
scalable vectors, but that would be a hack.
To fix this, split the FIND_LAST_ACTIVE into two if the step vector
needs to be split. Those will recursively legalize and eventually arrive
at a size we can create a valid step vector for.
One existing test changes because it created an illegal type which
happened to still be an MVT. This allowed getOperationAction to return
Legal, even though the type isn't legal.
Fixes the assertion mentioned in #187458.
Assisted-by: Claude Sonnet 4.5
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list