@@ -53,9 +53,6 @@ void Thumb1InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
53
53
.addReg (SrcReg, getKillRegState (KillSrc))
54
54
.add (predOps (ARMCC::AL));
55
55
else {
56
- // FIXME: Can also use 'mov hi, $src; mov $dst, hi',
57
- // with hi as either r10 or r11.
58
-
59
56
const TargetRegisterInfo *RegInfo = st.getRegisterInfo ();
60
57
if (MBB.computeRegisterLiveness (RegInfo, ARM::CPSR, I)
61
58
== MachineBasicBlock::LQR_Dead) {
@@ -65,6 +62,35 @@ void Thumb1InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
65
62
return ;
66
63
}
67
64
65
+ // Can also use 'mov hi, $src; mov $dst, hi',
66
+ // with hi as either r10 or r11.
67
+ if (MBB.computeRegisterLiveness (RegInfo, ARM::R10, I) ==
68
+ MachineBasicBlock::LQR_Dead) {
69
+ // Use high register to move source to destination
70
+ BuildMI (MBB, I, DL, get (ARM::tMOVr), ARM::R10)
71
+ .addReg (SrcReg, getKillRegState (KillSrc))
72
+ .add (predOps (ARMCC::AL));
73
+ BuildMI (MBB, I, DL, get (ARM::tMOVr), DestReg)
74
+ .addReg (ARM::R10, getKillRegState (KillSrc))
75
+ .add (predOps (ARMCC::AL))
76
+ ->addRegisterDead (ARM::R10, RegInfo);
77
+ return ;
78
+ }
79
+
80
+ if (MBB.computeRegisterLiveness (RegInfo, ARM::R11, I) ==
81
+ MachineBasicBlock::LQR_Dead) {
82
+ // Use high register to move source to destination
83
+ BuildMI (MBB, I, DL, get (ARM::tMOVr), ARM::R11)
84
+ .addReg (SrcReg, getKillRegState (KillSrc))
85
+ .add (predOps (ARMCC::AL));
86
+ BuildMI (MBB, I, DL, get (ARM::tMOVr), DestReg)
87
+ .addReg (ARM::R11, getKillRegState (KillSrc))
88
+ .add (predOps (ARMCC::AL))
89
+ ->addRegisterDead (ARM::R11, RegInfo);
90
+ ;
91
+ return ;
92
+ }
93
+
68
94
// 'MOV lo, lo' is unpredictable on < v6, so use the stack to do it
69
95
BuildMI (MBB, I, DL, get (ARM::tPUSH))
70
96
.add (predOps (ARMCC::AL))
0 commit comments