This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add integer promote support for vp.gather and vp.scatter
AbandonedPublic

Authored by Jimerlife on May 23 2022, 11:13 PM.

Details

Summary

Add integer promote support for vp.gather and vp.scatter

Diff Detail

Event Timeline

Jimerlife created this revision.May 23 2022, 11:13 PM
Jimerlife requested review of this revision.May 23 2022, 11:13 PM
craig.topper requested changes to this revision.May 24 2022, 12:09 AM
craig.topper added inline comments.
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpgather.ll
13

This isn't correct code for the IR. This is loading 32 bit elements from memory, but the memory value is only 7 bits.

This revision now requires changes to proceed.May 24 2022, 12:09 AM
craig.topper added inline comments.May 24 2022, 12:11 AM
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpgather.ll
13

Oops. I guess it's reading 8 bit elements. So maybe it's ok.

craig.topper added inline comments.May 24 2022, 12:14 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
2128

Do we need to promote index and mask for gather?

We don't seem to be testing index and mask promotion for scatter.

Jimerlife added inline comments.May 24 2022, 12:34 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
2128

Now I couldn't write index and mask promotion test in RISCV. I think index and mask promotion are unnecessary to RISCV. I add PromoteIntOp_VP_SCATTER with reference to PromoteIntOp_MSCATTER.

craig.topper added inline comments.May 24 2022, 1:10 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
2128

Thinking about it. Does RISC-V even need the promote support for data? Shouldn’t the vectorizer be using isLegalMaskedGather from TTI?

Jimerlife abandoned this revision.May 24 2022, 6:42 PM