diff --git a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp index 5b6b8773e6c58..d24a94ab25ff3 100644 --- a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp @@ -13,6 +13,7 @@ #include "SystemZRegisterInfo.h" #include "SystemZSubtarget.h" #include "llvm/CodeGen/LivePhysRegs.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/RegisterScavenging.h" @@ -584,7 +585,7 @@ void SystemZELFFrameLowering::emitPrologue(MachineFunction &MF, // Reload return address from 8 bytes above stack pointer. BuildMI(MBB, MBBI, DL, ZII->get(SystemZ::LG)) - .addReg(SystemZ::R14D) + .addReg(SystemZ::R14D, RegState::Define) .addReg(SystemZ::R15D) .addImm(8) .addReg(0); diff --git a/llvm/test/CodeGen/SystemZ/mcount.ll b/llvm/test/CodeGen/SystemZ/mcount.ll index 01bd34548f125..61d00e70f1314 100644 --- a/llvm/test/CodeGen/SystemZ/mcount.ll +++ b/llvm/test/CodeGen/SystemZ/mcount.ll @@ -1,6 +1,6 @@ ; Test proper insertion of mcount instrumentation ; -; RUN: llc < %s -mtriple=s390x-linux-gnu -o - | FileCheck %s +; RUN: llc < %s -mtriple=s390x-linux-gnu -verify-machineinstrs -o - | FileCheck %s ; ; CHECK: # %bb.0: ; CHECK-NEXT: stg %r14, 8(%r15)