MachineMemOperands

Would anyone object if I add a field for the ValueType of a
MachineMemOperand? Since it's not always known, by default
I'd set it to "Other." But sometimes it is know when the
MachineMemOperand is created and it would be useful to have
that information.

                             -Dave

What are you trying to accomplish? What would use this?

-Chris

I am trying to determine whether a MachineMemOperand is a vector
operand.

                               -Dave

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.

Dan

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

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

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

Again, you're saying that you need something without explaining what for. :slight_smile: We don't have a strong model for what is an 'operand' (memoperands are not bound to a particular list of MachineOperands). If you want to fix that problem, the fix isn't to add an MVT to memoperands.

-Chris

No, no, I don't need this particular mapping. What I need is information to
determine whether a MachineMemOperand is of vector type. Hence the EVT
would be useful. I don't care right now which MachineOperands it aggregates.

                             -Dave