Page MenuHomePhabricator

[ARM] Avoid redundant checks for isThumb1Only() after supportsTailCall()

Authored by tyomitch on Sep 25 2015, 8:59 AM.



supportsTailCall() has two callers. Both of them double-check isThumb1Only(), and refuse to proceed with tail-calling in that case.

Therefore, it makes sense to move this check to ARMSubtarget::initSubtargetFeatures, where SupportsTailCall is initialized; and to eliminate the extra checks at the call sites.


Diff Detail

Event Timeline

tyomitch updated this revision to Diff 35728.Sep 25 2015, 8:59 AM
tyomitch retitled this revision from to [ARM] Avoid redundant checks for isThumb1Only() after supportsTailCall().
tyomitch updated this object.
tyomitch added reviewers: grosbach, compnerd.
tyomitch added a subscriber: llvm-commits.
compnerd accepted this revision.Sep 25 2015, 9:55 PM
compnerd edited edge metadata.

This is correct as is. Might be nice to have IsEligibleForTailCall assert that TCO is available on the subtarget (currently shouldn't be possible to trip on since the only caller only calls it if the subtarget supports TCO and the MF is not marked with "disable-tail-calls"). A second assert for !Thumb1 with a comment pointer to initSubtargetFeatures would be nice too.

This revision is now accepted and ready to land.Sep 25 2015, 9:55 PM
tyomitch closed this revision.Sep 28 2015, 3:01 AM

Thanks! Committed as r248703, adding an "assert(Subtarget->supportsTailCall())" in IsEligibleForTailCallOptimization