[PATCH] D124358: [LV][SLP] Mark fptosi_sat as vectorizable

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 24 23:26:58 PDT 2022


dmgreen created this revision.
dmgreen added reviewers: RKSimon, spatel, fhahn, bjope.
Herald added subscribers: ctetreau, hiraditya.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This adds fptosi_sat and fptoui_sat to the list of trivially vectorizable functions, mainly so that the loop vectorizer can vectorize the instruction. Marking them as trivially vectorizable also allows them to be SLP vectorized, and Scalarized.

The signature of a fptosi_sat requires two type overrides (@llvm.fptosi.sat.v2i32.v2f32), unlike other intrinsics that often only take a single. This patch alters hasVectorInstrinsicOverloadedScalarOpd to hasVectorInstrinsicOverloadedOpd, so that it can mark the first operand of the intrinsic as a overleaded (but not scalar) operand.


https://reviews.llvm.org/D124358

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/fpsat.ll
  llvm/test/Transforms/SLPVectorizer/AArch64/fpsat.ll
  llvm/test/Transforms/Scalarizer/intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124358.424821.patch
Type: text/x-patch
Size: 18675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220425/483cdc69/attachment.bin>


More information about the llvm-commits mailing list