Many helpful suggestions incorporated in r149655. Thanks guys!<div><br></div><div>- Lang.<br><br><div class="gmail_quote">On Thu, Feb 2, 2012 at 11:38 AM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk" target="_blank">stoklund@2pi.dk</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
On Feb 2, 2012, at 11:26 AM, Evan Cheng wrote:<br>
<br>
>>> +  // We found a def, or hit the end of the basic block. SelectMI should have a<br>
>>> +  // kill flag on EFLAGS.<br>
>><br>
>> Not so fast! What if EFLAGS is live out of the block?<br>
><br>
> I don't think that's possible at isel time, right?<br>
<br>
</div>It's not, but the very same code goes:<br>
<div><br>
>>> +    if (!shouldHaveEFlagsKill(MI, BB)) {<br>
>>> +      copy0MBB->addLiveIn(X86::EFLAGS);<br>
>>> +      sinkMBB->addLiveIn(X86::EFLAGS);<br>
>>> +    }<br>
<br>
</div>I think it all works out because this pass is scanning forward through the instructions. The new blocks with live-in EFLAGS are always behind the current position.<br>
<br>
There should at least be a comment, and preferably an assertion, though.<br>
<br>
BTW, this no longer happens as part of ISel, but in the ExpandISelPseudos pass that runs right after ISel. If someone ran MachineCSE or MachineSinking first, your assertion would no longer be true.<br>
<span><font color="#888888"><br>
/jakob<br>
<br>
</font></span></blockquote></div><br></div>