[PATCH] Add #pragma vectorize enable/disable to LLVM

Nadav Rotem nrotem at apple.com
Wed Dec 4 09:08:44 PST 2013


  I think that this patch is okay. I plan to remove the "LateVectorize" flag because it is on by default. Do you prefer yo remove it yourself in order to prevent a merge conflict ?


================
Comment at: test/Transforms/LoopVectorize/metadata-enable.ll:174
@@ +173,3 @@
+!1 = metadata !{metadata !"llvm.vectorizer.enable", i1 1}
+!2 = metadata !{metadata !2, metadata !3}
+!3 = metadata !{metadata !"llvm.vectorizer.enable", i1 0}
----------------
The metadata !2 is pointing to itself. 

================
Comment at: test/Transforms/LoopVectorize/metadata-enable.ll:168
@@ +167,3 @@
+for.end:                                          ; preds = %for.body
+  %1 = load i32* %a, align 4, !tbaa !1
+  ret i32 %1
----------------
Do we need !1 on this node ?

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:203
@@ -202,3 +202,3 @@
 
-  if (!LateVectorize && LoopVectorize)
-      MPM.add(createLoopVectorizePass(DisableUnrollLoops));
+  if (!LateVectorize)
+      MPM.add(createLoopVectorizePass(DisableUnrollLoops, LoopVectorize));
----------------
The 'LateVectorize' flag should go away.  We now run the vectorizer late by default. I plan to commit a fix soon. 

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:249
@@ -248,3 +248,3 @@
   // inliner.
-  if (LateVectorize && LoopVectorize) {
+  if (LateVectorize) {
     // FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
----------------
same as above. I plan to remove the LateVectorize flag. 


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



More information about the llvm-commits mailing list