[llvm] 87143ff - [VectorCombine] Fix a spot in commit 068357d9b09cd635b1c2f126d119ce9afecb28f7

Ben Shi via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 00:02:08 PDT 2023


Author: Ben Shi
Date: 2023-09-18T15:01:47+08:00
New Revision: 87143ff9f2f4ec897f41a40c4e410c412cca697e

URL: https://github.com/llvm/llvm-project/commit/87143ff9f2f4ec897f41a40c4e410c412cca697e
DIFF: https://github.com/llvm/llvm-project/commit/87143ff9f2f4ec897f41a40c4e410c412cca697e.diff

LOG: [VectorCombine] Fix a spot in commit 068357d9b09cd635b1c2f126d119ce9afecb28f7

My previous commit leads to a crash in "Builders/sanitizer-x86_64-linux-fast"
as https://lab.llvm.org/buildbot/#/builders/5/builds/36746. And this patch
fixes it.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 4f95eaba8de7bd2..04d79b5bdaf87b3 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -1734,15 +1734,14 @@ bool VectorCombine::run() {
 
     // This transform works with scalable and fixed vectors
     // TODO: Identify and allow other scalable transforms
-    if (isa<VectorType>(I.getType()))
+    if (isa<VectorType>(I.getType())) {
       MadeChange |= scalarizeBinopOrCmp(I);
+      MadeChange |= scalarizeLoadExtract(I);
+    }
 
     if (Opcode == Instruction::Store)
       MadeChange |= foldSingleElementStore(I);
 
-    if (isa<VectorType>(I.getType()) && Opcode == Instruction::Load)
-      MadeChange |= scalarizeLoadExtract(I);
-
     // If this is an early pipeline invocation of this pass, we are done.
     if (TryEarlyFoldsOnly)
       return;


        


More information about the llvm-commits mailing list