[PATCH] D22989: AMDGPU: Set sizes on control flow pseudos

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 12:09:10 PDT 2016


arsenm added a comment.

In https://reviews.llvm.org/D22989#502088, @nhaehnle wrote:

> Out of curiosity, what's the purpose of this? Does it affect heuristics somewhere?
>
> Depending on what the semantics are supposed to be, you may want to change SI_ELSE to 8 instead of 12, since the most likely lowering requires only two instructions. (Of course, the maximum is still 12.)
>
> Apart from the SI_ELSE point (which depends on the intended semantics here), LGTM.


This needs to be the upper bound (inline asm for example assumes all instructions are the maximum size). The else part could be specially handled in the size target hook, but I don't think it's that important.

I'm not 100% sure this will end up being necessary in the end since these should probably be expanded earlier, but for estimating if long branches are going to need to be expanded there need to be more accurate code size estimates. Currently my plan is to relax long branches after RA, but an earlier guess might be necessary for making sure the necessary SGPR pair for manipulating the program counter is available.


https://reviews.llvm.org/D22989





More information about the llvm-commits mailing list