[llvm-commits] [PATCH] PR889: devirtualize Value::printCustom

Chris Lattner clattner at apple.com
Tue Nov 15 09:43:33 PST 2011


On Nov 15, 2011, at 12:29 AM, Jay Foad wrote:

> On 14 November 2011 18:38, Chris Lattner <clattner at apple.com> wrote:
>> The "right" way to fix this is to eliminate PseudoSourceValue, which has always been a disgusting hack.  Places in codegen that can uses PseudoSourceValue (e.g. the SDLoadNode and memoperands)
> 
> LoadSDNode has-a MachineMemOperand, which has-a MachinePointerInfo,
> which is the (only?) thing that can refer to PseudoSourceValues.

Aha, so we're already making progress there :).

>> should use a discriminated union of "Value* and SomeMachineLocationType".
> 
> I assume you're not talking about (MC's) MachineLocation here, but
> about some new machine location type yet to be invented.

Right.  Now that you've forced me to actually look at the code ;-) I see that we're well placed for this.  Basically MachinePointerInfo becomes a PointerUnion<const Value*, SomethingElse*> where the SomethingElse pointers are pointers to singletons that represent the stack and other things that PseudoSourceValue references.

My recollection is that the Value* is used for alias queries and for printing stuff out with verbose asm.  MachinePointerInfo should just get helper methods that check for the special cases, then bounce on to the standard AliasAnalysis interface if it has a real Value*.

-Chris



More information about the llvm-commits mailing list