[PATCH] D75165: [ARM,MVE] Add predicated intrinsics for many unary functions.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 04:25:21 PST 2020


simon_tatham created this revision.
simon_tatham added reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya, kristof.beyls.
Herald added projects: clang, LLVM.

This commit adds the predicated MVE intrinsics for the same set of
unary operations that I added in their unpredicated forms in

- D74333 <https://reviews.llvm.org/D74333> (vrint)
- D74334 <https://reviews.llvm.org/D74334> (vrev)
- D74335 <https://reviews.llvm.org/D74335> (vclz, vcls)
- D74336 <https://reviews.llvm.org/D74336> (vmovl)
- D74337 <https://reviews.llvm.org/D74337> (vmovn)

but since the predicated versions are a lot more similar to each
other, I've kept them all together in a single big patch. Everything
here is done in the standard way we've been doing other predicated
operations: an IR intrinsic called `@llvm.arm.mve.foo.predicated` and
some isel rules that match that alongside whatever they accept for the
unpredicated version of the same instruction.

In order to write the isel rules conveniently, I've refactored the
existing isel rules for the affected instructions into multiclasses
parametrised by a vector-type class, in the usual way. All those
refactorings are intended to leave the existing isel rules unchanged:
the only difference should be that new ones for the predicated
intrinsics are introduced.

The only tiny infrastructure change I needed in this commit was to
change the implementation of `IntrinsicMX` in `arm_mve_defs.td` so
that the records it defines are anonymous rather than named (and use
`NameOverride` to set the output intrinsic name), which allows me to
call it twice in two multiclasses with the same `NAME` without a
tablegen-time error.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75165

Files:
  clang/include/clang/Basic/arm_mve.td
  clang/include/clang/Basic/arm_mve_defs.td
  clang/test/CodeGen/arm-mve-intrinsics/absneg.c
  clang/test/CodeGen/arm-mve-intrinsics/vclz.c
  clang/test/CodeGen/arm-mve-intrinsics/vcvt.c
  clang/test/CodeGen/arm-mve-intrinsics/vmovl.c
  clang/test/CodeGen/arm-mve-intrinsics/vmovn.c
  clang/test/CodeGen/arm-mve-intrinsics/vrev.c
  clang/test/CodeGen/arm-mve-intrinsics/vrnd.c
  llvm/include/llvm/IR/IntrinsicsARM.td
  llvm/lib/Target/ARM/ARMInstrMVE.td
  llvm/test/CodeGen/Thumb2/mve-intrinsics/absneg-predicated.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/vclzcls-predicated.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/vcvt-fp-int.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/vmovl.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/vmovn.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/vrev.ll
  llvm/test/CodeGen/Thumb2/mve-intrinsics/vrint-predicated.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75165.246672.patch
Type: text/x-patch
Size: 191095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200226/0198a195/attachment-0001.bin>


More information about the llvm-commits mailing list