This patch extends D124824. It uses SHXADD+SLLI to emit 3, 5, or 9 multiplied by a power 2.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1822 | Do we need a new GPR here? |
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1822 | And if we do need a new GPR, can we guarantee we don't need an extra emergency spill slot? |
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1822 | Done, I changed to reuse VL. |
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1823 | This needs RegState::Kill because it ends the lifetime of the previous definition of VL. |
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1823 | Done. |
NumOfVReg % 3 == 0 when we really matched the (NumOfVReg % 9 == 0 && isPowerOf2_64(NumOfVReg / 9) case. Any number divisible by 9 is also divisible by 3.