On Feb 10, 2010, at 9:27 AM, Devang Patel wrote:> On Wed, Feb 10, 2010 at 12:02 AM, David Greene <dag at cray.com> wrote: >> Since 2.7 is getting close to code freeze, I'd like to see if I can get in our >> changes to track non-temporal memory operations into trunk. >> >> As discussed earlier, I was hoping to do this via metadata. It's pretty clear >> how to attach the data to Instructions, but after that, I'm not sure what >> happens. Somehow we have to carry this all the way back into MachineInstrs. >> >> What happens to metadata when SelectionDAGs get built? Is it lost? > > It is still there. > >> Is there any mechanism to attach metadata to SDNodes or MachineInstrs? > > There is not any mechanism to attach metadata with SDNode or > MachineInstrs today.For nontemporal stores, you wouldn't want to do this anyway. In selectiondag builder, you'd want to check the store instruction to see if it has the metadata on it, and if so make a different ISD opcode or something. -Chris
On Wednesday 10 February 2010 11:46:25 Chris Lattner wrote:> > There is not any mechanism to attach metadata with SDNode or > > MachineInstrs today. > > For nontemporal stores, you wouldn't want to do this anyway. In > selectiondag builder, you'd want to check the store instruction to see if > it has the metadata on it, and if so make a different ISD opcode or > something.Ah, ok, I could do that. The way we did this here was to add some information into the SDNode and then write a TableGen predicate to check it, generating a different kind of store instruction. This avoided the need for a new target ISD opcode. In general, is one method preferred over the other? That is, if target- specific ISD opcodes can be avoided, should we avoid them? Is there any reason we would not want to support metadata on SDNodes, other than the cost of implementing it? We don't necessarily need to do that now. I'm just asking the question with future possibilities in mind. -Dave
On Feb 10, 2010, at 10:20 AM, David Greene wrote:> On Wednesday 10 February 2010 11:46:25 Chris Lattner wrote: > >>> There is not any mechanism to attach metadata with SDNode or >>> MachineInstrs today. >> >> For nontemporal stores, you wouldn't want to do this anyway. In >> selectiondag builder, you'd want to check the store instruction to see if >> it has the metadata on it, and if so make a different ISD opcode or >> something. > > Ah, ok, I could do that. The way we did this here was to add some information > into the SDNode and then write a TableGen predicate to check it, generating > a different kind of store instruction. This avoided the need for a new target > ISD opcode. > > In general, is one method preferred over the other? That is, if target- > specific ISD opcodes can be avoided, should we avoid them? > > Is there any reason we would not want to support metadata on SDNodes, > other than the cost of implementing it? We don't necessarily need to do that > now. I'm just asking the question with future possibilities in mind.I think that adding a bit to LoadSDNode and StoreSDNode would make sense. -Chris