[PATCH] D22867: [LV] Untangle the concepts of uniform and scalar

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 07:13:59 PDT 2016


mssimpso added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1480-1490
@@ -1482,2 +1479,13 @@
   }
+  /// Returns true if the target machine can represent \p V as a masked gather
+  /// or scatter operation.
+  bool isLegalGatherOrScatter(Value *V) {
+    auto *LI = dyn_cast<LoadInst>(V);
+    auto *SI = dyn_cast<StoreInst>(V);
+    if (!LI && !SI)
+      return false;
+    auto *Ptr = LI ? LI->getPointerOperand() : SI->getPointerOperand();
+    auto *Ty = cast<PointerType>(Ptr->getType())->getElementType();
+    return (LI && isLegalMaskedGather(Ty)) || (SI && isLegalMaskedScatter(Ty));
+  }
 
----------------
anemet wrote:
> Moving this inside Legal seems orthogonal to this patch, if so please split this part out and commit.
> Moving this inside Legal seems orthogonal to this patch, if so please split this part out and commit.
Right. Will do.

> If you're going to split this out and commit - note that this sequence is what we have the getPointerOperand() helper (that I still want to unify with the 6 others we have throughout the code base...) for.
Right. Shall I go ahead and commit an additional prequel patch that does this unification?


https://reviews.llvm.org/D22867





More information about the llvm-commits mailing list