[PATCH] D26083: [LV] Scalarize operands of predicated instructions

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 17:13:50 PDT 2016


mkuper added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1916
+    if (Scalars == InstsToScalarize.end())
+      return false;
+    return Scalars->second.count(I);
----------------
Can this actually happen, or should there be an assert here?

This seems weird, because if we sometimes call this before we collect the instructions for the VF, and sometimes after, then we'll get different results?


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4678
           isa<DbgInfoIntrinsic>(&I)) &&
-        Legal->isScalarAfterVectorization(&I)) {
-      scalarizeInstruction(&I);
+        (Legal->isScalarAfterVectorization(&I) ||
+         Cost->isProfitableToScalarize(&I, VF))) {
----------------
We have 5 places that call isScalarAfterVectorization().
Is this the only call site that cares about this? (If all of them should care, perhaps wrap in a helper function?)


https://reviews.llvm.org/D26083





More information about the llvm-commits mailing list