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

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Nov 11 09:20:39 PST 2010


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?

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.

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

/jakob





More information about the llvm-commits mailing list