This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fill out basic integer RVV ISel patterns
ClosedPublic

Authored by frasercrmck on Dec 28 2020, 12:49 AM.

Details

Summary

This complements the existing RVV ISel patterns for arithmetic, bitwise
and shifts with the remaining operations in those categories: sub, and,
xor, sra.

Diff Detail

Event Timeline

frasercrmck created this revision.Dec 28 2020, 12:49 AM
frasercrmck requested review of this revision.Dec 28 2020, 12:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2020, 12:49 AM
craig.topper added inline comments.Dec 28 2020, 10:35 AM
llvm/test/CodeGen/RISCV/rvv/vand-sdnode-rv32.ll
31

Should we pick a different value here so this test doesn't break if someone fixes DAG combine to optimize out and with -1 on scalable vectors.

  • choose a better constant than -1
frasercrmck marked an inline comment as done.Dec 28 2020, 10:53 AM
frasercrmck added inline comments.
llvm/test/CodeGen/RISCV/rvv/vand-sdnode-rv32.ll
31

Yes, good shout! I arbitrarily chose -10.

Now that you mention it I'll push an NFC to fix the same flaw in the existing upstream vor-sdnode-* tests.

craig.topper added inline comments.Dec 28 2020, 3:13 PM
llvm/test/CodeGen/RISCV/rvv/vrsub-sdnode-rv32.ll
21

This constant should probably also change. sub -1, X is equivalent to xor x, -1. InstCombine knows this but I guess SelectionDAG doesn't yet.

craig.topper added inline comments.Dec 28 2020, 3:24 PM
llvm/test/CodeGen/RISCV/rvv/vrsub-sdnode-rv32.ll
21

Or rather it doesn't know it for SPLAT_VECTOR yet.

frasercrmck marked an inline comment as done.

rebase on main
choose better vrsub constant

frasercrmck marked 2 inline comments as done.Dec 29 2020, 4:19 AM
frasercrmck added inline comments.
llvm/test/CodeGen/RISCV/rvv/vrsub-sdnode-rv32.ll
21

Yep good idea. I've updated the tests.

This revision is now accepted and ready to land.Dec 29 2020, 10:03 AM
This revision was automatically updated to reflect the committed changes.
frasercrmck marked an inline comment as done.