Skip to content

Commit f9c806a

Browse files
committed
[SLP][NFC]Make isFirstInsertElement a weak strict ordering comparator.
To be used correctly in a sort-like function, isFirstInsertElement function must follow weak strict ordering rule, i.e. isFirstInsertElement(IE1, IE1) should return false.
1 parent 8b5d9cb commit f9c806a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6659,6 +6659,8 @@ static bool areTwoInsertFromSameBuildVector(InsertElementInst *VU,
66596659
/// buildvector sequence.
66606660
static bool isFirstInsertElement(const InsertElementInst *IE1,
66616661
const InsertElementInst *IE2) {
6662+
if (IE1 == IE2)
6663+
return false;
66626664
const auto *I1 = IE1;
66636665
const auto *I2 = IE2;
66646666
const InsertElementInst *PrevI1;

0 commit comments

Comments
 (0)