[SLP] simplify type check for reductions
authorSanjay Patel <spatel@rotateright.com>
Wed, 13 Jan 2021 18:18:08 +0000 (13:18 -0500)
committerSanjay Patel <spatel@rotateright.com>
Wed, 13 Jan 2021 18:30:46 +0000 (13:30 -0500)
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.

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

index 4031704..b3a3d65 100644 (file)
@@ -6809,10 +6809,10 @@ public:
     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();