diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp --- a/llvm/lib/Analysis/VectorUtils.cpp +++ b/llvm/lib/Analysis/VectorUtils.cpp @@ -86,6 +86,7 @@ case Intrinsic::pow: case Intrinsic::fma: case Intrinsic::fmuladd: + case Intrinsic::is_fpclass: case Intrinsic::powi: case Intrinsic::canonicalize: case Intrinsic::fptosi_sat: @@ -103,6 +104,7 @@ case Intrinsic::abs: case Intrinsic::ctlz: case Intrinsic::cttz: + case Intrinsic::is_fpclass: case Intrinsic::powi: return (ScalarOpdIdx == 1); case Intrinsic::smul_fix: diff --git a/llvm/test/Transforms/InstSimplify/is_fpclass.ll b/llvm/test/Transforms/InstSimplify/is_fpclass.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Transforms/InstSimplify/is_fpclass.ll @@ -0,0 +1,12 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 +; RUN: opt < %s -S -passes=instsimplify | FileCheck %s + +define <2 x i1> @f() { +; CHECK-LABEL: define <2 x i1> @f() { +; CHECK-NEXT: ret <2 x i1> zeroinitializer +; + %i = call <2 x i1> @llvm.is.fpclass.v2f16(<2 x half> , i32 3) + ret <2 x i1> %i +} + +declare <2 x i1> @llvm.is.fpclass.v2f16(<2 x half>, i32 immarg)