summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMISelLowering.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-08-06 13:58:03 +0000
committerTim Northover <tnorthover@apple.com>2013-08-06 13:58:03 +0000
commitcc2e903bda2dc0f59f80dd4e159df3c8ba45bdf5 (patch)
tree36cc650b566c6859db410ab6dff45b7983cbf0ae /llvm/lib/Target/ARM/ARMISelLowering.cpp
parentb2be0b41aff167a83e6eacdd540b0b02beb9d1b3 (diff)
downloadbcm5719-llvm-cc2e903bda2dc0f59f80dd4e159df3c8ba45bdf5.tar.gz
bcm5719-llvm-cc2e903bda2dc0f59f80dd4e159df3c8ba45bdf5.zip
ARM: implement allowTruncateForTailCall
Now that it's in place, it seems silly not to let ARM make use of the extra tail call opportunities. llvm-svn: 187795
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 61c5bd14c95..caec11e108f 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -9993,6 +9993,21 @@ bool ARMTargetLowering::isZExtFree(SDValue Val, EVT VT2) const {
return false;
}
+bool ARMTargetLowering::allowTruncateForTailCall(Type *Ty1, Type *Ty2) const {
+ if (!Ty1->isIntegerTy() || !Ty2->isIntegerTy())
+ return false;
+
+ if (!isTypeLegal(EVT::getEVT(Ty1)))
+ return false;
+
+ assert(Ty1->getPrimitiveSizeInBits() <= 64 && "i128 is probably not a noop");
+
+ // Assuming the caller doesn't have a zeroext or signext return parameter,
+ // truncation all the way down to i1 is valid.
+ return true;
+}
+
+
static bool isLegalT1AddressImmediate(int64_t V, EVT VT) {
if (V < 0)
return false;
OpenPOWER on IntegriCloud