Skip to content

Commit 6693583

Browse files
committed
some shift value will cause Shl produce PoisonValue
1 parent df7b296 commit 6693583

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,8 @@ class BinOpSameOpcodeHelper {
10641064
const APInt &CIValue = CI->getValue();
10651065
switch (Opcode) {
10661066
case Instruction::Shl:
1067-
InterchangeableMask = CIValue.isZero() ? CanBeAll : MulBIT | ShlBIT;
1067+
if (CIValue.ult(CIValue.getBitWidth()))
1068+
InterchangeableMask = CIValue.isZero() ? CanBeAll : MulBIT | ShlBIT;
10681069
break;
10691070
case Instruction::Mul:
10701071
if (CIValue.isOne()) {

0 commit comments

Comments
 (0)