[llvm] 119b0f3 - Revert "[SLP]Fix PR69196: Instruction does not dominate all uses"

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 13:29:28 PDT 2023


Author: Alexey Bataev
Date: 2023-10-16T13:29:17-07:00
New Revision: 119b0f3895688173e262aaceaf90be8b303194f3

URL: https://github.com/llvm/llvm-project/commit/119b0f3895688173e262aaceaf90be8b303194f3
DIFF: https://github.com/llvm/llvm-project/commit/119b0f3895688173e262aaceaf90be8b303194f3.diff

LOG: Revert "[SLP]Fix PR69196: Instruction does not dominate all uses"

This reverts commit 8e2b2c4181506efc5b9321c203dd107bbd63392b to fix
a crash reported in https://lab.llvm.org/buildbot/#/builders/230/builds/19993.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-reused-as-last-inst.ll


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 1482d83bad4f6f6..6a9bdc26bc88f94 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -11214,7 +11214,7 @@ Value *BoUpSLP::vectorizeTree(
     TE->VectorizedValue = nullptr;
     auto *UserI =
         cast<Instruction>(TE->UserTreeIndices.front().UserTE->VectorizedValue);
-    Builder.SetInsertPoint(UserI);
+    Builder.SetInsertPoint(PrevVec);
     Builder.SetCurrentDebugLocation(UserI->getDebugLoc());
     Value *Vec = vectorizeTree(TE);
     PrevVec->replaceAllUsesWith(Vec);

diff  --git a/llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-reused-as-last-inst.ll b/llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-reused-as-last-inst.ll
deleted file mode 100644
index 3a9eca2bf2e6b6a..000000000000000
--- a/llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-reused-as-last-inst.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
-; RUN: opt -S -passes=slp-vectorizer -slp-threshold=-9999 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
-
-define void @foo() {
-; CHECK-LABEL: define void @foo() {
-; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i32> <i32 poison, i32 0>, i32 0, i32 0
-; CHECK-NEXT:    br label [[BB1:%.*]]
-; CHECK:       bb1:
-; CHECK-NEXT:    [[TMP1:%.*]] = phi <2 x i32> [ zeroinitializer, [[BB:%.*]] ], [ [[TMP6:%.*]], [[BB4:%.*]] ]
-; CHECK-NEXT:    [[TMP2:%.*]] = shl <2 x i32> [[TMP1]], [[TMP0]]
-; CHECK-NEXT:    [[TMP3:%.*]] = or <2 x i32> [[TMP1]], [[TMP0]]
-; CHECK-NEXT:    [[TMP4:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> [[TMP3]], <2 x i32> <i32 0, i32 3>
-; CHECK-NEXT:    [[TMP5:%.*]] = shufflevector <2 x i32> [[TMP4]], <2 x i32> [[TMP1]], <2 x i32> <i32 0, i32 3>
-; CHECK-NEXT:    [[TMP6]] = or <2 x i32> [[TMP5]], zeroinitializer
-; CHECK-NEXT:    [[TMP7:%.*]] = extractelement <2 x i32> [[TMP6]], i32 0
-; CHECK-NEXT:    [[CALL:%.*]] = call i64 null(i32 [[TMP7]])
-; CHECK-NEXT:    br label [[BB4]]
-; CHECK:       bb4:
-; CHECK-NEXT:    br i1 false, label [[BB5:%.*]], label [[BB1]]
-; CHECK:       bb5:
-; CHECK-NEXT:    [[TMP8:%.*]] = phi <2 x i32> [ [[TMP4]], [[BB4]] ]
-; CHECK-NEXT:    ret void
-;
-bb:
-  br label %bb1
-
-bb1:
-  %phi = phi i32 [ 0, %bb ], [ %or, %bb4 ]
-  %phi2 = phi i32 [ 0, %bb ], [ %or3, %bb4 ]
-  %and = and i32 0, 0
-  %shl = shl i32 %phi, %and
-  %or = or i32 %shl, 0
-  %call = call i64 null(i32 %or)
-  %or3 = or i32 %phi2, 0
-  br label %bb4
-
-bb4:
-  br i1 false, label %bb5, label %bb1
-
-bb5:
-  %phi6 = phi i32 [ %shl, %bb4 ]
-  %phi7 = phi i32 [ %or3, %bb4 ]
-  ret void
-}


        


More information about the llvm-commits mailing list