This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support vreinterpret intrinsics between vector boolean type and m1 vector integer type
ClosedPublic

Authored by eopXD on May 2 2023, 3:17 AM.

Diff Detail

Event Timeline

eopXD created this revision.May 2 2023, 3:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 3:17 AM
eopXD requested review of this revision.May 2 2023, 3:17 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 2 2023, 3:17 AM
eopXD edited the summary of this revision. (Show Details)May 2 2023, 3:18 AM
kito-cheng added inline comments.May 5 2023, 6:13 PM
clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vreinterpret.c
1

UTC_ARGS: --version 2?

10–13

Why their are so many unrelated diff?

craig.topper added inline comments.May 5 2023, 6:26 PM
llvm/include/llvm/IR/IntrinsicsRISCV.td
1418 ↗(On Diff #518672)

Do we need an intrinsic?

m1 -> mask is bitcast m1 vscale type to <vscale x 64 x i1> and a llvm.experimental.vector.extract
mask -> m1 is llvm.experimental.vector.insert to <vscale x 64 x i1> and a bitcast.

1418 ↗(On Diff #518672)

oops there's no experimental in the insert/extract names.

eopXD updated this revision to Diff 520312.May 8 2023, 3:08 AM
eopXD marked 4 inline comments as done.

Changes:

  • Rebase to remove noisy changes.
  • Removed LLVM intrinsic and use vector_insert/vector_extract & bitcast instead.
eopXD edited the summary of this revision. (Show Details)May 8 2023, 3:08 AM
eopXD added inline comments.
clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vreinterpret.c
1

Cleared the diff with an NFC commit.

llvm/include/llvm/IR/IntrinsicsRISCV.td
1418 ↗(On Diff #518672)

Replacing with insert/extract here with index = 0.

craig.topper added inline comments.May 8 2023, 6:24 PM
clang/include/clang/Basic/riscv_vector.td
2042

Don't use SmallVector for a fixed number of items. You can use a plain array.

eopXD updated this revision to Diff 520669.May 9 2023, 6:03 AM
eopXD edited the summary of this revision. (Show Details)

Address comments from Craig.

eopXD marked an inline comment as done.May 9 2023, 6:11 AM
craig.topper added inline comments.May 11 2023, 11:27 AM
clang/include/clang/Basic/riscv_vector.td
2042

This SmallVector is unused

eopXD updated this revision to Diff 522060.May 14 2023, 11:55 PM
eopXD marked an inline comment as done.

Remove unused variable.

This revision is now accepted and ready to land.May 15 2023, 4:45 PM
evandro removed a subscriber: evandro.May 17 2023, 3:56 PM