From c006a0ad4b935f14bbe678733c41e42f45b750cc Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 7 Nov 2018 15:01:09 +0000 Subject: [PATCH] [InstCombine] add test for fcmp+fabs; NFC llvm-svn: 346320 --- llvm/test/Transforms/InstCombine/fcmp.ll | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/llvm/test/Transforms/InstCombine/fcmp.ll b/llvm/test/Transforms/InstCombine/fcmp.ll index dc91ee9552b3..e14a56bbcb24 100644 --- a/llvm/test/Transforms/InstCombine/fcmp.ll +++ b/llvm/test/Transforms/InstCombine/fcmp.ll @@ -217,6 +217,26 @@ define i1 @fabs_oge(double %a) { ret i1 %cmp } +define i1 @fabs_ult(double %a) { +; CHECK-LABEL: @fabs_ult( +; CHECK-NEXT: [[CALL:%.*]] = call double @llvm.fabs.f64(double [[A:%.*]]) +; CHECK-NEXT: [[CMP:%.*]] = fcmp reassoc arcp ult double [[CALL]], 0.000000e+00 +; CHECK-NEXT: ret i1 [[CMP]] +; + %call = call double @llvm.fabs.f64(double %a) + %cmp = fcmp reassoc arcp ult double %call, 0.0 + ret i1 %cmp +} + +define <2 x i1> @fabs_ult_nnan(<2 x float> %a) { +; CHECK-LABEL: @fabs_ult_nnan( +; CHECK-NEXT: ret <2 x i1> zeroinitializer +; + %call = call <2 x float> @llvm.fabs.v2f32(<2 x float> %a) + %cmp = fcmp nnan reassoc arcp ult <2 x float> %call, zeroinitializer + ret <2 x i1> %cmp +} + define i1 @fabs_une(half %a) { ; CHECK-LABEL: @fabs_une( ; CHECK-NEXT: [[CMP:%.*]] = fcmp une half [[A:%.*]], 0xH0000