<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks Chandler for your review.<div>The problem I saw in a few test cases was that instcombine had finished visiting all instructions (Iteration#0) and the only possible changes were sinking of instructions. This sinking of one instruction opened up sinking opportunities for other instructions which were only being used by the current(sunk) instruction. Since we are visiting top-down, there is only one instruction being sunk per iteration.</div><div>So in some my test cases, instcombine ran for 8 iterations where in iterations 1-8, it sank one instruction per iteration. The test cases are about 150-300 lines long and we are visiting all those instructions every iteration even though the only change possible is the sinking.</div><div><br></div><div>Consider the following example. </div><div>bb1: %d0 = ...</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>%d1 = .. %d0..</div><div><div><span class="Apple-tab-span" style="white-space:pre">    </span>%d2 = .. %d1..</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>%d3 = op %d2 ..</div><div>   <span class="Apple-tab-span" style="white-space:pre"> </span>...</div><div>bb2:</div><div>      .. =  op %d3</div></div><div><br></div><div>Currently instcombine would sink d3 in Iteration#0, d2 in Iteration#1, d1 in Iteration#2 and d0 in Iteration#3 - but it only requires one iteration in all.</div><div><br></div><div>Updated patch - removed C style comments and fixed typo(I think).</div></body></html>