diff options
Diffstat (limited to 'llvm/lib/Target/ARM')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 15 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.h | 3 | 
2 files changed, 18 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; diff --git a/llvm/lib/Target/ARM/ARMISelLowering.h b/llvm/lib/Target/ARM/ARMISelLowering.h index beba5ce7715..44c769f8221 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.h +++ b/llvm/lib/Target/ARM/ARMISelLowering.h @@ -298,6 +298,9 @@ namespace llvm {      using TargetLowering::isZExtFree;      virtual bool isZExtFree(SDValue Val, EVT VT2) const; +    virtual bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const; + +      /// isLegalAddressingMode - Return true if the addressing mode represented      /// by AM is legal for this target, for a load/store of the specified type.      virtual bool isLegalAddressingMode(const AddrMode &AM, Type *Ty)const;  | 

