[PATCH] Remove unroll pragma metadata after it is used

hfinkel at anl.gov hfinkel at anl.gov
Thu Jul 17 14:46:43 PDT 2014


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:286
@@ +285,3 @@
+  // First remove any existing loop unrolling metadata.
+  SmallVector<Value *, 4> Vals(1);
+  for (unsigned i = 1, ie = LoopID->getNumOperands(); i < ie; ++i) {
----------------
I suppose this 1 Value* is a placeholder for the self-reference loop-id. Should comment. Also, you expect this to be nullptr, right? You should explicit specify that so it is clear.

================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:301
@@ +300,3 @@
+      MDNode::get(Context, {MDString::get(Context, "llvm.loop.unroll.enable"),
+                            ConstantInt::get(Type::getInt1Ty(Context), 0)});
+  Vals.push_back(DisableNode);
----------------
This does not seem to match the language reference, which says "Note that setting llvm.loop.vectorize.unroll to 1 disables unrolling of the loop." -- Is that out of date?

http://reviews.llvm.org/D4571






More information about the llvm-commits mailing list