On Tuesday 01 December 2009 12:14, Dan Gohman wrote:> On Dec 1, 2009, at 9:03 AM, David Greene wrote: > > On Tuesday 01 December 2009 11:01, Chris Lattner wrote: > >> What are you trying to accomplish? What would use this? > > > > I am trying to determine whether a MachineMemOperand is a vector > > operand. > > Again, what's that for? If you're interested in which pipeline a load > feeds, ye olde Vector vs. Scalar isn't sufficient (on x86, for example). > If you're interested in the size and/or alignment, that information is > already there.Right, but vector/scalar is useful for tracking how much code is vectorized. That can come in handy when doing performance analysis. Right now it's just for comments but I can imagine other uses, such as peeps and the like. The size is actually calculated from an EVT nearly everywhere (and where it's not it should be easy to add). We could just replace the size with the EVT and have more information. -Dave
On Dec 1, 2009, at 11:43 AM, David Greene wrote:> On Tuesday 01 December 2009 12:14, Dan Gohman wrote: >> On Dec 1, 2009, at 9:03 AM, David Greene wrote: >>> On Tuesday 01 December 2009 11:01, Chris Lattner wrote: >>>> What are you trying to accomplish? What would use this? >>> >>> I am trying to determine whether a MachineMemOperand is a vector >>> operand. >> >> Again, what's that for? If you're interested in which pipeline a load >> feeds, ye olde Vector vs. Scalar isn't sufficient (on x86, for >> example). >> If you're interested in the size and/or alignment, that information >> is >> already there. > > Right, but vector/scalar is useful for tracking how much code is > vectorized. That can come in handy when doing performance analysis. > > Right now it's just for comments but I can imagine other uses, such > as peeps and the like. > > The size is actually calculated from an EVT nearly everywhere (and > where it's not it should be easy to add). We could just replace the > size with the EVT and have more information.It sounds like you're looking for a property of an instruction, not an operand. If you're looking for vector instructions, that should be captured in TargetInstrInfo, not in MachineInstrs/Operands. -Chris
On Tuesday 01 December 2009 15:04, Chris Lattner wrote:> > The size is actually calculated from an EVT nearly everywhere (and > > where it's not it should be easy to add). We could just replace the > > size with the EVT and have more information. > > It sounds like you're looking for a property of an instruction, not an > operand. If you're looking for vector instructions, that should be > captured in TargetInstrInfo, not in MachineInstrs/Operands.Yes, I've written all that support. But that doesn't cover MachineMemOperands. AFAIK there's no machine-independent way to tell which instruction operands make up a MachineMemOperand. And even then, that would only tell you about the compoenents that make up the address, not the data itself. Note that having a machine-independent way to associate MachineOperands with MachineMemOperands would also be highly useful, but that will come later. It's common to have an instruction that takes both vector and scalar data. The x86 insert/extract instructions, for example. Often we'll want to know which operands are the vector ones and if they come from memory, we need that information in the MachineMemOperand. -Dave