[llvm] r354404 - [InstSimplify] add vector tests for fcmp+fabs; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 19 15:58:02 PST 2019
Author: spatel
Date: Tue Feb 19 15:58:02 2019
New Revision: 354404
URL: http://llvm.org/viewvc/llvm-project?rev=354404&view=rev
Log:
[InstSimplify] add vector tests for fcmp+fabs; NFC
Modified:
llvm/trunk/test/Transforms/InstSimplify/floating-point-compare.ll
Modified: llvm/trunk/test/Transforms/InstSimplify/floating-point-compare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/floating-point-compare.ll?rev=354404&r1=354403&r2=354404&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/floating-point-compare.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/floating-point-compare.ll Tue Feb 19 15:58:02 2019
@@ -173,6 +173,7 @@ declare half @llvm.fabs.f16(half)
declare float @llvm.fabs.f32(float)
declare double @llvm.fabs.f64(double)
declare <2 x float> @llvm.fabs.v2f32(<2 x float>)
+declare <3 x float> @llvm.fabs.v3f32(<3 x float>)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>)
declare float @llvm.sqrt.f32(float)
declare double @llvm.powi.f64(double,i32)
@@ -378,6 +379,68 @@ define <2 x i1> @fabs_nnan_is_not_negati
ret <2 x i1> %cmp
}
+define <2 x i1> @fabs_is_not_negative_negzero(<2 x float> %V) {
+; CHECK-LABEL: @fabs_is_not_negative_negzero(
+; CHECK-NEXT: ret <2 x i1> zeroinitializer
+;
+ %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %V)
+ %cmp = fcmp olt <2 x float> %abs, <float -0.0, float -0.0>
+ ret <2 x i1> %cmp
+}
+
+define <2 x i1> @fabs_is_not_negative_poszero(<2 x float> %V) {
+; CHECK-LABEL: @fabs_is_not_negative_poszero(
+; CHECK-NEXT: ret <2 x i1> zeroinitializer
+;
+ %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %V)
+ %cmp = fcmp olt <2 x float> %abs, <float 0.0, float 0.0>
+ ret <2 x i1> %cmp
+}
+
+define <2 x i1> @fabs_is_not_negative_anyzero(<2 x float> %V) {
+; CHECK-LABEL: @fabs_is_not_negative_anyzero(
+; CHECK-NEXT: [[ABS:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[V:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt <2 x float> [[ABS]], <float 0.000000e+00, float -0.000000e+00>
+; CHECK-NEXT: ret <2 x i1> [[CMP]]
+;
+ %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %V)
+ %cmp = fcmp olt <2 x float> %abs, <float 0.0, float -0.0>
+ ret <2 x i1> %cmp
+}
+
+define <3 x i1> @fabs_is_not_negative_negzero_undef(<3 x float> %V) {
+; CHECK-LABEL: @fabs_is_not_negative_negzero_undef(
+; CHECK-NEXT: [[ABS:%.*]] = call <3 x float> @llvm.fabs.v3f32(<3 x float> [[V:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt <3 x float> [[ABS]], <float -0.000000e+00, float -0.000000e+00, float undef>
+; CHECK-NEXT: ret <3 x i1> [[CMP]]
+;
+ %abs = call <3 x float> @llvm.fabs.v3f32(<3 x float> %V)
+ %cmp = fcmp olt <3 x float> %abs, <float -0.0, float -0.0, float undef>
+ ret <3 x i1> %cmp
+}
+
+define <3 x i1> @fabs_is_not_negative_poszero_undef(<3 x float> %V) {
+; CHECK-LABEL: @fabs_is_not_negative_poszero_undef(
+; CHECK-NEXT: [[ABS:%.*]] = call <3 x float> @llvm.fabs.v3f32(<3 x float> [[V:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt <3 x float> [[ABS]], <float 0.000000e+00, float 0.000000e+00, float undef>
+; CHECK-NEXT: ret <3 x i1> [[CMP]]
+;
+ %abs = call <3 x float> @llvm.fabs.v3f32(<3 x float> %V)
+ %cmp = fcmp olt <3 x float> %abs, <float 0.0, float 0.0, float undef>
+ ret <3 x i1> %cmp
+}
+
+define <3 x i1> @fabs_is_not_negative_anyzero_undef(<3 x float> %V) {
+; CHECK-LABEL: @fabs_is_not_negative_anyzero_undef(
+; CHECK-NEXT: [[ABS:%.*]] = call <3 x float> @llvm.fabs.v3f32(<3 x float> [[V:%.*]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt <3 x float> [[ABS]], <float 0.000000e+00, float -0.000000e+00, float undef>
+; CHECK-NEXT: ret <3 x i1> [[CMP]]
+;
+ %abs = call <3 x float> @llvm.fabs.v3f32(<3 x float> %V)
+ %cmp = fcmp olt <3 x float> %abs, <float 0.0, float -0.0, float undef>
+ ret <3 x i1> %cmp
+}
+
define i1 @orderedLessZeroSelect(float, float) {
; CHECK-LABEL: @orderedLessZeroSelect(
; CHECK-NEXT: ret i1 true
More information about the llvm-commits
mailing list