This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add the passthru operand for RVV nomask binary intrinsics.
ClosedPublic

Authored by khchen on Jan 23 2022, 7:48 AM.

Details

Summary

The goal is support tail and mask policy in RVV builtins.
We focus on IR part first.
If the passthru operand is undef, we use tail agnostic, otherwise
use tail undisturbed.

I will update tests in upstream patch to avoid too much files
changed in phabricator.

Diff Detail

Event Timeline

khchen created this revision.Jan 23 2022, 7:48 AM
khchen requested review of this revision.Jan 23 2022, 7:48 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 23 2022, 7:48 AM
khchen updated this revision to Diff 403124.Jan 25 2022, 8:33 PM

Add passthru operand for VSLIDE1UP_VL and VSLIDE1DOWN_VL to handle
i64 scalar in rv32.

rogfer01 accepted this revision.Jan 26 2022, 11:45 PM

Looks reasonable to me. Thans @khchen!

This revision is now accepted and ready to land.Jan 26 2022, 11:45 PM
khchen updated this revision to Diff 403723.Jan 27 2022, 10:24 AM

Thanks @rogfer01!

So sorry, I fixed two bugs after testing more.
include VPatTiedBinaryNoMaskTU and missed tu pattern
for int_riscv_vrsub.

@rogfer01 could you please help to review the letest patch again, thanks!

jiegec added a subscriber: jiegec.Jan 28 2022, 5:01 PM
craig.topper added inline comments.Feb 6 2022, 8:42 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
4684

Are we dropping the policy operand for masked intrinsics here?

4720

Capitalize variable name

khchen updated this revision to Diff 407151.Feb 9 2022, 6:59 AM

address Craig's comments.

  1. Add masked vslide test to test policy operand.
  2. The masked VLSIDE1 would only emit mask undisturbed policy regardless of giving

mask agnostic policy until InsertVSETVLI supports mask agnostic.

Gentle ping.

craig.topper added inline comments.Feb 14 2022, 10:14 AM
clang/include/clang/Basic/riscv_vector.td
181

Should this be HasNoMaskPassThru rather than Policy?

llvm/lib/Target/RISCV/RISCVISelLowering.cpp
4733

VSLDIE1 -> VSLIDE1

Fix the clang-format warning

4760

I don't think you can assert the policy here. The mask can be folded to undef without the user knowing.

llvm/test/CodeGen/RISCV/rvv/masked-vslide1down-rv32.ll
56

untill -> until

78

untill -> until

khchen updated this revision to Diff 408696.Feb 14 2022, 8:08 PM

address Craig's comments. Thanks!!

LGTM other than what I think is an unnecessary include.

llvm/lib/Target/RISCV/RISCVISelLowering.cpp
15

This file is included in RISCV.h can we remove this change?

This revision was landed with ongoing or failed builds.Feb 15 2022, 6:39 PM
This revision was automatically updated to reflect the committed changes.
eopXD added inline comments.Feb 23 2022, 11:21 PM
clang/include/clang/Basic/riscv_vector.td
180

Nit: V-spec prefers to call instructions without masking operands "unmasked instructions"? Maybe a RFC patch later?

180

I mean an NFC patch.