[llvm] [VectorCombine] Fix crash in scalarizeVPIntrinsic (PR #72039)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 11 14:57:57 PST 2023


================
@@ -843,6 +843,8 @@ bool VectorCombine::scalarizeVPIntrinsic(Instruction &I) {
 
   Value *ScalarOp0 = getSplatValue(Op0);
   Value *ScalarOp1 = getSplatValue(Op1);
+  if (!ScalarOp0 || !ScalarOp1)
----------------
topperc wrote:

getSplatValue can't create new instructions, it can only return an operand of existing instructions. isSplatValue can look at shuffles and see that it splat one of the elements of its input. To get that element as a scalar you would need to insert an extractelement instruction.

https://github.com/llvm/llvm-project/pull/72039


More information about the llvm-commits mailing list