Patch like D116735 suggest improvement for LSR, but we currently
don't have test coverage for this under RISCV. Testcases are modified
from CodeGen/X86/cases loop-strength-reduce*.ll
Details
- Reviewers
joshua-arch1 asb craig.topper jrtc27 frasercrmck reames - Group Reviewers
Restricted Project
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/test/CodeGen/RISCV/loop-strength-reduce.ll | ||
---|---|---|
7 ↗ | (On Diff #421750) | Can we add signext attributes to the i32 arguments to match the ABI for rv64 and remove some extra sext.w |
The test case file names are uninformative, and having both reduce-2/3 and reduce2/3 doesn't seem like a good idea
Update code.
- Delete peephole optimization testcases of X86
- Delete duplicate test case (since we are checking line-by-line)
- Rename test cases
- Add some descriptions into test cases
llvm/test/CodeGen/RISCV/loop-strength-reduce-add-cheaper-than-mul.ll | ||
---|---|---|
75 | Please use the -mattr=+m to avoid this libcall | |
llvm/test/CodeGen/RISCV/loop-strength-reduce-ivusers.ll | ||
49 | Why is this loop substantially simpler than the RV32 version? I suspect LSR doesn't run on RV64, but that means that LSR is making the RV32 loop worse than we would get without it? | |
58 | Are these branch on true needed? | |
75 | This load is dead. This whole test looks overly reduced. |
Update testcase:
- add -mattr=+m for loop-strength-reduce-add-cheaper-than-mul.ll
- run simplifycfg for loop-strength-reduce-ivusers.ll
llvm/test/CodeGen/RISCV/loop-strength-reduce-ivusers.ll | ||
---|---|---|
49 | Yes. LSR is generating running on RV32 and generating worse code. | |
58 | Updated test case with simplifycfg | |
75 | Updated test case with simplifycfg |
@reames
Since you mentioned the LSR deficiency in your public note.
You may be interested with these new test cases for the RISC-V backend.
I split off, cleaned up, and landed two of these in 923831e. It was easier to do the cleanup myself than explain what needed done.
The two I left out make heavy use of struct types. In addition to the style of simplification done in the landed ones, we should also maximally simplify the struct types involved. Want to take a shot at that? I ran out of time for this at the moment.
Please use the -mattr=+m to avoid this libcall