Add patterns for vector widening integer reduction instructions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It'd be nice to see this work for fixed vectors too as I'm concerned we're starting to diverge in support between this and other recent patches, but I suppose we'd need extra patterns for the riscv_sext_vl and riscv_zext_vl, right?
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | ||
---|---|---|
693 | The "true mask" case isn't tested by this patch. |
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | ||
---|---|---|
693 | I think this pattern with true_mask means unmasked, and the cases in llvm/test/CodeGen/RISCV/rvv/vreductions-int-rv64.ll already test this? |
I added patterns for riscv_sext_vl` and riscv_zext_vl, it does take effect, but in some case, I think also need to support the pattern matching riscv_add_vl to widen instruction.
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | ||
---|---|---|
693 | The reductions are different than the instructions already handled in the post process. There is no merge operand for reductions so we can't drop operand 0. This patch only adds widening reductions. That regular reductions are already present with masked and unmasked patterns. Given the change needed to the post-process, I think all the reductions should be done together as a separate patch. |
Why are the tests only i32->i64?
llvm/test/CodeGen/RISCV/rvv/vreductions-int-rv64.ll | ||
---|---|---|
1 | Can you update the rv32 test as well? These files should be kept in sync |
llvm/test/CodeGen/RISCV/rvv/vreductions-int-rv64.ll | ||
---|---|---|
1 | Done. |
The "true mask" case isn't tested by this patch.