Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -1346,7 +1346,8 @@ ComputeValueVTs(TLI, DL, PointerType::getUnqual(F->getReturnType()), PtrValueVTs); - SDValue RetPtr = DAG.getRegister(DemoteReg, PtrValueVTs[0]); + SDValue RetPtr = DAG.getCopyFromReg(DAG.getEntryNode(), getCurSDLoc(), + DemoteReg, PtrValueVTs[0]); SDValue RetOp = getValue(I.getOperand(0)); SmallVector ValueVTs; Index: test/CodeGen/SystemZ/args-04.ll =================================================================== --- test/CodeGen/SystemZ/args-04.ll +++ test/CodeGen/SystemZ/args-04.ll @@ -1,7 +1,7 @@ ; Test incoming GPR, FPR and stack arguments when no extension type is given. ; This type of argument is used for passing structures, etc. ; -; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s +; RUN: llc < %s -mtriple=s390x-linux-gnu -verify-machineinstrs | FileCheck %s ; Do some arithmetic so that we can see the register being used. define i8 @f1(i8 %r2) { Index: test/CodeGen/SystemZ/args-07.ll =================================================================== --- test/CodeGen/SystemZ/args-07.ll +++ test/CodeGen/SystemZ/args-07.ll @@ -1,6 +1,6 @@ ; Test multiple return values (LLVM ABI extension) ; -; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s +; RUN: llc < %s -mtriple=s390x-linux-gnu -verify-machineinstrs| FileCheck %s ; Up to four integer return values fit into GPRs. define { i64, i64, i64, i64 } @f1() {