This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add pattern for vnsrl.wi and vnsra.wi instructions
ClosedPublic

Authored by Jimerlife on Mar 15 2022, 1:46 AM.

Details

Diff Detail

Event Timeline

Jimerlife created this revision.Mar 15 2022, 1:46 AM
Jimerlife requested review of this revision.Mar 15 2022, 1:46 AM
frasercrmck added inline comments.Mar 15 2022, 8:35 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
799–800

It feels to me like we should just have one VPatBinarySDNode_V_WV_WX_WI since the individual WV, WX, and WI patterns are only ever used in conjunction with one another.

craig.topper added inline comments.Mar 15 2022, 8:59 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
676

The new pattern and the existing patterns are all checking for the VL being exactly X0. Why is that?

Jimerlife updated this revision to Diff 415668.Mar 15 2022, 7:36 PM
Jimerlife added a reviewer: frasercrmck.

update code, combine one class VPatBinarySDNode_V_WV_WX_WI

Jimerlife marked an inline comment as done.Mar 15 2022, 7:38 PM
Jimerlife added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
676

This patch https://reviews.llvm.org/D118845 move VLMax to X0

craig.topper added inline comments.Mar 15 2022, 8:51 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
676

That wasn't what I was referring to. Most of the patterns in this file use VLOpFrag not X0 so that they work for fixed vectors and VP intrinsics too. This pattern only works VLMax scalable vectors.

Address comments

Jimerlife marked an inline comment as done.Mar 16 2022, 12:10 AM
This revision is now accepted and ready to land.Mar 16 2022, 9:07 AM
This revision was landed with ongoing or failed builds.Mar 17 2022, 12:27 AM
This revision was automatically updated to reflect the committed changes.