[PATCH] D21755: Refine the set of UniformAfterVectorization instructions

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 17:10:49 PDT 2016


mkuper added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4947
@@ +4946,3 @@
+
+  // Loops will not be added into Worklist above. Bundle the instructions in
+  // the loop together and check their users as a group.
----------------
Did you mean "PHIs will not be added"? Also, can you explain here why they're not added?
(I mean, this doesn't even apply to all PHIs, IIRC? Some PHIs will be added, it depends on whether the branch depends on the PHI itself, or on UpdateV, right?)

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4962
@@ +4961,3 @@
+      Worklist.insert(PN);
+      Worklist.insert(UpdateV);
+    }
----------------
This looks a bit weird. If the PHI has a non-uniform use, but the update doesn't, then do we expect to have a vector version of the update?
More generally, it's a bit odd that we look at exactly one instruction backwards past the Phi. But this looks like it's a net improvement over how it worked before.

================
Comment at: test/Transforms/LoopVectorize/X86/uniform-phi.ll:31
@@ +30,3 @@
+; CHECK-LABEL: foo
+; CHECK-DAG: LV: Found uniform instruction:   %cond = icmp eq i64 %i.next, %n
+; CHECK-DAG: LV: Found uniform instruction:   %tmp1 = getelementptr inbounds i32, i32* %a, i32 %tmp0
----------------
You probably want a CHECK-NOT for %i being found uniform, right?


Repository:
  rL LLVM

http://reviews.llvm.org/D21755





More information about the llvm-commits mailing list