[llvm] r290909 - [CodeGen] Further simplify returned call operand logic. NFC.
Ahmed Bougacha via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 13:42:44 PST 2017
Author: ab
Date: Tue Jan 3 15:42:43 2017
New Revision: 290909
URL: http://llvm.org/viewvc/llvm-project?rev=290909&view=rev
Log:
[CodeGen] Further simplify returned call operand logic. NFC.
As Pete points out in r290905, CallSite lets us avoid duplicating this!
Modified:
llvm/trunk/lib/CodeGen/Analysis.cpp
Modified: llvm/trunk/lib/CodeGen/Analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Analysis.cpp?rev=290909&r1=290908&r2=290909&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Analysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/Analysis.cpp Tue Jan 3 15:42:43 2017
@@ -272,14 +272,8 @@ static const Value *getNoopInput(const V
TLI.allowTruncateForTailCall(Op->getType(), I->getType())) {
DataBits = std::min(DataBits, I->getType()->getPrimitiveSizeInBits());
NoopInput = Op;
- } else if (auto *CI = dyn_cast<CallInst>(I)) {
- // Look through call operands.
- Value *ReturnedOp = CI->getReturnedArgOperand();
- if (ReturnedOp && isNoopBitcast(ReturnedOp->getType(), I->getType(), TLI))
- NoopInput = ReturnedOp;
- } else if (auto *II = dyn_cast<InvokeInst>(I)) {
- // Look through invoke operands.
- Value *ReturnedOp = II->getReturnedArgOperand();
+ } else if (auto CS = ImmutableCallSite(I)) {
+ const Value *ReturnedOp = CS.getReturnedArgOperand();
if (ReturnedOp && isNoopBitcast(ReturnedOp->getType(), I->getType(), TLI))
NoopInput = ReturnedOp;
} else if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(V)) {
More information about the llvm-commits
mailing list