[llvm] 73a2adc - InstCombine: Add tests for is_fpclass with ninf sources
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 06:58:18 PST 2022
Author: Matt Arsenault
Date: 2022-12-13T09:58:01-05:00
New Revision: 73a2adc127d85900306c9da43f897c6cce3a8d65
URL: https://github.com/llvm/llvm-project/commit/73a2adc127d85900306c9da43f897c6cce3a8d65
DIFF: https://github.com/llvm/llvm-project/commit/73a2adc127d85900306c9da43f897c6cce3a8d65.diff
LOG: InstCombine: Add tests for is_fpclass with ninf sources
Added:
Modified:
llvm/test/Transforms/InstCombine/is_fpclass.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/is_fpclass.ll b/llvm/test/Transforms/InstCombine/is_fpclass.ll
index e7bf4e224ed8..0e59db6403a2 100644
--- a/llvm/test/Transforms/InstCombine/is_fpclass.ll
+++ b/llvm/test/Transforms/InstCombine/is_fpclass.ll
@@ -396,6 +396,54 @@ define i1 @test_class_is_nan_other_nnan_src(float %x) {
ret i1 %class
}
+; --------------------------------------------------------------------
+; llvm.is.fpclass with ninf sources
+; --------------------------------------------------------------------
+
+define i1 @test_class_is_ninf_pinf_ninf_src(float %x) {
+; CHECK-LABEL: @test_class_is_ninf_pinf_ninf_src(
+; CHECK-NEXT: [[NINF:%.*]] = fadd ninf float [[X:%.*]], 1.000000e+00
+; CHECK-NEXT: [[CLASS:%.*]] = call i1 @llvm.is.fpclass.f32(float [[NINF]], i32 516)
+; CHECK-NEXT: ret i1 [[CLASS]]
+;
+ %ninf = fadd ninf float %x, 1.0
+ %class = call i1 @llvm.is.fpclass.f32(float %ninf, i32 516)
+ ret i1 %class
+}
+
+define i1 @test_class_is_ninf_ninf_src(float %x) {
+; CHECK-LABEL: @test_class_is_ninf_ninf_src(
+; CHECK-NEXT: [[NINF:%.*]] = fadd ninf float [[X:%.*]], 1.000000e+00
+; CHECK-NEXT: [[CLASS:%.*]] = call i1 @llvm.is.fpclass.f32(float [[NINF]], i32 4)
+; CHECK-NEXT: ret i1 [[CLASS]]
+;
+ %ninf = fadd ninf float %x, 1.0
+ %class = call i1 @llvm.is.fpclass.f32(float %ninf, i32 4)
+ ret i1 %class
+}
+
+define i1 @test_class_is_pinf_ninf_src(float %x) {
+; CHECK-LABEL: @test_class_is_pinf_ninf_src(
+; CHECK-NEXT: [[NINF:%.*]] = fadd ninf float [[X:%.*]], 1.000000e+00
+; CHECK-NEXT: [[CLASS:%.*]] = call i1 @llvm.is.fpclass.f32(float [[NINF]], i32 512)
+; CHECK-NEXT: ret i1 [[CLASS]]
+;
+ %ninf = fadd ninf float %x, 1.0
+ %class = call i1 @llvm.is.fpclass.f32(float %ninf, i32 512)
+ ret i1 %class
+}
+
+define i1 @test_class_is_ninf_pinf_pnormal_ninf_src(float %x) {
+; CHECK-LABEL: @test_class_is_ninf_pinf_pnormal_ninf_src(
+; CHECK-NEXT: [[NINF:%.*]] = fadd ninf float [[X:%.*]], 1.000000e+00
+; CHECK-NEXT: [[CLASS:%.*]] = call i1 @llvm.is.fpclass.f32(float [[NINF]], i32 772)
+; CHECK-NEXT: ret i1 [[CLASS]]
+;
+ %ninf = fadd ninf float %x, 1.0
+ %class = call i1 @llvm.is.fpclass.f32(float %ninf, i32 772)
+ ret i1 %class
+}
+
; --------------------------------------------------------------------
; Negation of llvm.is.fpclass
; --------------------------------------------------------------------
More information about the llvm-commits
mailing list