[llvm-commits] patch: target option to disable tail calls

Nick Lewycky nlewycky at google.com
Wed Jan 18 15:10:03 PST 2012

The attached patch adds a new "-no-tail-calls" flag to llc, and implements
it in the x86 backend only. The intent is to support gcc's
-fno-optimize-sibling-calls in clang, which as far as I can tell just
disables tail calls period. The goal is to help ASAN produce correct stack
traces, which requires disabling all tail calls.

As an aside, there is a good reason to do this in the backend and not at
the IR-level. The "tail" marker is used to indicate things that are useful
to the optimizers themselves; for example alias analysis interprets the
presence of a tail marker as proof that the callee can't access any
alloca's in the caller, whether the pointer has been captured or not.

Please review!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120118/2bf7e2ca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-tail-calls-1.patch
Type: text/x-patch
Size: 4136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120118/2bf7e2ca/attachment.bin>

More information about the llvm-commits mailing list