[GlobalISel] Rewrite CallLowering::lowerReturn to accept multiple VRegs per Value
This is logical continuation of https://reviews.llvm.org/D46018 (r332449)
Differential Revision: https://reviews.llvm.org/D49660
llvm-svn: 338685
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 80da505..f4f066f 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -323,14 +323,16 @@
const Value *Ret = RI.getReturnValue();
if (Ret && DL->getTypeStoreSize(Ret->getType()) == 0)
Ret = nullptr;
+
+ ArrayRef<unsigned> VRegs;
+ if (Ret)
+ VRegs = getOrCreateVRegs(*Ret);
+
// The target may mess up with the insertion point, but
// this is not important as a return is the last instruction
// of the block anyway.
- // FIXME: this interface should simplify when CallLowering gets adapted to
- // multiple VRegs per Value.
- unsigned VReg = Ret ? packRegs(*Ret, MIRBuilder) : 0;
- return CLI->lowerReturn(MIRBuilder, Ret, VReg);
+ return CLI->lowerReturn(MIRBuilder, Ret, VRegs);
}
bool IRTranslator::translateBr(const User &U, MachineIRBuilder &MIRBuilder) {