[PATCH] D77756: [SVE] Remove calls to isScalable from Transforms

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 15:13:54 PDT 2020


ctetreau created this revision.
Herald added subscribers: llvm-commits, psnobl, rkruppe, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
ctetreau added reviewers: chandlerc, reames, aprantl, sdesmalen.
ctetreau added a comment.

While immediate feedback would be greatly appreciated, this commit won't actually build until D77587 <https://reviews.llvm.org/D77587> is merged. I'll ping the thread when this happens if this commit hasn't been accepted yet.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77756

Files:
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
  llvm/lib/Transforms/Scalar/SROA.cpp


Index: llvm/lib/Transforms/Scalar/SROA.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/SROA.cpp
+++ llvm/lib/Transforms/Scalar/SROA.cpp
@@ -4482,8 +4482,7 @@
 
   // Skip alloca forms that this analysis can't handle.
   auto *AT = AI.getAllocatedType();
-  if (AI.isArrayAllocation() || !AT->isSized() ||
-      (isa<VectorType>(AT) && cast<VectorType>(AT)->isScalable()) ||
+  if (AI.isArrayAllocation() || !AT->isSized() || isa<ScalableVectorType>(AT) ||
       DL.getTypeAllocSize(AT).getFixedSize() == 0)
     return false;
 
@@ -4605,8 +4604,7 @@
   for (BasicBlock::iterator I = EntryBB.begin(), E = std::prev(EntryBB.end());
        I != E; ++I) {
     if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) {
-      if (isa<VectorType>(AI->getAllocatedType()) &&
-          cast<VectorType>(AI->getAllocatedType())->isScalable()) {
+      if (isa<ScalableVectorType>(AI->getAllocatedType())) {
         if (isAllocaPromotable(AI))
           PromotableAllocas.push_back(AI);
       } else {
Index: llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
+++ llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
@@ -195,8 +195,8 @@
     break;
   case Instruction::ExtractElement: {
     Value *Vec = I.getOperand(0);
-    auto *VecVTy = cast<VectorType>(Vec->getType());
-    if (VecVTy->isScalable())
+    auto *VecVTy = dyn_cast<FixedVectorType>(Vec->getType());
+    if (!VecVTy)
       break;
     Value *Idx = I.getOperand(1);
     unsigned NumElts = VecVTy->getNumElements();
@@ -208,8 +208,8 @@
   }
   case Instruction::InsertElement: {
     Value *Vec = I.getOperand(0);
-    auto *VecVTy = cast<VectorType>(Vec->getType());
-    if (VecVTy->isScalable())
+    auto *VecVTy = dyn_cast<FixedVectorType>(Vec->getType());
+    if (!VecVTy)
       break;
     Value *Idx = I.getOperand(2);
     unsigned NumElts = VecVTy->getNumElements();
Index: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -590,8 +590,7 @@
   // Do not perform canonicalization if minmax pattern is found (to avoid
   // infinite loop).
   Type *Dummy;
-  if (!Ty->isIntegerTy() && Ty->isSized() &&
-      !(Ty->isVectorTy() && cast<VectorType>(Ty)->isScalable()) &&
+  if (!Ty->isIntegerTy() && Ty->isSized() && isa<FixedVectorType>(Ty) &&
       DL.isLegalInteger(DL.getTypeStoreSizeInBits(Ty)) &&
       DL.typeSizeEqualsStoreSize(Ty) && !DL.isNonIntegralPointerType(Ty) &&
       !isMinMaxWithLoads(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77756.256119.patch
Type: text/x-patch
Size: 2783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200408/92990880/attachment-0001.bin>


More information about the llvm-commits mailing list