[PATCH] Use loop unrolling pragma metadata in the loop unroller

Eli Bendersky eliben at google.com
Tue Jun 10 16:02:50 PDT 2014


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:274
@@ +273,3 @@
+    bool HasEnablePragma = HasUnrollEnablePragma(L, Enable);
+    int PragmaCount;
+    bool HasCountPragma = HasUnrollCountPragma(L, PragmaCount);
----------------
Move this closer to use

================
Comment at: test/Transforms/LoopUnroll/unroll-pragmas.ll:48
@@ +47,3 @@
+  %exitcond = icmp eq i64 %indvars.iv.next, 4
+  br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !1
+
----------------
IMHO it would be more readable if you placed !1 right after this function. I don't think the mdnodes have to be necessarily collected in the bottom. Ditto for the rest

http://reviews.llvm.org/D4090






More information about the llvm-commits mailing list