[LLVMdev] HazardRecognizer and RegisterAllocation

Dan Gohman gohman at apple.com
Thu Jan 22 16:10:56 PST 2009


On Jan 20, 2009, at 2:22 PM, David Greene wrote:
>
>>> I don't think it's sufficient to just preserve the information we
>>> had from
>>> Instructions.  Codegen might introduce new memory operations after
>>> lowering
>>> (spilling, for example).  Some of these might be easily analyzable
>>> (spills)
>>> but others might not be.
>>
>> This is where PseudoSourceValues come in. There are pseudo-values
>> representing the stack, constants area, GOT, and other memory
>> locations that aren't represented at the LLVM-IR level.
>
> Ok, that's good.  But what happens if some codegen pass deletes a  
> memory
> instruction (or a Value or whatever) and recreates it elsewhere.   
> Presumably
> the dependence information would be lost.  How would we re-generate  
> it.


If a pass must re-generate an instruction, it's going to have to
be responsible for keeping track of the MachineMemOperand(s) that
the re-generated instruction will need.

Also, the PseudoSourceValue objects are singletons, so if the
code generating the memory reference knows what memory it's
talking about, it can easily look up the appropriate
PseudoSourceValue for it.

Dan




More information about the llvm-dev mailing list