[llvm-dev] Register data flow commits

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 13 07:07:34 PST 2016


On 1/12/2016 3:11 PM, Matthias Braun wrote:
> I am surprised that the regalloc passes (in broader sense of phi elimination, two address elimination, copy coalescing + regalloc) produce opportunities for copy propagation and dead code elimination. I believe that in principle we should be able to avoid creating dead code and unnecessary copies (however I am aware of a few shortcomings in this area when sub registers are involved).
>
> Can you give some examples on situations where you need such post-RA cleanups?

The regalloc passes have indeed improved significantly since the last 
release of our (Hexagon) compiler.  I ran a few tests and I didn't see 
cases where dead code would be a direct outcome of the regalloc process. 
  There are, on the other hand, cases of instruction chains scattered 
over a loop (a fairly large one in the specific case I was just looking 
at), whose result is not ultimately used, and which end up getting 
removed.  I cannot post the code, since it came from a customer 
application, plus the dead code was not related to regalloc.

To clarify---although this code does perform a "cleanup" right now, the 
ultimate intent to make post-RA optimizations easier.  We do have cases, 
where there are register copies inside loops, which could be eliminated 
(possibly via copy-ins/copy-outs outside the loop), or cases where 
rearranging the registers could result in more compact code (i.e. 
through forming register pairs).  All of these could potentially be 
quite useful for us.

I'll let you know if I see examples that could be improved in the 
regalloc passes themselves.

-Krzysztof


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list