diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-03-05 19:27:12 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-03-05 19:27:12 +0000 |
commit | c8d7eea264bc82d96153e77667a595c8338c842f (patch) | |
tree | 0d1ab8e878b4b6ca05a9b9ea57b9149a5aa279d2 | |
parent | af71f16f937f9c11e118b05810256f5ca3cdaa5f (diff) |
Address Evan's comments for r151877.
Specifically, remove the magic number when checking to see if the copy has a
glue operand and simplify the checking logic.
rdar://10930395
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152041 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index d1ded33384..cae9aadfca 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -1585,13 +1585,12 @@ bool X86TargetLowering::isUsedByReturnOnly(SDNode *N) const { return false; SDNode *Copy = *N->use_begin(); - if (Copy->getOpcode() != ISD::CopyToReg && - Copy->getOpcode() != ISD::FP_EXTEND) - return false; - - // If anything is glued to the copy, then we can't safely perform a tail call. - if (Copy->getOpcode() == ISD::CopyToReg && - Copy->getNumOperands() == 4) + if (Copy->getOpcode() == ISD::CopyToReg) { + // If the copy has a glue operand, we conservatively assume it isn't safe to + // perform a tail call. + if (Copy->getOperand(Copy->getNumOperands()-1).getValueType() == MVT::Glue) + return false; + } else if (Copy->getOpcode() != ISD::FP_EXTEND) return false; bool HasRet = false; |