IMPLICIT_DEF?

Hi,

I have a MachineInstr that writes to a subreg, but clobbers the superreg.

How should I BuildMI this instruction?

I try to do a

IMPLICIT_DEF super_reg
and then write to a subreg of that super register

, but it gets DCE:ed.

Is there a way to express this clobbering of a superregister?

thanks,

Jonas

Hi,

I have a MachineInstr that writes to a subreg, but clobbers the superreg.

How should I BuildMI this instruction?

I try to do a

IMPLICIT_DEF super_reg
and then write to a subreg of that super register

, but it gets DCE:ed.

Right. IMPLICIT_DEF in machine code means the same as the LLVMIR ‘undef’ value. The IMPLICIT_DEF instructions become MachineOperand flags during ProcessImplicitDefs.

Is there a way to express this clobbering of a superregister?

Is this before or after register allocation?

If you are talking about physical registers, you may not have to do anything.

If you mean virtual registers, add an MachineOperand for the super register.

/jakob