Skip to content

Commit abdc067

Browse files
committed
The order of store chains needs to consider the size of the values
1 parent 79caa06 commit abdc067

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19125,6 +19125,14 @@ bool SLPVectorizerPass::vectorizeStoreChains(BoUpSLP &R) {
1912519125
if (V->getPointerOperandType()->getTypeID() >
1912619126
V2->getPointerOperandType()->getTypeID())
1912719127
return false;
19128+
if (V->getValueOperand()->getType()->getScalarSizeInBits() <
19129+
V2->getValueOperand()->getType()->getScalarSizeInBits()) {
19130+
return true;
19131+
}
19132+
if (V->getValueOperand()->getType()->getScalarSizeInBits() >
19133+
V2->getValueOperand()->getType()->getScalarSizeInBits()) {
19134+
return false;
19135+
}
1912819136
// UndefValues are compatible with all other values.
1912919137
if (isa<UndefValue>(V->getValueOperand()) ||
1913019138
isa<UndefValue>(V2->getValueOperand()))

0 commit comments

Comments
 (0)