[PATCH] D23611: [LoopUnroll] Move a simple check earlier. NFC.

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 15:50:56 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL278998: [LoopUnroll] Move a simple check earlier. NFC. (authored by haicheng).

Changed prior to commit:
  https://reviews.llvm.org/D23611?vs=68367&id=68441#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23611

Files:
  llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp

Index: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -431,16 +431,16 @@
         if (IsFree)
           continue;
 
-        // If the instruction might have a side-effect recursively account for
-        // the cost of it and all the instructions leading up to it.
-        if (I.mayHaveSideEffects())
-          AddCostRecursively(I, Iteration);
-
         // Can't properly model a cost of a call.
         // FIXME: With a proper cost model we should be able to do it.
         if(isa<CallInst>(&I))
           return None;
 
+        // If the instruction might have a side-effect recursively account for
+        // the cost of it and all the instructions leading up to it.
+        if (I.mayHaveSideEffects())
+          AddCostRecursively(I, Iteration);
+
         // If unrolled body turns out to be too big, bail out.
         if (UnrolledCost > MaxUnrolledLoopSize) {
           DEBUG(dbgs() << "  Exceeded threshold.. exiting.\n"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23611.68441.patch
Type: text/x-patch
Size: 1131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160817/2cfe8f31/attachment.bin>


More information about the llvm-commits mailing list