[llvm] 1a28b9b - [VPlan] Handle invariant GEPs in isUniformAfterVectorization.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 07:53:33 PDT 2023


Author: Florian Hahn
Date: 2023-05-30T15:53:26+01:00
New Revision: 1a28b9bce75d184a74012fdf9f6e0fcbb7fd0e1c

URL: https://github.com/llvm/llvm-project/commit/1a28b9bce75d184a74012fdf9f6e0fcbb7fd0e1c
DIFF: https://github.com/llvm/llvm-project/commit/1a28b9bce75d184a74012fdf9f6e0fcbb7fd0e1c.diff

LOG: [VPlan] Handle invariant GEPs in isUniformAfterVectorization.

This fixes a crash caused by legal treating a scalable GEP as invariant,
but isUniformAfterVectorization does not handle GEPs.

Partially fixes https://github.com/llvm/llvm-project/issues/60831.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D144434

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 4ded278e8a58..055da0347d06 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2979,6 +2979,8 @@ inline bool isUniformAfterVectorization(VPValue *VPV) {
   assert(Def && "Must have definition for value defined inside vector region");
   if (auto Rep = dyn_cast<VPReplicateRecipe>(Def))
     return Rep->isUniform();
+  if (auto *GEP = dyn_cast<VPWidenGEPRecipe>(Def))
+    return all_of(GEP->operands(), isUniformAfterVectorization);
   return false;
 }
 } // end namespace vputils


        


More information about the llvm-commits mailing list