<div dir="ltr">LGTM! This looks like the perfect minimal fix. Thanks for tracking this down, I think this has actually been a root cause of a few things I've tried (and failed) to debug as well.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 4, 2014 at 4:06 PM, Mark Heffernan <span dir="ltr"><<a href="mailto:meheff@google.com" target="_blank">meheff@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 4, 2014 at 12:46 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div><span style="color:rgb(34,34,34)">Can you show the same diff to the pass structure for the latter change?</span><br></div></div></div></div>
</blockquote></div><br></div></span><div class="gmail_extra">Here you go (for -O2). The only difference is an additional loopsimplify pass. The baseline here is the state before my earlier patch, so this diff only represents changing LoopSimplify to !isCfgOnly.</div><div class="gmail_extra"><div class="gmail_extra"><br></div><div class="gmail_extra">--- passes.before.txt<span style="white-space:pre-wrap"> </span>2014-11-04 13:59:22.933766046 -0800</div><div class="gmail_extra">+++ passes.after.txt 2014-11-04 13:53:04.199887020 -0800</div><div class="gmail_extra">@@ -1,122 +1,123 @@</div><span class=""><div> Pass Arguments: -datalayout -notti -basictti -x86tti -no-aa -tbaa -scoped-noalias -assumption-tracker -targetlibinfo -basicaa -verify -simplifycfg -domtree -sroa -early-cse -lower-expect<br></div></span></div><div class="gmail_extra"><span class=""><div class="gmail_extra"> Data Layout</div><div class="gmail_extra"> No target information</div><div class="gmail_extra"> Target independent code generator's TTI</div><div class="gmail_extra"> X86 Target Transform Info</div><div class="gmail_extra"> No Alias Analysis (always returns 'may' alias)</div><div class="gmail_extra"> Type-Based Alias Analysis</div><div class="gmail_extra"> Scoped NoAlias Alias Analysis</div><div class="gmail_extra"> Assumption Tracker</div><div class="gmail_extra"> Target Library Information</div><div class="gmail_extra"> Basic Alias Analysis (stateless AA impl)</div><div class="gmail_extra"> FunctionPass Manager</div><div class="gmail_extra"> Module Verifier</div><div class="gmail_extra"> Simplify the CFG</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> SROA</div><div class="gmail_extra"> Early CSE</div><div class="gmail_extra"> Lower 'expect' Intrinsics</div><div class="gmail_extra">-Pass Arguments: -targetlibinfo -datalayout -notti -basictti -x86tti -no-aa -tbaa -scoped-noalias -assumption-tracker -basicaa -verify-di -ipsccp -globalopt -deadargelim -instcombine -simplifycfg -basiccg -prune-eh -inline-cost -inline -functionattrs -sroa -domtree -early-cse -lazy-value-info -jump-threading -correlated-propagation -simplifycfg -instcombine -tailcallelim -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -loop-unswitch -instcombine -scalar-evolution -lcssa -indvars -loop-idiom -loop-deletion -function_tti -loop-unroll -memdep -mldst-motion -domtree -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -jump-threading -correlated-propagation -domtree -memdep -dse -adce -simplifycfg -instcombine -barrier -domtree -loops -loop-simplify -lcssa -branch-prob -block-freq -scalar-evolution -loop-vectorize -instcombine -scalar-evolution -slp-vectorizer -simplifycfg -instcombine -domtree -loops -loop-simplify -lcssa -scalar-evolution -function_tti -loop-unroll -alignment-from-assumptions -strip-dead-prototypes -globaldce -constmerge -verify -verify-di</div></span><div class="gmail_extra">+Pass Arguments: -targetlibinfo -datalayout -notti -basictti -x86tti -no-aa -tbaa -scoped-noalias -assumption-tracker -basicaa -verify-di -ipsccp -globalopt -deadargelim -instcombine -simplifycfg -basiccg -prune-eh -inline-cost -inline -functionattrs -sroa -domtree -early-cse -lazy-value-info -jump-threading -correlated-propagation -simplifycfg -instcombine -tailcallelim -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -indvars -loop-idiom -loop-deletion -function_tti -loop-unroll -memdep -mldst-motion -domtree -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -jump-threading -correlated-propagation -domtree -memdep -dse -adce -simplifycfg -instcombine -barrier -domtree -loops -loop-simplify -lcssa -branch-prob -block-freq -scalar-evolution -loop-vectorize -instcombine -scalar-evolution -slp-vectorizer -simplifycfg -instcombine -domtree -loops -loop-simplify -lcssa -scalar-evolution -function_tti -loop-unroll -alignment-from-assumptions -strip-dead-prototypes -globaldce -constmerge -verify -verify-di</div><div><div class="h5"><div class="gmail_extra"> Target Library Information</div><div class="gmail_extra"> Data Layout</div><div class="gmail_extra"> No target information</div><div class="gmail_extra"> Target independent code generator's TTI</div><div class="gmail_extra"> X86 Target Transform Info</div><div class="gmail_extra"> No Alias Analysis (always returns 'may' alias)</div><div class="gmail_extra"> Type-Based Alias Analysis</div><div class="gmail_extra"> Scoped NoAlias Alias Analysis</div><div class="gmail_extra"> Assumption Tracker</div><div class="gmail_extra"> Basic Alias Analysis (stateless AA impl)</div><div class="gmail_extra"> ModulePass Manager</div><div class="gmail_extra"> Debug Info Verifier</div><div class="gmail_extra"> Interprocedural Sparse Conditional Constant Propagation</div><div class="gmail_extra"> Global Variable Optimizer</div><div class="gmail_extra"> Dead Argument Elimination</div><div class="gmail_extra"> FunctionPass Manager</div><div class="gmail_extra"> Combine redundant instructions</div><div class="gmail_extra"> Simplify the CFG</div><div class="gmail_extra"> CallGraph Construction</div><div class="gmail_extra"> Call Graph SCC Pass Manager</div><div class="gmail_extra"> Remove unused exception handling info</div><div class="gmail_extra"> Inline Cost Analysis</div><div class="gmail_extra"> Function Integration/Inlining</div><div class="gmail_extra"> Deduce function attributes</div><div class="gmail_extra"> FunctionPass Manager</div><div class="gmail_extra"> SROA</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> Early CSE</div><div class="gmail_extra"> Lazy Value Information Analysis</div><div class="gmail_extra"> Jump Threading</div><div class="gmail_extra"> Value Propagation</div><div class="gmail_extra"> Simplify the CFG</div><div class="gmail_extra"> Combine redundant instructions</div><div class="gmail_extra"> Tail Call Elimination</div><div class="gmail_extra"> Simplify the CFG</div><div class="gmail_extra"> Reassociate expressions</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> Natural Loop Information</div><div class="gmail_extra"> Canonicalize natural loops</div><div class="gmail_extra"> Loop-Closed SSA Form Pass</div><div class="gmail_extra"> Loop Pass Manager</div><div class="gmail_extra"> Rotate Loops</div><div class="gmail_extra"> Loop Invariant Code Motion</div><div class="gmail_extra"> Unswitch loops</div><div class="gmail_extra"> Combine redundant instructions</div></div></div><div><div class="h5"><div class="gmail_extra"> Scalar Evolution Analysis</div><div class="gmail_extra">+ Canonicalize natural loops</div><div class="gmail_extra"> Loop-Closed SSA Form Pass</div><div class="gmail_extra"> Loop Pass Manager</div><div class="gmail_extra"> Induction Variable Simplification</div><div class="gmail_extra"> Recognize loop idioms</div><div class="gmail_extra"> Delete dead loops</div><div class="gmail_extra"> Function TargetTransformInfo</div><div class="gmail_extra"> Loop Pass Manager</div><div class="gmail_extra"> Unroll loops</div><div class="gmail_extra"> Memory Dependence Analysis</div><div class="gmail_extra"> MergedLoadStoreMotion</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> Memory Dependence Analysis</div><div class="gmail_extra"> Global Value Numbering</div><div class="gmail_extra"> Memory Dependence Analysis</div><div class="gmail_extra"> MemCpy Optimization</div><div class="gmail_extra"> Sparse Conditional Constant Propagation</div><div class="gmail_extra"> Combine redundant instructions</div><div class="gmail_extra"> Lazy Value Information Analysis</div><div class="gmail_extra"> Jump Threading</div><div class="gmail_extra"> Value Propagation</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> Memory Dependence Analysis</div><div class="gmail_extra"> Dead Store Elimination</div><div class="gmail_extra"> Aggressive Dead Code Elimination</div><div class="gmail_extra"> Simplify the CFG</div><div class="gmail_extra"> Combine redundant instructions</div><div class="gmail_extra"> A No-Op Barrier Pass</div><div class="gmail_extra"> FunctionPass Manager</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> Natural Loop Information</div><div class="gmail_extra"> Canonicalize natural loops</div><div class="gmail_extra"> Loop-Closed SSA Form Pass</div><div class="gmail_extra"> Branch Probability Analysis</div><div class="gmail_extra"> Block Frequency Analysis</div><div class="gmail_extra"> Scalar Evolution Analysis</div><div class="gmail_extra"> Loop Vectorization</div><div class="gmail_extra"> Combine redundant instructions</div></div></div><span class=""><div class="gmail_extra"> Scalar Evolution Analysis</div><div class="gmail_extra"> SLP Vectorizer</div><div class="gmail_extra"> Simplify the CFG</div><div class="gmail_extra"> Combine redundant instructions</div><div class="gmail_extra"> Dominator Tree Construction</div><div class="gmail_extra"> Natural Loop Information</div><div class="gmail_extra"> Canonicalize natural loops</div><div class="gmail_extra"> Loop-Closed SSA Form Pass</div><div class="gmail_extra"> Scalar Evolution Analysis</div><div class="gmail_extra"> Function TargetTransformInfo</div><div class="gmail_extra"> Loop Pass Manager</div><div class="gmail_extra"> Unroll loops</div><div class="gmail_extra"> Alignment from assumptions</div><div class="gmail_extra"> Strip Unused Function Prototypes</div><div class="gmail_extra"> Dead Global Elimination</div><div class="gmail_extra"> Merge Duplicate Global Constants</div><div class="gmail_extra"> FunctionPass Manager</div><div class="gmail_extra"> Module Verifier</div><div class="gmail_extra"> Debug Info Verifier</div></span><div class="gmail_extra"> Bitcode Writer</div><div><br></div></div><div class="gmail_extra"><br></div></div>
</blockquote></div><br></div>