[LLVMdev] How should I update LiveIntervals after removing a use of a register?

Tom Stellard tom at stellard.net
Thu Apr 3 18:29:19 PDT 2014


Hi,

I am working on a simple copy propagation pass for the R600 backend that
propagates immediates rather than registers.  For example, I want to
transform:

...
%vreg1 = V_MOV_B32 1
%vreg2 = V_ADD_I32 %vreg1, %vreg0
...

into:

%vreg1 = V_MOV_B32 1 ; <- Only delete this if it is dead
%vreg2 = V_ADD_I32 1, %vreg0

For best results, I am trying to run this pass after the
TwoAddressInstruction pass, which means I need to preserve
the LiveIntervals analysis.

My question is: How do I update the LiveIntervals to reflect the fact
that V_ADD_I32 no longer uses %vreg0?

Thanks,
Tom



More information about the llvm-dev mailing list