summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-19 15:02:18 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-19 15:02:18 +0000
commit0ba975458418e6836248dfff9e8a182286d02e54 (patch)
tree1aa42a134beeebf499492c7ab885310874d0418a /llvm/lib
parente1e12a73d74ce73c6e2c5994a598f6bb3bdb4bcc (diff)
downloadbcm5719-llvm-0ba975458418e6836248dfff9e8a182286d02e54.tar.gz
bcm5719-llvm-0ba975458418e6836248dfff9e8a182286d02e54.zip
[Hexagon] Allow tail-call optimization when mixing C and fast calling conv
Patch by Arnold Schwaighofer. llvm-svn: 279251
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonISelLowering.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
index 2714a19df34..fad6c982126 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -3143,9 +3143,15 @@ bool HexagonTargetLowering::IsEligibleForTailCallOptimization(
return false;
}
- // Do not optimize if the calling conventions do not match.
- if (!CCMatch)
- return false;
+ // Do not optimize if the calling conventions do not match and the conventions
+ // used are not C or Fast.
+ if (!CCMatch) {
+ bool R = (CallerCC == CallingConv::C || CallerCC == CallingConv::Fast);
+ bool E = (CalleeCC == CallingConv::C || CalleeCC == CallingConv::Fast);
+ // If R & E, then ok.
+ if (!R || !E)
+ return false;
+ }
// Do not tail call optimize vararg calls.
if (isVarArg)
OpenPOWER on IntegriCloud