[PATCH] Propagate instruction metadata during SLP vectorization.

Raul Silvera rsilvera at google.com
Fri Nov 15 14:03:04 PST 2013


  Thanks. I've applied most comments. I've kept the layout/triple since most of the other testcases on this directory include them explicitly and in the command line.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:174
@@ +173,3 @@
+
+  for (unsigned i = 0, n = Metadata.size(); i < n; ++i) {
+    unsigned Kind = Metadata[i].first;
----------------
hfinkel at anl.gov wrote:
> The general LLVM convention seems to be to write i != n instead of i < n.
OK

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:178
@@ +177,3 @@
+
+    for (int i = 1, e = VL.size(); MD && i < e; i++) {
+      Instruction *I = dyn_cast<Instruction>(VL[i]);
----------------
hfinkel at anl.gov wrote:
> i != e
OK

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:168
@@ +167,3 @@
+static Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL) {
+  Instruction *I0 = dyn_cast<Instruction>(VL[0]);
+  if (!I0) return I;
----------------
hfinkel at anl.gov wrote:
> Under what circumstances does this cast legitimately fail?
It can't, so I've removed it.


http://llvm-reviews.chandlerc.com/D2191



More information about the llvm-commits mailing list