[PATCH] D48214: [SLPVectorizer] Recognise non uniform power of 2 constants

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 08:58:31 PDT 2018


ABataev accepted this revision.
ABataev added a comment.
This revision is now accepted and ready to land.

LG with nits



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2283
         }
-        if (i == 0) {
-          CInt = cast<ConstantInt>(I->getOperand(1));
+        if (!CInt->getValue().isPowerOf2())
+          Op2VP = TargetTransformInfo::OP_None;
----------------
`if (Op2VP == TargetTransformInfo::OP_PowerOf2 && !CInt->getValue().isPowerOf2())`


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2285-2289
+        if (i == 0 || CInt0 == CInt) {
+          CInt0 = CInt;
           continue;
         }
+        Op2VK = TargetTransformInfo::OK_NonUniformConstantValue;
----------------
```
if (i == 0) {
  CInt0 = CInt;
  continue;
}
if (CInt0 != CInt)
  Op2VK = TargetTransformInfo::OK_NonUniformConstantValue;
```


Repository:
  rL LLVM

https://reviews.llvm.org/D48214





More information about the llvm-commits mailing list