This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Use x0 in vsetvli when avl is equal to vlmax.
ClosedPublic

Authored by jacquesguan on Jul 27 2023, 2:30 AM.

Details

Summary

We could use x0 form in vsetvli when we already know the vlmax and avl is equal to it.

Diff Detail

Event Timeline

jacquesguan created this revision.Jul 27 2023, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 2:30 AM
jacquesguan requested review of this revision.Jul 27 2023, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 2:30 AM
luke added a comment.Jul 27 2023, 5:19 AM

Makes sense to me

llvm/test/CodeGen/RISCV/rvv/vsetvli-intrinsics.ll
5–11

Small typo

craig.topper added inline comments.Jul 27 2023, 10:22 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
557
const unsigned VLEN = Subtarget->getRealMinVLen();
if (VLEN == Subtarget->getRealMaxVLen()) {

address comment.

jacquesguan marked 2 inline comments as done.Jul 28 2023, 1:30 AM
jacquesguan added inline comments.
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
557

Done.

llvm/test/CodeGen/RISCV/rvv/vsetvli-intrinsics.ll
5–11

Done.

This revision is now accepted and ready to land.Jul 28 2023, 9:16 AM
This revision was automatically updated to reflect the committed changes.
jacquesguan marked 2 inline comments as done.