[PATCH] D132344: [LV][SLP] Mark is_fpclass as vectorizable

Yilong Guo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 21 21:28:43 PDT 2022


Nuullll created this revision.
Herald added subscribers: vporpo, hiraditya.
Herald added a project: All.
Nuullll updated this revision to Diff 454371.
Nuullll added a comment.
Nuullll updated this revision to Diff 454372.
Nuullll edited the summary of this revision.
Herald added a subscriber: ctetreau.
Nuullll updated this revision to Diff 454373.
Nuullll edited the summary of this revision.
Nuullll added reviewers: dmgreen, spatel, fhahn.
Nuullll published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fix format and add a test.


Nuullll added a comment.

Update commit message.


Nuullll added a comment.

Add Signed-off.


Nuullll added a comment.

Submit diff


This adds is_fpclass to the list of trivially vectorizable intrinsics, so that LV can vectorize it and SLP can vectorize/scalarize it.

Unlike other intrinsics, the signature of an is_fpclass doesn't use the return type as an overloaded type (i1 @llvm.is.fpclass.f32) -- the return element type is always i1 and the return vector width matches with the first operand.
This patch introduces a new utility function isVectorIntrinsicWithReturnOverloadType, to determine whether an intrinsic uses the return type as the first overloaded type.

Signed-off-by: Yilong Guo <yilong.guo at intel.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132344

Files:
  llvm/include/llvm/Analysis/VectorUtils.h
  llvm/lib/Analysis/VectorUtils.cpp
  llvm/lib/Transforms/Scalar/Scalarizer.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/LoopVectorize/is_fpclass.ll
  llvm/test/Transforms/SLPVectorizer/X86/intrinsic.ll
  llvm/test/Transforms/Scalarizer/intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132344.454373.patch
Type: text/x-patch
Size: 20957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220822/b4bf1112/attachment.bin>


More information about the llvm-commits mailing list