> Let's say I want to rename register r6 to r15. I can safely do that in > the block if I know that r15 is not used in that basic block and that > r6 is not a live-out of the basic block. > > However, how to handle the case where r6 is a live-out ? Then, I would > have to make sure that r15 is not defined in another basic block, thus > destroying my new live-out value? > > It seems to be a cat-mouse game: > > - I could copy back r15 to r6 in that case though I would like to try > to not have to do that because that requires an extra copy at the end > of the block
Yes, you need to make a copy in this case but its cost could be offsetted by the gain from the load_multiple. Or it could be eliminated by running a new instance of cprop_hardreg. You need to experiment and tune the pass. -- Eric Botcazou