Page MenuHomePhabricator

[LV][SLP] Mark is_fpclass as vectorizable
Needs ReviewPublic

Authored by Nuullll on Aug 21 2022, 9:05 PM.

Details

Summary

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@intel.com>

Diff Detail

Unit TestsFailed

TimeTest
60,080 msx64 debian > MLIR.Examples/standalone::test.toy
Script: -- : 'RUN: at line 1'; /usr/bin/cmake /var/lib/buildkite-agent/builds/llvm-project/mlir/examples/standalone -G "Ninja" -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/var/lib/buildkite-agent/builds/llvm-project/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld

Event Timeline

Nuullll created this revision.Aug 21 2022, 9:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2022, 9:05 PM
Nuullll updated this revision to Diff 454371.Aug 21 2022, 9:13 PM

Fix format and add a test.

Nuullll updated this revision to Diff 454372.Aug 21 2022, 9:21 PM
Nuullll edited the summary of this revision. (Show Details)

Update commit message.

Nuullll updated this revision to Diff 454373.Aug 21 2022, 9:24 PM
Nuullll edited the summary of this revision. (Show Details)

Add Signed-off.

Nuullll published this revision for review.Aug 21 2022, 9:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2022, 9:28 PM
eopXD added a subscriber: eopXD.Sep 20 2022, 11:14 PM
eopXD added inline comments.Sep 21 2022, 12:53 AM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
4185

I guess you will need the same change under VPlanRecipes::widenPredicateCallHelper too?

eopXD added inline comments.Sep 21 2022, 1:08 AM
llvm/include/llvm/Analysis/VectorUtils.h
325

I personally think OverloadReturnType makes more sense.

eopXD added a comment.Sep 21 2022, 3:12 AM

Title should also add [Scalarizer]