[llvm-commits] [llvm] r101165 - /llvm/trunk/lib/CodeGen/MachineSink.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Apr 13 15:52:12 PDT 2010
On Apr 13, 2010, at 3:42 PM, Chris Lattner wrote:
>
> On Apr 13, 2010, at 12:06 PM, Jakob Stoklund Olesen wrote:
>
>> Author: stoklund
>> Date: Tue Apr 13 14:06:14 2010
>> New Revision: 101165
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=101165&view=rev
>> Log:
>> Teach MachineSinking to handle easy critical edges.
>>
>> Sometimes it is desirable to sink instructions along a critical edge:
>>
>> x = ...
>> if (a && b) ...
>> else use(x);
>>
>> The 'a && b' condition creates a critical edge to the else block, but we still
>> want to sink the computation of x into the block. The else block is dominated by
>> the parent block, so we are not pushing instructions into new code paths.
>
> Nice, testcase? :)
Sure, I'll cook one up.
BTW, do we need a code sinking pass at the IR level?
Machine sinking is easily intimidated by physical register defines, and it currently cannot move code below if/else diamonds and simple loops.
/jakob
More information about the llvm-commits
mailing list