[PATCH] Partial fix for bug 22589

David Majnemer david.majnemer at gmail.com
Tue Feb 17 20:30:39 PST 2015


================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:122
@@ -118,1 +121,3 @@
+    new ICmpInst(InsertPt, ICmpInst::ICMP_ULT, BECount,
+                 ConstantInt::get(BECount->getType(), Count - 1));
   BasicBlock *Exit = L->getUniqueExitBlock();
----------------
Should we assert that Count is > 0?

================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:314
@@ -309,3 +313,3 @@
   // Count is the loop unroll factor, the number of extra copies added + 1.
   if ((Count & (Count-1)) != 0)
     return false;
----------------
Can we use isPowerOf2_32 here?

================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:319
@@ +318,3 @@
+  // comment on ModVal below.
+  if (Log2_64(Count) > BEWidth)
+    return false;
----------------
Would it be cheaper to do `Count > (1ULL << BEWidth)`? If it isn't, could we use Log2_32? Count is unsigned.

http://reviews.llvm.org/D7715

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list