[PATCH] D151176: [RISCV] Custom lower fixed-length vector llvm.is.fpclass to vfclass.v

Liao Chunyu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 19:27:39 PDT 2023


liaolucy updated this revision to Diff 524975.
liaolucy marked 3 inline comments as done.
liaolucy added a comment.

Update try to address comments.
Use AND and SETNE.
Update test case.

If the changes are correct, then it seems that this patch is not needed:
testcase:

  declare <2 x i1> @llvm.is.fpclass.v2f32(<2 x float>, i32)
  define <2 x i1> @isnan_v2f32(<2 x float> %x) nounwind {
    %1 = call <2 x i1> @llvm.is.fpclass.v2f32(<2 x float> %x, i32 3)  ; nan
    ret <2 x i1> %1
  }

Without this patch:

  vsetivli        zero, 2, e32, mf2, ta, ma
  vmfne.vv        v8, v8, v8
  vmor.mm v0, v8, v8

with the patch, we get:

  vsetivli        zero, 2, e32, mf2, ta, ma
  vfclass.v       v8, v8
  li      a0, 768
  vand.vx v8, v8, a0
  vmsne.vi        v0, v8, 0
  ret


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151176/new/

https://reviews.llvm.org/D151176

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfclass.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151176.524975.patch
Type: text/x-patch
Size: 9614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230524/5cf54ca8/attachment.bin>


More information about the llvm-commits mailing list