[PATCH] D35292: [SLPVectorizer] Add propagateIRFlagsWithOp() function to propagate IRFlags for specific Operation

Filipe Cabecinhas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 07:30:47 PDT 2017


filcab added a comment.

I don't get what you want to do here, sorry.
As I see it, in all the uses of `propagateIRFlagsWithOp(X, Y, Z)`, we have `Z == Y[0]`. Which will end up being *almost* the same as the `propagateIRFlags` but with the side-effect that `Z` will also have those flags.
I'm not sure if `Z` having those flags is on purpose, though. And I don't see what we get from that.

Please tell me if I misunderstood something. I'm not the most familiar with the SLP vectorizer.



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:226
+/// NSW, NUW, exact, and all of fast-math.
+static void propagateIRFlagsWithOp(Value *I, ArrayRef<Value *> VL, Value *OpValue) {
+  if (auto *VecOp = dyn_cast<Instruction>(I)) {
----------------
Alternative name: `propagateIRFlagsToOp` since you're propagating them to that specific op. What do you think?


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2858
+      propagateIRFlagsWithOp(V0, EvenScalars, EvenScalars[0]);
+      propagateIRFlagsWithOp(V1, OddScalars, OddScalars[0]);
 
----------------
What will be the difference between the old code and this one?


https://reviews.llvm.org/D35292





More information about the llvm-commits mailing list