[PATCH] D148803: [ConstantFolding] Fix crash when folding vector llvm.is.fpclass
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 20 07:35:22 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5fc6425fb6c7: [ConstantFolding] Fix crash when folding vector llvm.is.fpclass (authored by foad).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148803/new/
https://reviews.llvm.org/D148803
Files:
llvm/lib/Analysis/VectorUtils.cpp
llvm/test/Transforms/InstSimplify/is_fpclass.ll
Index: llvm/test/Transforms/InstSimplify/is_fpclass.ll
===================================================================
--- /dev/null
+++ 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> <half 0xH7C00, half 0xH7C00>, i32 3)
+ ret <2 x i1> %i
+}
+
+declare <2 x i1> @llvm.is.fpclass.v2f16(<2 x half>, i32 immarg)
Index: llvm/lib/Analysis/VectorUtils.cpp
===================================================================
--- llvm/lib/Analysis/VectorUtils.cpp
+++ 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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148803.515328.patch
Type: text/x-patch
Size: 1267 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230420/ac254f4f/attachment.bin>
More information about the llvm-commits
mailing list