FWIW it's often easier to read if you revert the original and then add the change as a separate pass.<br><br><div>-eric</div><br><div class="gmail_quote">On Tue Nov 04 2014 at 3:15:28 PM Mark Heffernan <<a href="mailto:meheff@google.com">meheff@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: meheff<br>
Date: Tue Nov  4 17:02:09 2014<br>
New Revision: 221311<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221311&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=221311&view=rev</a><br>
Log:<br>
Revert earlier change removing setPreservesCFG from instcombine (r221223) and<br>
change LoopSimplifyPass to be !isCFGOnly.  The motivation for the earlier patch<br>
(r221223) was that LoopSimplify is not preserved by instcombine though<br>
setPreservesCFG indicates that it is.  This change fixes the issue<br>
by making setPreservesCFG no longer imply LoopSimplifyPass, and is therefore less<br>
invasive.<br>
<br>
<br>
<br>
Modified:<br>
    llvm/trunk/lib/Transforms/<u></u>InstCombine/<u></u>InstructionCombining.cpp<br>
    llvm/trunk/lib/Transforms/<u></u>Utils/LoopSimplify.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/<u></u>InstCombine/<u></u>InstructionCombining.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=221311&r1=221310&r2=221311&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>Transforms/InstCombine/<u></u>InstructionCombining.cpp?rev=<u></u>221311&r1=221310&r2=221311&<u></u>view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Transforms/<u></u>InstCombine/<u></u>InstructionCombining.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/<u></u>InstCombine/<u></u>InstructionCombining.cpp Tue Nov  4 17:02:09 2014<br>
@@ -90,8 +90,7 @@ INITIALIZE_PASS_END(<u></u>InstCombiner, "instc<br>
                 "Combine redundant instructions", false, false)<br>
<br>
 void InstCombiner::<u></u>getAnalysisUsage(AnalysisUsage &AU) const {<br>
-  AU.addPreserved<<u></u>DominatorTreeWrapperPass>();<br>
-  AU.addPreserved<LoopInfo>();<br>
+  AU.setPreservesCFG();<br>
   AU.addRequired<<u></u>AssumptionTracker>();<br>
   AU.addRequired<<u></u>TargetLibraryInfo>();<br>
 }<br>
<br>
Modified: llvm/trunk/lib/Transforms/<u></u>Utils/LoopSimplify.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=221311&r1=221310&r2=221311&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>Transforms/Utils/LoopSimplify.<u></u>cpp?rev=221311&r1=221310&r2=<u></u>221311&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Transforms/<u></u>Utils/LoopSimplify.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/<u></u>Utils/LoopSimplify.cpp Tue Nov  4 17:02:09 2014<br>
@@ -778,12 +778,12 @@ namespace {<br>
<br>
 char LoopSimplify::ID = 0;<br>
 INITIALIZE_PASS_BEGIN(<u></u>LoopSimplify, "loop-simplify",<br>
-                "Canonicalize natural loops", true, false)<br>
+                "Canonicalize natural loops", false, false)<br>
 INITIALIZE_PASS_DEPENDENCY(<u></u>AssumptionTracker)<br>
 INITIALIZE_PASS_DEPENDENCY(<u></u>DominatorTreeWrapperPass)<br>
 INITIALIZE_PASS_DEPENDENCY(<u></u>LoopInfo)<br>
 INITIALIZE_PASS_END(<u></u>LoopSimplify, "loop-simplify",<br>
-                "Canonicalize natural loops", true, false)<br>
+                "Canonicalize natural loops", false, false)<br>
<br>
 // Publicly exposed interface to pass...<br>
 char &llvm::LoopSimplifyID = LoopSimplify::ID;<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>