[llvm-commits] [llvm] r118702 - in /llvm/trunk/lib/CodeGen: SplitKit.cpp SplitKit.h

Dan Gohman gohman at apple.com
Thu Nov 11 11:05:24 PST 2010



On Nov 11, 2010, at 9:20 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk>  
wrote:

>
> On Nov 10, 2010, at 8:05 PM, Dan Gohman wrote:
>
>>
>>
>> On Nov 10, 2010, at 6:38 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>>>
>>>>>> I wonder if 'isTriviallyReMaterializable' means that the  
>>>>>> instruction can be rematted anywhere without further checks? If  
>>>>>> so, I should perhaps be using the basic TID::isRematerializable 
>>>>>> () flag instead?
>>>>>
>>>>> Right. It's only meant for the existing brain dead remat.
>>>>
>>>> I see. X86InstrInfo::isReallyTriviallyReMaterializable in  
>>>> particular has many arbitrary restrictions. I'll look into  
>>>> something more generic.
>>>>
>>>> I would be useful to be able to remat loads that have been  
>>>> hoisted by early optimizations. Is there any way AliasAnalysis  
>>>> can be rigged to provide more information than AA- 
>>>> >pointsToConstantMemory?
>>
>> Yes.  The Values used with pointsToConstantMemory can also be used  
>> with normal AliasAnalysis::alias queries.  There's no memdep or  
>> other higher level abstraction for MachineInstrs currently though.
>
> So because we are dealing with MachineInstrs, AliasAnalysis can't  
> tell me if I can move a load, right?

Right, not by itself. AliasAnalysis is lower level.

> Maybe a conservative approach could look at basic blocks. I want to  
> ask: Can I move a load from block A to block B, where A dominates B.  
> AA could conservatively assume that I want to move the load from the  
> top of A to the bottom of B.

You also need to consider any other blocks that might be in a loop  
with B.

>
> If all my MachineBasicBlocks are properly mapped to BasicBlocks,  
> AA::canBasicBlockModify() is all I need, I think.

This sounds risky; there is MachineInstr-level code motion, possibly  
incuding remat itself ;). IIRC, the only use of MachineBasicBlock's BB  
member right now is verbose output.

A canMachineBasicBlockModify with a MachineInstr version of  
getModRefInfo might be worth considering.

Dan

>



More information about the llvm-commits mailing list