MIPS: optimize some floating load to mfc1
Open
backend:MIPS
missed-optimization
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```c
double f(double a) {
return a * 4.0;
}
```
```asm
lui $2, %hi(_gp_disp)
addiu $2, $2, %lo(_gp_disp)
addu $1, $2, $25
lw $1, %got($CPI0_0)($1)
ldc1 $f0, %lo($CPI0_0)($1)
jr $ra
mul.d $f0, $f12, $f0
```
In fact we can use
```asm
lui 0x4010
mfhc1
```
Contributor guide
Assessment
This issue has not been assessed yet.