[llvm-commits] [llvm] r149597 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/uint64-to-float.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Feb 2 11:38:12 PST 2012


On Feb 2, 2012, at 11:26 AM, Evan Cheng wrote:

>>> +  // We found a def, or hit the end of the basic block. SelectMI should have a
>>> +  // kill flag on EFLAGS.
>> 
>> Not so fast! What if EFLAGS is live out of the block?
> 
> I don't think that's possible at isel time, right?

It's not, but the very same code goes:

>>> +    if (!shouldHaveEFlagsKill(MI, BB)) {
>>> +      copy0MBB->addLiveIn(X86::EFLAGS);
>>> +      sinkMBB->addLiveIn(X86::EFLAGS);
>>> +    }

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.

There should at least be a comment, and preferably an assertion, though.

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.

/jakob




More information about the llvm-commits mailing list