Initial support for scalable vectorization.
This patch add some basic implements of TTI for scalable vectorization.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll | ||
---|---|---|
2 ↗ | (On Diff #396415) | Use update_test_checks.py, and preferably show the changes to the test case with this patch, not the whole test case, so it's clear what's been improved. |
2 ↗ | (On Diff #396415) | Don't use -linux-gnu targets when it's not OS-specific, just use riscv64 (aka riscv64-unknown-elf) |
10 ↗ | (On Diff #396415) | Not actually showing the code generated? Debug output is generally not great for testing, it's often unclear what's actually going on, it can only run in builds that have debugging built in and you have to write the CHECK lines by hand. |
llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll | ||
---|---|---|
7 ↗ | (On Diff #396415) | This says SVE and the numbers weren't updated to match what is shown on the CHECK lines. |
The commit message seems wrong, because this patch is about tuning the cost-model, not about enabling scalable vectorization.
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | ||
---|---|---|
166 | You may want to add some unit tests to llvm/test/Analysis/CostModel/ for this change. |
That's because if you can't get the cost of some cast instructions, you will not force some instructions a specific cost...Maybe a better way is to make the cast instruction legal...
llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll | ||
---|---|---|
2 ↗ | (On Diff #396415) | thx, I will fix it |
7 ↗ | (On Diff #396415) | Thx...I have fixed it |
10 ↗ | (On Diff #396415) | The test case is from sve, so I think it's better to be consistent with sve... |
llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll | ||
---|---|---|
10 ↗ | (On Diff #396415) | I disagree. Some other targets have some utterly crap tests, we don't need to copy them. |
I see this as a separate concern, since scalable vectorization is already supported if the loop has no cast instructions.
llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll | ||
---|---|---|
10 ↗ | (On Diff #396415) | It depends on what you want to test. For SVE we added this test purely to check which VF gets selected, since there are other tests for testing code-gen itself (because the loop itself is trivial for vectorization). That of course doesn't mean you have to follow the same approach for this test, you can do whatever has your preference. |
You may want to add some unit tests to llvm/test/Analysis/CostModel/ for this change.