Skip to content

Commit 741b43c

Browse files
committed
Address review comments.
1 parent 0f3ab11 commit 741b43c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
216216
LLT Ty = MRI.getType(MI.getOperand(0).getReg());
217217
// Use FPR64 for s64 loads on rv32.
218218
if (GPRSize == 32 && Ty.getSizeInBits() == 64) {
219+
assert(MF.getSubtarget<RISCVSubtarget>().hasStdExtD());
219220
OperandsMapping =
220221
getOperandsMapping({getFPValueMapping(64), GPRValueMapping});
221222
break;
@@ -242,6 +243,7 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
242243
LLT Ty = MRI.getType(MI.getOperand(0).getReg());
243244
// Use FPR64 for s64 stores on rv32.
244245
if (GPRSize == 32 && Ty.getSizeInBits() == 64) {
246+
assert(MF.getSubtarget<RISCVSubtarget>().hasStdExtD());
245247
OperandsMapping =
246248
getOperandsMapping({getFPValueMapping(64), GPRValueMapping});
247249
break;

llvm/test/CodeGen/RISCV/GlobalISel/regbankselect/fp-load-store.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ legalized: true
6262
tracksRegLiveness: true
6363
body: |
6464
bb.1:
65-
liveins: $x10, $f10_d, $f11_d
65+
liveins: $x10, $f10_d
6666
6767
; RV32-LABEL: name: fp_store_no_def_f64
68-
; RV32: liveins: $x10, $f10_d, $f11_d
68+
; RV32: liveins: $x10, $f10_d
6969
; RV32-NEXT: {{ $}}
7070
; RV32-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
7171
; RV32-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f10_d
7272
; RV32-NEXT: G_STORE [[COPY1]](s64), [[COPY]](p0) :: (store (s64))
7373
; RV32-NEXT: PseudoRET
7474
;
7575
; RV64-LABEL: name: fp_store_no_def_f64
76-
; RV64: liveins: $x10, $f10_d, $f11_d
76+
; RV64: liveins: $x10, $f10_d
7777
; RV64-NEXT: {{ $}}
7878
; RV64-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
7979
; RV64-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f10_d

0 commit comments

Comments
 (0)