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:
I found a slightly different solution, which was to
call LiveIntervals::shrinkToUses(vreg1). This also gives me a list of
dead instructions, which is nice. Are there an disadvantages to doing
it this way?
No, that is the best thing to do. Looking at your example again I see that you’re only propagating a constant through a copy, so you’ve only eliminated a use of vreg1 (ignore my previous comment about vreg0). That’s exactly what shrinkToUses is meant for.