These tests revolve around checking that the implied offsets fit the simm12 immediates. When they do, the offsets can be folded into the loads/stores, and therefore they should have zero cost.
The patch adds vector tests, despite the RISC-V backend currently not targetting any vector units. That was a borderline decision. Since we can compile IR vector instructions to scalar native ones, I felt including the vector tests made sense. This way we also have the infrastructure already in place for when we decide to add support for vector extensions.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I think it would make sense to combine the RV32I and RV64I check lines into a shared RVI check-prefix, as I don't think we're expecting different cost model answers for RV32 vs RV64?
That sounds sensible. I did a quick review, to see if there might have been a plausible reason for the split, and I couldn't find any. Will change.
test/Analysis/CostModel/RISCV/gep.ll | ||
---|---|---|
3 | You want a -mtriple=riscv64 RUN line here, but with the same RVI check-prefix |
LGTM with minor nit
test/Analysis/CostModel/RISCV/gep.ll | ||
---|---|---|
19 | Nit: I think these empty comment lines are unwanted and an artifact of when there were two different check prefixes |
You want a -mtriple=riscv64 RUN line here, but with the same RVI check-prefix