[llvm] [RISCV][VLOPT] Avoid crash when user produces scalar def (PR #120255)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 08:23:48 PST 2024
================
@@ -938,9 +938,9 @@ bool RISCVVLOptimizer::checkUsers(const MachineOperand *&CommonVL,
// The SEW and LMUL of destination and source registers need to match.
// We know that MI DEF is a vector register, because that was the guard
- // to call this function.
- assert(isVectorRegClass(UserMI.getOperand(0).getReg(), MRI) &&
- "Expected DEF and USE to be vector registers");
+ // to call this function, so we don't need to assert it.
+ assert(isVectorRegClass(UserOp.getReg(), MRI) &&
+ "Expected consumed operand to be a vector register");
----------------
michaelmaitland wrote:
We can remove it entirely.
https://github.com/llvm/llvm-project/pull/120255
More information about the llvm-commits
mailing list