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
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
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?
Comment Actions
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 | ||
---|---|---|
2 ↗ | (On Diff #201189) | You want a -mtriple=riscv64 RUN line here, but with the same RVI check-prefix |
Comment Actions
LGTM with minor nit
test/Analysis/CostModel/RISCV/gep.ll | ||
---|---|---|
18 ↗ | (On Diff #201244) | Nit: I think these empty comment lines are unwanted and an artifact of when there were two different check prefixes |