[PATCH] D102613: ARM: support mandatory tail calls
Tim Northover via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 02:56:03 PDT 2021
t.p.northover added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMFrameLowering.cpp:2354
+ // Bail early if the callee is expected to do the adjustment. If
+ // CalleePopAmount is valid but 0 anyway, Amount will be 0 too so it doesn't
+ // matter if we continue a bit longer.
----------------
paquette wrote:
> Maybe there should be an assert checking that if `CalleePopAmount == 0`, then `Amount == 0`?
"Valid" is a difficult predicate to check here (it's essentially `canGuaranteeTCO` from ISelLowering so depends on CC and `TargetMachine::Options`).
The point of the comment is that `CalleePopAmount != 0` is adequate as a proxy for that check, which is what we really want to have here. So adding an assert later is probably the wrong way to go about improving it.
On reflection the best fix is probably to change the "no interesting callee pop" sentinel from 0 which is also a valid amount to -1. That defines the subtlety away.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102613/new/
https://reviews.llvm.org/D102613
More information about the llvm-commits
mailing list