[PATCH] D12259: Improved Diagnostics and Extended vectorize(enable)

Tyler Nowicki via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 16:08:13 PDT 2015


tyler.nowicki added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:937-943
@@ -921,1 +936,9 @@
+
+  bool allowReordering() const {
+    // Allow the vectorizer to change the order of operations that is given by
+    // the scalar loop when it is potentially unsafe or inefficient. For
+    // example, changing the order of floating-point operations can affect the
+    // result due to differences in floating-point round-off. Specifying a loop
+    // hint instructs the vectorizer to proceed.
+    return getForce() == LoopVectorizeHints::FK_Enabled || getWidth() > 1;
   }
----------------
mzolotukhin wrote:
> It's a bit unclear, what `getWidth()` has to do with reordering of operations. Do we basically check that the loop has any vectorization hint attached to it (and that it's not "don't vectorize this loop")? If my understanding is correct, could you please mention it in the comment somehow?
I'll modify the comment to make it a little more clear that an enabling hint indicates reordering.


http://reviews.llvm.org/D12259





More information about the llvm-commits mailing list