[llvm-commits] [llvm] r152041 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Chad Rosier
mcrosier at apple.com
Mon Mar 5 11:27:13 PST 2012
Author: mcrosier
Date: Mon Mar 5 13:27:12 2012
New Revision: 152041
URL: http://llvm.org/viewvc/llvm-project?rev=152041&view=rev
Log:
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
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=152041&r1=152040&r2=152041&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Mar 5 13:27:12 2012
@@ -1585,13 +1585,12 @@
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;
More information about the llvm-commits
mailing list