From: Alexey Bataev Date: Tue, 24 May 2022 13:01:17 +0000 (-0700) Subject: [SLP][NFC]Make isFirstInsertElement a weak strict ordering comparator. X-Git-Tag: upstream/15.0.7~6882 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9c806ae5c53c990a935c46ba351cdcfb1271c58;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index beb54dc..a8de0bf 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -6659,6 +6659,8 @@ static bool areTwoInsertFromSameBuildVector(InsertElementInst *VU, /// buildvector sequence. static bool isFirstInsertElement(const InsertElementInst *IE1, const InsertElementInst *IE2) { + if (IE1 == IE2) + return false; const auto *I1 = IE1; const auto *I2 = IE2; const InsertElementInst *PrevI1;