[PATCH] D22918: [Loop Vectorizer] Support predication of div/rem

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 14:21:30 PDT 2016


anemet accepted this revision.
anemet added a reviewer: anemet.
anemet added a comment.

LGTM too with the comments addressed below.  Thanks!


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4079
@@ +4078,3 @@
+  //
+  // for.body:                                       ; preds = %if.end, %entry
+  //  %add = add nsw i32 %mul, %0
----------------
Please remove the '; pred =' comments

You may want to add a

  // ...

after the for.body: label in all these loops.  That is where the div operand would be loaded, etc.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4091
@@ +4090,3 @@
+  //
+  // the sdiv at this point is scalarized and selected-out. The inactive
+  // elements in the vector are not used, but the predicated instruction is
----------------
s/selected-out/if-converted using a select/

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4101-4102
@@ +4100,4 @@
+  //  %32 = insertelement <2 x i32> undef, i32 %31, i32 0
+  //  %33 = extractelement <2 x i1> %26, i32 1
+  //  %34 = icmp eq i1 %33, true
+  //  %35 = extractelement <2 x i32> %wide.load, i32 1
----------------
%33 and %34 are not used, please remove


https://reviews.llvm.org/D22918





More information about the llvm-commits mailing list