forked from OSchip/llvm-project
[AArch64] When creating MRS instruction, make sure the destination register is
declared as a definition. This fixes the machine verifier error for CodeGen/AArch64/nzcv-save.ll. llvm-svn: 267185
This commit is contained in:
parent
760e583e22
commit
658d9dbe56
|
@ -2138,8 +2138,7 @@ void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
|
|||
|
||||
if (SrcReg == AArch64::NZCV) {
|
||||
assert(AArch64::GPR64RegClass.contains(DestReg) && "Invalid NZCV copy");
|
||||
BuildMI(MBB, I, DL, get(AArch64::MRS))
|
||||
.addReg(DestReg)
|
||||
BuildMI(MBB, I, DL, get(AArch64::MRS), DestReg)
|
||||
.addImm(AArch64SysReg::NZCV)
|
||||
.addReg(AArch64::NZCV, RegState::Implicit | getKillRegState(KillSrc));
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llc -march=aarch64 < %s | FileCheck %s
|
||||
; RUN: llc -verify-machineinstrs -march=aarch64 < %s | FileCheck %s
|
||||
|
||||
; CHECK: mrs [[NZCV_SAVE:x[0-9]+]], NZCV
|
||||
; CHECK: msr NZCV, [[NZCV_SAVE]]
|
||||
|
|
Loading…
Reference in New Issue