diff options
author | Jan Voung <jvoung@chromium.org> | 2013-10-11 15:27:57 -0700 |
---|---|---|
committer | Jan Voung <jvoung@chromium.org> | 2013-10-11 15:27:57 -0700 |
commit | c036ceaa8225a23a795b50144b1da4b883e984a3 (patch) | |
tree | 9b1db86c6393dab9c34c52726a54eb757205dbc6 /include/llvm | |
parent | e87e8cd648035ac8e2cda19ce0cfd9d9a6e309fb (diff) |
Cherry-pick LLVM 187787 to prevent tail calls on x86-32 when not appropriate.
See:
http://llvm.org/viewvc/llvm-project?view=revision&revision=187787
The newer version of newlib tickles this x86-32 bug
when building the exception handling tests, which don't
strip the "tail" attribute.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3702
Waiting on trybots, but it seems to have fixed the minimal
reproducer I have:
http://chromegw.corp.google.com/i/tryserver.nacl/builders/nacl-toolchain-linux-pnacl-x86_64/builds/922
http://chromegw.corp.google.com/i/tryserver.nacl/builders/nacl-toolchain-linux-pnacl-x86_32/builds/870
http://chromegw.corp.google.com/i/tryserver.nacl/builders/nacl-toolchain-mac-pnacl-x86_32/builds/875
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/26538008
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 091368382e..b49eeb2eea 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -1176,6 +1176,15 @@ public: return false; } + /// Return true if a truncation from Ty1 to Ty2 is permitted when deciding + /// whether a call is in tail position. Typically this means that both results + /// would be assigned to the same register or stack slot, but it could mean + /// the target performs adequate checks of its own before proceeding with the + /// tail call. + virtual bool allowTruncateForTailCall(Type * /*Ty1*/, Type * /*Ty2*/) const { + return false; + } + virtual bool isTruncateFree(EVT /*VT1*/, EVT /*VT2*/) const { return false; } |