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

Renato Golin renato.golin at linaro.org
Wed Dec 4 09:31:31 PST 2013



================
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));
----------------
Nadav Rotem wrote:
> The 'LateVectorize' flag should go away.  We now run the vectorizer late by default. I plan to commit a fix soon. 
I assumed so, when I figured late is the default. Still, the issue remains: do we pass inst-combine and cfg-simplify after the vectorizer, even if it's disabled by opt level AND there's no pragma?

================
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
----------------
Nadav Rotem wrote:
> Do we need !1 on this node ?
er, no, that's left over from the original IR. I'll remove.

================
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}
----------------
Nadav Rotem wrote:
> The metadata !2 is pointing to itself. 
Yes, that's the list of the metadata applied to a node, with itself as the first node as being itself. I'm not sure why this is like that, Arnold might know why.

================
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
----------------
Nadav Rotem wrote:
> same as above. I plan to remove the LateVectorize flag. 
If it's just removing the flag, I can do it in this patch. But if it's more involved, than I can wait for you to do it and rebase.


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



More information about the llvm-commits mailing list