[llvm-branch-commits] [llvm] 123674a - [SLP] simplify type check for reductions

Sanjay Patel via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 13 10:35:01 PST 2021


Author: Sanjay Patel
Date: 2021-01-13T13:30:46-05:00
New Revision: 123674a816742254debdfcc978026b8107b502d8

URL: https://github.com/llvm/llvm-project/commit/123674a816742254debdfcc978026b8107b502d8
DIFF: https://github.com/llvm/llvm-project/commit/123674a816742254debdfcc978026b8107b502d8.diff

LOG: [SLP] simplify type check for reductions

This is NFC-intended. The 'valid' call allows int/FP/pointers
for other parts of SLP. The difference here is that we can't
reduce pointers.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 403170447f5a..b3a3d65d3340 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6809,10 +6809,10 @@ class HorizontalReduction {
     if (!RdxTreeInst.isVectorizable(B))
       return false;
 
+    // Analyze "regular" integer/FP types for reductions - no target-specific
+    // types or pointers.
     Type *Ty = B->getType();
-    if (!isValidElementType(Ty))
-      return false;
-    if (!Ty->isIntOrIntVectorTy() && !Ty->isFPOrFPVectorTy())
+    if (!isValidElementType(Ty) || Ty->isPointerTy())
       return false;
 
     RdxLeafVal.clear();


        


More information about the llvm-branch-commits mailing list