[PATCH] Add support to vectorize ctlz, cttz and powi intrinsics in SLPVectorizer

Arnold Schwaighofer aschwaighofer at apple.com
Wed May 28 12:20:48 PDT 2014


With those little nitpicks fixed. LGTM.

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:966
@@ +965,3 @@
+      Value *A1I = nullptr;
+      if (hasVectorInstrinsicScalarOpd(ID, 1)) {
+        A1I = CI->getArgOperand(1);
----------------
You could remove the braces.

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:978
@@ -975,1 +977,3 @@
         }
+        // ctlz,cttz and powi are special intrinsics whose 2nd argument
+        // should be same in order for them to be vectorized.
----------------
whose second argument should be the same ...

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1678
@@ +1677,3 @@
+        // ctlz,cttz and powi are special intrinsics whose 2nd argument is a
+        // scalar this argument should not be vectorized.
+        if (hasVectorInstrinsicScalarOpd(IID, 1) && j == 1) {
----------------
whose second argument is a scalar. This argument should ...

http://reviews.llvm.org/D3851






More information about the llvm-commits mailing list