Skip to content

Commit 12600eb

Browse files
authored
[RISCV] Add X0_Pair to RISCVDeadRegisterDefinitions. (#141831)
1 parent cf56b53 commit 12600eb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

llvm/lib/Target/RISCV/RISCVDeadRegisterDefinitions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ bool RISCVDeadRegisterDefinitions::runOnMachineFunction(MachineFunction &MF) {
9999
X0Reg = RISCV::X0_W;
100100
} else if (RC && RC->contains(RISCV::X0_H)) {
101101
X0Reg = RISCV::X0_H;
102+
} else if (RC && RC->contains(RISCV::X0_Pair)) {
103+
X0Reg = RISCV::X0_Pair;
102104
} else {
103105
LLVM_DEBUG(dbgs() << " Ignoring, register is not a GPR.\n");
104106
continue;

llvm/test/CodeGen/RISCV/double-mem.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ define dso_local double @fld_fsd_global(double %a, double %b) nounwind {
141141
; RV32IZFINXZDINXZILSD: # %bb.0:
142142
; RV32IZFINXZDINXZILSD-NEXT: lui a4, %hi(G)
143143
; RV32IZFINXZDINXZILSD-NEXT: fadd.d a0, a0, a2
144-
; RV32IZFINXZDINXZILSD-NEXT: ld a2, %lo(G)(a4)
144+
; RV32IZFINXZDINXZILSD-NEXT: ld zero, %lo(G)(a4)
145145
; RV32IZFINXZDINXZILSD-NEXT: addi a2, a4, %lo(G)
146146
; RV32IZFINXZDINXZILSD-NEXT: sd a0, %lo(G)(a4)
147-
; RV32IZFINXZDINXZILSD-NEXT: ld a4, 72(a2)
147+
; RV32IZFINXZDINXZILSD-NEXT: ld zero, 72(a2)
148148
; RV32IZFINXZDINXZILSD-NEXT: sd a0, 72(a2)
149149
; RV32IZFINXZDINXZILSD-NEXT: ret
150150
; Use %a and %b in an FP op to ensure floating point registers are used, even

llvm/test/CodeGen/RISCV/zilsd.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ define i64 @load(ptr %a) nounwind {
88
; CHECK-LABEL: load:
99
; CHECK: # %bb.0:
1010
; CHECK-NEXT: ld a2, 80(a0)
11-
; CHECK-NEXT: ld a0, 0(a0)
11+
; CHECK-NEXT: ld zero, 0(a0)
1212
; CHECK-NEXT: mv a0, a2
1313
; CHECK-NEXT: mv a1, a3
1414
; CHECK-NEXT: ret

0 commit comments

Comments
 (0)