Fix and re-enable tail call optimization of expanded libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index 3c90704..c162757 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -1737,6 +1737,8 @@
if (NumCopies != 1 && NumCopies != 2)
return false;
+
+ bool HasRet = false;
for (unsigned i = 0; i < NumCopies; ++i) {
SDNode *Copy = Copies[i];
for (SDNode::use_iterator UI = Copy->use_begin(), UE = Copy->use_end();
@@ -1749,10 +1751,11 @@
}
if (UI->getOpcode() != ARMISD::RET_FLAG)
return false;
+ HasRet = true;
}
}
- return true;
+ return HasRet;
}
// ConstantPool, JumpTable, GlobalAddress, and ExternalSymbol are lowered as