[PATCH] D137537: [SLP] Extend reordering data of tree entry to support PHI nodes

krishna chaitanya sankisa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 09:42:16 PST 2022


skc7 added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:289-304
 static Optional<unsigned> getInsertIndex(const Value *InsertInst,
                                          unsigned Offset = 0) {
   int Index = Offset;
   if (const auto *IE = dyn_cast<InsertElementInst>(InsertInst)) {
     if (const auto *CI = dyn_cast<ConstantInt>(IE->getOperand(2))) {
-      auto *VT = cast<FixedVectorType>(IE->getType());
-      if (CI->getValue().uge(VT->getNumElements()))
+      if (const auto *VT = dyn_cast<FixedVectorType>(IE->getType())) {
+        if (CI->getValue().uge(VT->getNumElements()))
----------------
ABataev wrote:
> Could precommit this change as a separate NFC change?
Please review: D137567


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3800-3801
 
+/// Check if two insertelement instructions are from the same buildvector.
+static bool areTwoInsertFromSameBuildVector(
+    InsertElementInst *VU, InsertElementInst *V,
----------------
ABataev wrote:
> Could precommit this change as a separate NFC change?
Please review: D137569


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137537/new/

https://reviews.llvm.org/D137537



More information about the llvm-commits mailing list