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 | 9424aa1c51a799d2f7d880ceb37c5a645b688f9a (patch) | |
| tree | 55d6d5986dae4224884f67c1320a10c46d1d19c2 /llvm/lib/Target | |
| parent | fcd435ee73e6ad810bcc0eafe1580717ba746c10 (diff) | |
| download | bcm5719-llvm-9424aa1c51a799d2f7d880ceb37c5a645b688f9a.tar.gz bcm5719-llvm-9424aa1c51a799d2f7d880ceb37c5a645b688f9a.zip | |
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
llvm-svn: 152041
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d1ded333849..cae9aadfca6 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/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; |

