[llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp

Jakob and anyone else who might be interested...

  Base on this patch back in August, I sense some need to double check with
you whether it is OK to start making a heavy use of MachineOperand
TargetFlags?
We do seem to have a compelling reason for it in Hexagon, and I wanted to
make sure that it is OK with everyone. I plan to use it for attributing
target specific info to MOs and in more general case to MIs that those MOs
belongs to.
  Part of my question would be - is it still unsafe to use it for
MO_Register and if so, then why?

Thanks a lot.

Sergei

Hi Sergei,

our use of target flags will be on immediate register operands if I am
not mistaken (and if not we can always encode it as such)?

I guess you are refering to the hexagon backend needing to distinguish
between instances of an instruction that uses a constant value that
can fit into the 4 byte of the instruction and one that encodes the
immediate in an extra instruction slot (what we call a constant
extended instruction).
We can encode that with a target flag on the immediate machine
operand. So the patch you quoted is not a problem.

The quoted patch only prohibits the use of flags on register operands
(that is MO.isReg()==true) because some of the code in CodeGen that
deals with register operands does not appropriately handle target
flags on the register operand (it might not transfer the information
from an "old" operand to an "updated" operand).

I guess I am asking you to clarify what you mean by heavy use of
TargetFlags on MachineOperands. What specifically do you plan to do?

Jakob,
TargetFlags on immediate machine operands introduced as early as ISel
Lowering should not be a problem, right?

Thanks,
Arnold

That should be fine.

/jakob

Arnold,

I wanted to hear from Jacob is the original patch in question still needed,
since our use of this field could surpass const extenders and could
potentially include MO_Register.

Jacob,

  Can you please comment? Thanks.

Sergei

Arnold,

I wanted to hear from Jacob is the original patch in question still needed,
since our use of this field could surpass const extenders and could
potentially include MO_Register.

Jacob,

Can you please comment? Thanks.

I don't really have anything to add to the commit message. There aren't plans to allow target flags on register operands.

Any particular reason you can't use immediates?

/jakob

Jakob,

  I just wanted to know _if_ I can use it for regs for some other custom
markers. Your answer is rather sufficient.
If the real need will arrive, I'll come back to this discussion.
  Thank you.

Sergei