This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Set sizes on control flow pseudos
ClosedPublic

Authored by arsenm on Jul 29 2016, 5:45 PM.

Details

Diff Detail

Event Timeline

arsenm updated this revision to Diff 66207.Jul 29 2016, 5:45 PM
arsenm retitled this revision from to AMDGPU: Set sizes on control flow pseudos.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.

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.

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.

nhaehnle accepted this revision.Aug 2 2016, 6:04 AM
nhaehnle added a reviewer: nhaehnle.

Thanks for the explanation!

I agree that long branches should go after RA, since they need to account for spill instructions. There'll probably always be cases where the long branch has to scavenge an SGPR pair :/

This revision is now accepted and ready to land.Aug 2 2016, 6:04 AM
arsenm closed this revision.Aug 10 2016, 12:20 PM

r278276