Skip to content

Commit 4801bfa

Browse files
stuijChenyang-L
authored andcommitted
[ARM] in ExpandTMOV32BitImm, CPSR register ops should be Defined
The CPSR registers ops of the instructions constructed in ExpandTMOV32BitImm were marked as kill, instead of define. Best to use the pre-existing t1CondCodeOp fn to construct CPSRs. Reviewed By: simonwallis2 Differential Revision: https://reviews.llvm.org/D153763
1 parent b307683 commit 4801bfa

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -984,34 +984,34 @@ void ARMExpandPseudo::ExpandTMOV32BitImm(MachineBasicBlock &MBB,
984984

985985
Upper8_15 =
986986
BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(ARM::tMOVi8), DstReg)
987-
.addReg(ARM::CPSR, RegState::Kill);
987+
.add(t1CondCodeOp(true));
988988

989989
LSL_U8_15 =
990990
BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(ARM::tLSLri), DstReg)
991-
.addReg(ARM::CPSR, RegState::Kill)
991+
.add(t1CondCodeOp(true))
992992
.addReg(DstReg)
993993
.addImm(8)
994994
.add(predOps(ARMCC::AL))
995995
.setMIFlags(MIFlags);
996996

997997
Upper0_7 = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(ARM::tADDi8), DstReg)
998-
.addReg(ARM::CPSR, RegState::Kill)
998+
.add(t1CondCodeOp(true))
999999
.addReg(DstReg);
10001000

10011001
MachineInstr *LSL_U0_7 = MBB.getParent()->CloneMachineInstr(LSL_U8_15);
10021002
MBB.insert(MBBI, LSL_U0_7);
10031003

10041004
Lower8_15 =
10051005
BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(ARM::tADDi8), DstReg)
1006-
.addReg(ARM::CPSR, RegState::Kill)
1006+
.add(t1CondCodeOp(true))
10071007
.addReg(DstReg);
10081008

10091009
MachineInstr *LSL_L8_15 = MBB.getParent()->CloneMachineInstr(LSL_U8_15);
10101010
MBB.insert(MBBI, LSL_L8_15);
10111011

10121012
Lower0_7 = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(ARM::tADDi8))
10131013
.addReg(DstReg, RegState::Define | getDeadRegState(DstIsDead))
1014-
.addReg(ARM::CPSR, RegState::Kill)
1014+
.add(t1CondCodeOp(true))
10151015
.addReg(DstReg);
10161016

10171017
Upper8_15.setMIFlags(MIFlags);

llvm/test/CodeGen/ARM/execute-only.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
; UNSUPPORTED: expensive_checks
2-
31
; RUN: llc -mtriple=thumbv8m.base-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2BASE %s
42
; RUN: llc -mtriple=thumbv8m.base-eabi -mcpu=cortex-m23 -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2BASE %s
53
; RUN: llc -mtriple=thumbv7m-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2 %s

0 commit comments

Comments
 (0)