[PATCH] D132623: [CodeGen] Disable tail calls at -O0/-O1

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 16:41:31 PDT 2022


aeubanks created this revision.
Herald added subscribers: kosarev, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, atanasyan, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, kbarton, hiraditya, mgorny, jvesely, nemanjai, sdardis, qcolombet, MatzeB.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, MaskRay.
Herald added a project: LLVM.

-O1 is designed to impact debuggability as little as possible and tail
calls hurt debuggability, so turn off tail calls at -O0/-O1.

Add a new pass that adds the "disable-tail-calls"="true" function
attribute, which disables generating (non-musttail) tail calls in that
function. Add this pass to the -O0/-O1 codegen pipeline.

Motivation: D130374 <https://reviews.llvm.org/D130374> inferred more tail calls even in -O1, causing
various internal symbolizers to regress.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132623

Files:
  llvm/docs/ReleaseNotes.rst
  llvm/include/llvm/CodeGen/Passes.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LinkAllPasses.h
  llvm/lib/CodeGen/AddDisableTailCalls.cpp
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/CodeGen.cpp
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/test/CodeGen/AArch64/O0-pipeline.ll
  llvm/test/CodeGen/AArch64/arm64-abi_align.ll
  llvm/test/CodeGen/AArch64/dllimport.ll
  llvm/test/CodeGen/AArch64/tailcall-fastisel.ll
  llvm/test/CodeGen/AArch64/win64_vararg_float.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-assert-align.ll
  llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
  llvm/test/CodeGen/AMDGPU/need-fp-from-vgpr-spills.ll
  llvm/test/CodeGen/AMDGPU/sgpr-spills-split-regalloc.ll
  llvm/test/CodeGen/ARM/fast-tail-call.ll
  llvm/test/CodeGen/ARM/none-macho.ll
  llvm/test/CodeGen/ARM/subtarget-no-movt.ll
  llvm/test/CodeGen/ARM/tail-call-float.ll
  llvm/test/CodeGen/ARM/tail-call.ll
  llvm/test/CodeGen/Mips/tailcall/tail-call-arguments-clobber.ll
  llvm/test/CodeGen/PowerPC/ppc64-sibcall.ll
  llvm/test/CodeGen/RISCV/O0-pipeline.ll
  llvm/test/CodeGen/X86/O0-pipeline.ll
  llvm/test/CodeGen/X86/add-disable-tail-calls.ll
  llvm/test/CodeGen/X86/atom-pad-short-functions.ll
  llvm/test/CodeGen/X86/fold-sext-trunc.ll
  llvm/test/CodeGen/X86/fold-zext-trunc.ll
  llvm/test/CodeGen/X86/ins_split_regalloc.ll
  llvm/test/CodeGen/X86/lvi-hardening-indirectbr.ll
  llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll
  llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
  llvm/test/CodeGen/X86/opt-pipeline.ll
  llvm/test/CodeGen/X86/pr1489.ll
  llvm/test/CodeGen/X86/pr53243-tail-call-fastisel.ll
  llvm/test/CodeGen/X86/retpoline-external.ll
  llvm/test/CodeGen/X86/retpoline.ll
  llvm/test/CodeGen/X86/swiftself-win64.ll
  llvm/test/CodeGen/X86/swiftself.ll
  llvm/test/CodeGen/X86/tailcall-msvc-conventions.ll
  llvm/test/CodeGen/X86/win64_eh_leaf.ll
  llvm/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll
  llvm/test/DebugInfo/X86/dbg-declare-inalloca.ll
  llvm/test/MC/ARM/arm-thumb-tail-call.ll
  llvm/tools/opt/opt.cpp
  llvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132623.455425.patch
Type: text/x-patch
Size: 38078 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220824/b3c7945e/attachment.bin>


More information about the llvm-commits mailing list