@@ -151,6 +151,7 @@ bool RISCVRegisterBankInfo::onlyUsesFP(const MachineInstr &MI,
151
151
switch (MI.getOpcode ()) {
152
152
case RISCV::G_FCVT_W_RV64:
153
153
case RISCV::G_FCVT_WU_RV64:
154
+ case RISCV::G_FCLASS:
154
155
case TargetOpcode::G_FPTOSI:
155
156
case TargetOpcode::G_FPTOUI:
156
157
case TargetOpcode::G_FCMP:
@@ -326,19 +327,21 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
326
327
// Use FPR64 for s64 loads on rv32.
327
328
if (GPRSize == 32 && Size.getFixedValue () == 64 ) {
328
329
assert (MF.getSubtarget <RISCVSubtarget>().hasStdExtD ());
329
- OpdsMapping[0 ] = getFPValueMapping (Ty. getSizeInBits () );
330
+ OpdsMapping[0 ] = getFPValueMapping (Size );
330
331
break ;
331
332
}
332
333
333
334
// Check if that load feeds fp instructions.
334
335
// In that case, we want the default mapping to be on FPR
335
336
// instead of blind map every scalar to GPR.
336
- if (anyUseOnlyUseFP (MI.getOperand (0 ).getReg (), MRI, TRI))
337
+ if (anyUseOnlyUseFP (MI.getOperand (0 ).getReg (), MRI, TRI)) {
337
338
// If we have at least one direct use in a FP instruction,
338
339
// assume this was a floating point load in the IR. If it was
339
340
// not, we would have had a bitcast before reaching that
340
341
// instruction.
341
- OpdsMapping[0 ] = getFPValueMapping (Ty.getSizeInBits ());
342
+ OpdsMapping[0 ] = getFPValueMapping (Size);
343
+ break ;
344
+ }
342
345
343
346
break ;
344
347
}
0 commit comments