brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 02289fd Raw
57 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=instsimplify < %s -S | FileCheck %s3 4define <4 x i1> @vector_reverse_fpclass(<4 x double> nofpclass(nzero nan) %x) {5; CHECK-LABEL: @vector_reverse_fpclass(6; CHECK-NEXT:    ret <4 x i1> splat (i1 true)7;8  %x.abs = call <4 x double> @llvm.fabs.v4f64(<4 x double> %x)9  %op = call <4 x double> @llvm.vector.reverse(<4 x double> %x.abs)10  %cmp = fcmp oge <4 x double> %op, <double 0.0, double 0.0, double 0.0, double 0.0>11  ret <4 x i1> %cmp12}13 14define <4 x i1> @vector_reverse_fpclass2(<4 x double> nofpclass(nzero) %x) {15; CHECK-LABEL: @vector_reverse_fpclass2(16; CHECK-NEXT:    [[X_ABS:%.*]] = call <4 x double> @llvm.fabs.v4f64(<4 x double> [[X:%.*]])17; CHECK-NEXT:    [[OP:%.*]] = call <4 x double> @llvm.vector.reverse.v4f64(<4 x double> [[X_ABS]])18; CHECK-NEXT:    [[CMP:%.*]] = fcmp oge <4 x double> [[OP]], zeroinitializer19; CHECK-NEXT:    ret <4 x i1> [[CMP]]20;21  %x.abs = call <4 x double> @llvm.fabs.v4f64(<4 x double> %x)22  %op = call <4 x double> @llvm.vector.reverse(<4 x double> %x.abs)23  %cmp = fcmp oge <4 x double> %op, <double 0.0, double 0.0, double 0.0, double 0.0>24  ret <4 x i1> %cmp25}26 27define i1 @vector_reverse_fpclass_demanded(<4 x double> %vec, double nofpclass(nzero nan) %x) {28; CHECK-LABEL: @vector_reverse_fpclass_demanded(29; CHECK-NEXT:    ret i1 true30;31 32  %x.abs = call double @llvm.fabs.f64(double %x)33  %vec.x = insertelement <4 x double> %vec, double %x.abs, i64 134  %rev = call <4 x double> @llvm.vector.reverse(<4 x double> %vec.x)35  %ele = extractelement <4 x double> %rev, i64 236  %cmp = fcmp oge double %ele, 0.037  ret i1 %cmp38}39 40define i1 @vector_reverse_fpclass_demanded_fail(<4 x double> %vec, double nofpclass(nzero nan) %x) {41; CHECK-LABEL: @vector_reverse_fpclass_demanded_fail(42; CHECK-NEXT:    [[X_ABS:%.*]] = call double @llvm.fabs.f64(double [[X:%.*]])43; CHECK-NEXT:    [[VEC_X:%.*]] = insertelement <4 x double> [[VEC:%.*]], double [[X_ABS]], i64 144; CHECK-NEXT:    [[REV:%.*]] = call <4 x double> @llvm.vector.reverse.v4f64(<4 x double> [[VEC_X]])45; CHECK-NEXT:    [[ELE:%.*]] = extractelement <4 x double> [[REV]], i64 146; CHECK-NEXT:    [[CMP:%.*]] = fcmp oge double [[ELE]], 0.000000e+0047; CHECK-NEXT:    ret i1 [[CMP]]48;49 50  %x.abs = call double @llvm.fabs.f64(double %x)51  %vec.x = insertelement <4 x double> %vec, double %x.abs, i64 152  %rev = call <4 x double> @llvm.vector.reverse(<4 x double> %vec.x)53  %ele = extractelement <4 x double> %rev, i64 154  %cmp = fcmp oge double %ele, 0.055  ret i1 %cmp56}57