<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;"><br><div><div>On Apr 25, 2014, at 1:39 PM, Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>On Apr 18, 2014, at 1:13 PM, Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br><br><blockquote type="cite">Ping<br><br>On Apr 10, 2014, at 9:12 PM, Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br><br><blockquote type="cite">Consider this use from the new testcase:<br><br>LSR Use: Kind=ICmpZero, Offsets={0}, widest fixup type: i32<br> reg({1000,+,-1}<nw><%for.body>)<br> -3003 + reg({3,+,3}<nw><%for.body>)<br> -1001 + reg({1,+,1}<nuw><nsw><%for.body>)<br> -1000 + reg({0,+,1}<nw><%for.body>)<br> -3000 + reg({0,+,3}<nuw><%for.body>)<br> reg({-1000,+,1}<nw><%for.body>)<br> reg({-3000,+,3}<nsw><%for.body>)<br><br>This is the last use we consider for a solution in SolveRecurse, so CurRegs is<br>a large set.  (CurRegs is the set of registers that are needed by the<br>previously visited uses in the in-progress solution.)<br><br>ReqRegs is {<br>{3,+,3}<nw><%for.body>,<br>{1,+,1}<nuw><nsw><%for.body><br>}<br><br>This is the intersection of the regs used by any of the formulas for the<br>current use and CurRegs.<br><br>Now, the code requires a formula to contain *all* these regs (the comment is<br>simply wrong), otherwise the formula is immediately disqualified.  Obviously,<br>no formula for this use contains two regs so they will each get disqualified.<br><br>The fix modifies the check to allow the formula in this case.  The idea is<br>that neither of these formulae is introducing any new registers which is the<br>point of this early pruning as far as I understand.<br><br>In terms of set arithmetic, we now allow formulas whose used regs are a subset<br>of the required regs not just the other way around.<br><br>There are few more loops in the test-suite that are now successfully LSRed.  I<br>have benchmarked those and found very minimal change.<br><br>Fixes <<a href="rdar://problem/13965777">rdar://problem/13965777</a>><br></blockquote></blockquote><br>Adam,<br><br>This fix looks great to me! Please go ahead and commit.<br></div></blockquote><div><br></div><div>Thanks, Andy.  This is r207271.</div><div><br></div><div>Adam</div><br><blockquote type="cite"><div style="font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>Thanks,<br>-Andy</div></blockquote></div><div><br></div><br></body></html>