[llvm-dev] Noncapture use of locals disabling TailRecursionElimination

Eli Friedman via llvm-dev llvm-dev at lists.llvm.org
Fri May 8 14:23:38 PDT 2020


Are you specifically asking about AllCallsAreTailCalls?  I agree that's overly limiting.

If you're going to propose a patch to change it, you probably want to be careful that we don't introduce dynamic allocas.

(PR962 is https://bugs.llvm.org/show_bug.cgi?id=962 .  rdar is a reference into the Apple internal bugtracker.)

-Eli

-----Original Message-----
From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Xun Li via llvm-dev
Sent: Friday, May 8, 2020 1:34 PM
To: llvm-dev at lists.llvm.org
Cc: nicholas at mxc.ca
Subject: [EXT] [llvm-dev] Noncapture use of locals disabling TailRecursionElimination

Hi,

I was looking into the implementation of TailRecursionElimination, and
noticed that we have the constrain that if any call uses a local, even
though it doesn't capture the local, it would still prohibit TCE. This
contain seems unnecessary and overly limiting? Relevant code is here:
https://github.com/llvm/llvm-project/blob/cbe77ca9bd05393b1df1abf016b01f44d1d10a49/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp#L275

Looking through the tests that cover this scenario
(https://github.com/llvm/llvm-project/blob/e29874eaa04d24b8c67776bf5729474d671a58f6/llvm/test/Transforms/TailCallElim/basic.ll#L66),
I found it referring to rdar://14324281 and PR962. What are they?
These haven't been updated since 2014, so I wonder what is the latest
state and have them been resolved?

cc nicholas who authored the original code.

Thanks!

--
Xun
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list