[LLVMdev] MachineOperand TargetFlags being ignored in register coalescing pass

Tom Stellard thomas.stellard at amd.com
Fri May 25 08:15:08 PDT 2012


Hi,

On AMD GPUs we have source modifiers and output modifiers, which are bits
you can set on instructions to perform some simple no cost operations
on either the operands or the result of an instruction (floating point
values only).

The source modifiers are FABS and FNEG and are applied to the operands
before an instruction is executed.

The output modifiers are CLAMP (clamp result between 0.0f and 1.0f)
and OMOD (multiply the result by 0.5f, 2.0f, or 4.0f).  These are
applied to the result of an instruction after it is executed.

For the R600 backend, I'm using the MachineOperand TargetFlags to
keep track of the modifiers, but I've noticed when I use them on
operands to COPY instructions they are not propagated when registers
are coalesced.  Is this a bug, or should I not be using TargetFlags for
storing this kind of information?

-Tom




More information about the llvm-dev mailing list