[llvm] 5fe8307 - [AArch64] Add scalar min/max costs. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 09:11:31 PST 2022


Author: David Green
Date: 2022-02-25T17:11:24Z
New Revision: 5fe8307b70df467f1063f7524d9b4da9dfafde63

URL: https://github.com/llvm/llvm-project/commit/5fe8307b70df467f1063f7524d9b4da9dfafde63
DIFF: https://github.com/llvm/llvm-project/commit/5fe8307b70df467f1063f7524d9b4da9dfafde63.diff

LOG: [AArch64] Add scalar min/max costs. NFC

The vector costs were already added, this adds scalar variants to
complete the test coverage.

Added: 
    

Modified: 
    llvm/test/Analysis/CostModel/AArch64/min-max.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/CostModel/AArch64/min-max.ll b/llvm/test/Analysis/CostModel/AArch64/min-max.ll
index 123da455546f..57d82c25afad 100644
--- a/llvm/test/Analysis/CostModel/AArch64/min-max.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/min-max.ll
@@ -1,9 +1,13 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=CHECK,CHECK-NOF16
-; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+fullfp16 -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=CHECK,CHECK-F16
+; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -cost-model -analyze -cost-kind=throughput | FileCheck %s --check-prefixes=CHECK,CHECK-NOF16
+; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+fullfp16 -cost-model -analyze -cost-kind=throughput | FileCheck %s --check-prefixes=CHECK,CHECK-F16
 
-define void @reduce_umin() {
-; CHECK-LABEL: 'reduce_umin'
+define void @umin() {
+; CHECK-LABEL: 'umin'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i8 = call i8 @llvm.umin.i8(i8 undef, i8 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i16 = call i16 @llvm.umin.i16(i16 undef, i16 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i32 = call i32 @llvm.umin.i32(i32 undef, i32 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i64 = call i64 @llvm.umin.i64(i64 undef, i64 undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1i8 = call <1 x i8> @llvm.umin.v1i8(<1 x i8> undef, <1 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V3i8 = call <3 x i8> @llvm.umin.v3i8(<3 x i8> undef, <3 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4i8 = call <4 x i8> @llvm.umin.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -22,6 +26,10 @@ define void @reduce_umin() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call <4 x i64> @llvm.umin.v4i64(<4 x i64> undef, <4 x i64> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %i8 = call i8 @llvm.umin.i8(i8 undef, i8 undef)
+  %i16 = call i16 @llvm.umin.i16(i16 undef, i16 undef)
+  %i32 = call i32 @llvm.umin.i32(i32 undef, i32 undef)
+  %i64 = call i64 @llvm.umin.i64(i64 undef, i64 undef)
   %V1i8 = call <1 x i8> @llvm.umin.v1i8(<1 x i8> undef, <1 x i8> undef)
   %V3i8 = call <3 x i8> @llvm.umin.v3i8(<3 x i8> undef, <3 x i8> undef)
   %V4i8 = call <4 x i8> @llvm.umin.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -41,8 +49,12 @@ define void @reduce_umin() {
   ret void
 }
 
-define void @reduce_umax() {
-; CHECK-LABEL: 'reduce_umax'
+define void @umax() {
+; CHECK-LABEL: 'umax'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i8 = call i8 @llvm.umax.i8(i8 undef, i8 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i16 = call i16 @llvm.umax.i16(i16 undef, i16 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i32 = call i32 @llvm.umax.i32(i32 undef, i32 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i64 = call i64 @llvm.umax.i64(i64 undef, i64 undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1i8 = call <1 x i8> @llvm.umax.v1i8(<1 x i8> undef, <1 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V3i8 = call <3 x i8> @llvm.umax.v3i8(<3 x i8> undef, <3 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4i8 = call <4 x i8> @llvm.umax.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -61,6 +73,10 @@ define void @reduce_umax() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call <4 x i64> @llvm.umax.v4i64(<4 x i64> undef, <4 x i64> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %i8 = call i8 @llvm.umax.i8(i8 undef, i8 undef)
+  %i16 = call i16 @llvm.umax.i16(i16 undef, i16 undef)
+  %i32 = call i32 @llvm.umax.i32(i32 undef, i32 undef)
+  %i64 = call i64 @llvm.umax.i64(i64 undef, i64 undef)
   %V1i8 = call <1 x i8> @llvm.umax.v1i8(<1 x i8> undef, <1 x i8> undef)
   %V3i8 = call <3 x i8> @llvm.umax.v3i8(<3 x i8> undef, <3 x i8> undef)
   %V4i8 = call <4 x i8> @llvm.umax.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -80,8 +96,12 @@ define void @reduce_umax() {
   ret void
 }
 
-define void @reduce_smin() {
-; CHECK-LABEL: 'reduce_smin'
+define void @smin() {
+; CHECK-LABEL: 'smin'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i8 = call i8 @llvm.smin.i8(i8 undef, i8 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i16 = call i16 @llvm.smin.i16(i16 undef, i16 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i32 = call i32 @llvm.smin.i32(i32 undef, i32 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i64 = call i64 @llvm.smin.i64(i64 undef, i64 undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1i8 = call <1 x i8> @llvm.smin.v1i8(<1 x i8> undef, <1 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V3i8 = call <3 x i8> @llvm.smin.v3i8(<3 x i8> undef, <3 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4i8 = call <4 x i8> @llvm.smin.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -100,6 +120,10 @@ define void @reduce_smin() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call <4 x i64> @llvm.smin.v4i64(<4 x i64> undef, <4 x i64> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %i8 = call i8 @llvm.smin.i8(i8 undef, i8 undef)
+  %i16 = call i16 @llvm.smin.i16(i16 undef, i16 undef)
+  %i32 = call i32 @llvm.smin.i32(i32 undef, i32 undef)
+  %i64 = call i64 @llvm.smin.i64(i64 undef, i64 undef)
   %V1i8 = call <1 x i8> @llvm.smin.v1i8(<1 x i8> undef, <1 x i8> undef)
   %V3i8 = call <3 x i8> @llvm.smin.v3i8(<3 x i8> undef, <3 x i8> undef)
   %V4i8 = call <4 x i8> @llvm.smin.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -119,8 +143,12 @@ define void @reduce_smin() {
   ret void
 }
 
-define void @reduce_smax() {
-; CHECK-LABEL: 'reduce_smax'
+define void @smax() {
+; CHECK-LABEL: 'smax'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i8 = call i8 @llvm.smax.i8(i8 undef, i8 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i16 = call i16 @llvm.smax.i16(i16 undef, i16 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i32 = call i32 @llvm.smax.i32(i32 undef, i32 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %i64 = call i64 @llvm.smax.i64(i64 undef, i64 undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1i8 = call <1 x i8> @llvm.smax.v1i8(<1 x i8> undef, <1 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V3i8 = call <3 x i8> @llvm.smax.v3i8(<3 x i8> undef, <3 x i8> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4i8 = call <4 x i8> @llvm.smax.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -139,6 +167,10 @@ define void @reduce_smax() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call <4 x i64> @llvm.smax.v4i64(<4 x i64> undef, <4 x i64> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %i8 = call i8 @llvm.smax.i8(i8 undef, i8 undef)
+  %i16 = call i16 @llvm.smax.i16(i16 undef, i16 undef)
+  %i32 = call i32 @llvm.smax.i32(i32 undef, i32 undef)
+  %i64 = call i64 @llvm.smax.i64(i64 undef, i64 undef)
   %V1i8 = call <1 x i8> @llvm.smax.v1i8(<1 x i8> undef, <1 x i8> undef)
   %V3i8 = call <3 x i8> @llvm.smax.v3i8(<3 x i8> undef, <3 x i8> undef)
   %V4i8 = call <4 x i8> @llvm.smax.v4i8(<4 x i8> undef, <4 x i8> undef)
@@ -158,21 +190,24 @@ define void @reduce_smax() {
   ret void
 }
 
-define void @reduce_minnum16() {
-; CHECK-NOF16-LABEL: 'reduce_minnum16'
+define void @minnum16() {
+; CHECK-NOF16-LABEL: 'minnum16'
+; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.minnum.f16(half undef, half undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V2f16 = call <2 x half> @llvm.minnum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V4f16 = call <4 x half> @llvm.minnum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %V8f16 = call <8 x half> @llvm.minnum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %V16f16 = call <16 x half> @llvm.minnum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
-; CHECK-F16-LABEL: 'reduce_minnum16'
+; CHECK-F16-LABEL: 'minnum16'
+; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.minnum.f16(half undef, half undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f16 = call <2 x half> @llvm.minnum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f16 = call <4 x half> @llvm.minnum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8f16 = call <8 x half> @llvm.minnum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call <16 x half> @llvm.minnum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f16 = call half @llvm.minnum.f16(half undef, half undef)
   %V2f16 = call <2 x half> @llvm.minnum.v2f16(<2 x half> undef, <2 x half> undef)
   %V4f16 = call <4 x half> @llvm.minnum.v4f16(<4 x half> undef, <4 x half> undef)
   %V8f16 = call <8 x half> @llvm.minnum.v8f16(<8 x half> undef, <8 x half> undef)
@@ -180,21 +215,24 @@ define void @reduce_minnum16() {
   ret void
 }
 
-define void @reduce_maxnum16() {
-; CHECK-NOF16-LABEL: 'reduce_maxnum16'
+define void @maxnum16() {
+; CHECK-NOF16-LABEL: 'maxnum16'
+; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.maxnum.f16(half undef, half undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V2f16 = call <2 x half> @llvm.maxnum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V4f16 = call <4 x half> @llvm.maxnum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %V8f16 = call <8 x half> @llvm.maxnum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %V16f16 = call <16 x half> @llvm.maxnum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
-; CHECK-F16-LABEL: 'reduce_maxnum16'
+; CHECK-F16-LABEL: 'maxnum16'
+; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.maxnum.f16(half undef, half undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f16 = call <2 x half> @llvm.maxnum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f16 = call <4 x half> @llvm.maxnum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8f16 = call <8 x half> @llvm.maxnum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call <16 x half> @llvm.maxnum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f16 = call half @llvm.maxnum.f16(half undef, half undef)
   %V2f16 = call <2 x half> @llvm.maxnum.v2f16(<2 x half> undef, <2 x half> undef)
   %V4f16 = call <4 x half> @llvm.maxnum.v4f16(<4 x half> undef, <4 x half> undef)
   %V8f16 = call <8 x half> @llvm.maxnum.v8f16(<8 x half> undef, <8 x half> undef)
@@ -202,8 +240,10 @@ define void @reduce_maxnum16() {
   ret void
 }
 
-define void @reduce_minnum() {
-; CHECK-LABEL: 'reduce_minnum'
+define void @minnum() {
+; CHECK-LABEL: 'minnum'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f32 = call float @llvm.minnum.f32(float undef, float undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.minnum.f64(double undef, double undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f32 = call <2 x float> @llvm.minnum.v2f32(<2 x float> undef, <2 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f32 = call <4 x float> @llvm.minnum.v4f32(<4 x float> undef, <4 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call <8 x float> @llvm.minnum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -211,6 +251,8 @@ define void @reduce_minnum() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call <4 x double> @llvm.minnum.v4f64(<4 x double> undef, <4 x double> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f32 = call float @llvm.minnum.f32(float undef, float undef)
+  %f64 = call double @llvm.minnum.f64(double undef, double undef)
   %V2f32 = call <2 x float> @llvm.minnum.v2f32(<2 x float> undef, <2 x float> undef)
   %V4f32 = call <4 x float> @llvm.minnum.v4f32(<4 x float> undef, <4 x float> undef)
   %V8f32 = call <8 x float> @llvm.minnum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -219,8 +261,10 @@ define void @reduce_minnum() {
   ret void
 }
 
-define void @reduce_maxnum() {
-; CHECK-LABEL: 'reduce_maxnum'
+define void @maxnum() {
+; CHECK-LABEL: 'maxnum'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f32 = call float @llvm.maxnum.f32(float undef, float undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.maxnum.f64(double undef, double undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f32 = call <2 x float> @llvm.maxnum.v2f32(<2 x float> undef, <2 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f32 = call <4 x float> @llvm.maxnum.v4f32(<4 x float> undef, <4 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call <8 x float> @llvm.maxnum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -228,6 +272,8 @@ define void @reduce_maxnum() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call <4 x double> @llvm.maxnum.v4f64(<4 x double> undef, <4 x double> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f32 = call float @llvm.maxnum.f32(float undef, float undef)
+  %f64 = call double @llvm.maxnum.f64(double undef, double undef)
   %V2f32 = call <2 x float> @llvm.maxnum.v2f32(<2 x float> undef, <2 x float> undef)
   %V4f32 = call <4 x float> @llvm.maxnum.v4f32(<4 x float> undef, <4 x float> undef)
   %V8f32 = call <8 x float> @llvm.maxnum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -237,21 +283,24 @@ define void @reduce_maxnum() {
 }
 
 
-define void @reduce_minimum16() {
-; CHECK-NOF16-LABEL: 'reduce_minimum16'
+define void @minimum16() {
+; CHECK-NOF16-LABEL: 'minimum16'
+; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.minimum.f16(half undef, half undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V2f16 = call <2 x half> @llvm.minimum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V4f16 = call <4 x half> @llvm.minimum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %V8f16 = call <8 x half> @llvm.minimum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %V16f16 = call <16 x half> @llvm.minimum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
-; CHECK-F16-LABEL: 'reduce_minimum16'
+; CHECK-F16-LABEL: 'minimum16'
+; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.minimum.f16(half undef, half undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f16 = call <2 x half> @llvm.minimum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f16 = call <4 x half> @llvm.minimum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8f16 = call <8 x half> @llvm.minimum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call <16 x half> @llvm.minimum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f16 = call half @llvm.minimum.f16(half undef, half undef)
   %V2f16 = call <2 x half> @llvm.minimum.v2f16(<2 x half> undef, <2 x half> undef)
   %V4f16 = call <4 x half> @llvm.minimum.v4f16(<4 x half> undef, <4 x half> undef)
   %V8f16 = call <8 x half> @llvm.minimum.v8f16(<8 x half> undef, <8 x half> undef)
@@ -259,21 +308,24 @@ define void @reduce_minimum16() {
   ret void
 }
 
-define void @reduce_maximum16() {
-; CHECK-NOF16-LABEL: 'reduce_maximum16'
+define void @maximum16() {
+; CHECK-NOF16-LABEL: 'maximum16'
+; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.maximum.f16(half undef, half undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V2f16 = call <2 x half> @llvm.maximum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V4f16 = call <4 x half> @llvm.maximum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %V8f16 = call <8 x half> @llvm.maximum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %V16f16 = call <16 x half> @llvm.maximum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-NOF16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
-; CHECK-F16-LABEL: 'reduce_maximum16'
+; CHECK-F16-LABEL: 'maximum16'
+; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.maximum.f16(half undef, half undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f16 = call <2 x half> @llvm.maximum.v2f16(<2 x half> undef, <2 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f16 = call <4 x half> @llvm.maximum.v4f16(<4 x half> undef, <4 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V8f16 = call <8 x half> @llvm.maximum.v8f16(<8 x half> undef, <8 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call <16 x half> @llvm.maximum.v16f16(<16 x half> undef, <16 x half> undef)
 ; CHECK-F16-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f16 = call half @llvm.maximum.f16(half undef, half undef)
   %V2f16 = call <2 x half> @llvm.maximum.v2f16(<2 x half> undef, <2 x half> undef)
   %V4f16 = call <4 x half> @llvm.maximum.v4f16(<4 x half> undef, <4 x half> undef)
   %V8f16 = call <8 x half> @llvm.maximum.v8f16(<8 x half> undef, <8 x half> undef)
@@ -281,8 +333,10 @@ define void @reduce_maximum16() {
   ret void
 }
 
-define void @reduce_minimum() {
-; CHECK-LABEL: 'reduce_minimum'
+define void @minimum() {
+; CHECK-LABEL: 'minimum'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f32 = call float @llvm.minimum.f32(float undef, float undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.minimum.f64(double undef, double undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f32 = call <2 x float> @llvm.minimum.v2f32(<2 x float> undef, <2 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f32 = call <4 x float> @llvm.minimum.v4f32(<4 x float> undef, <4 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call <8 x float> @llvm.minimum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -290,6 +344,8 @@ define void @reduce_minimum() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call <4 x double> @llvm.minimum.v4f64(<4 x double> undef, <4 x double> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f32 = call float @llvm.minimum.f32(float undef, float undef)
+  %f64 = call double @llvm.minimum.f64(double undef, double undef)
   %V2f32 = call <2 x float> @llvm.minimum.v2f32(<2 x float> undef, <2 x float> undef)
   %V4f32 = call <4 x float> @llvm.minimum.v4f32(<4 x float> undef, <4 x float> undef)
   %V8f32 = call <8 x float> @llvm.minimum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -298,8 +354,10 @@ define void @reduce_minimum() {
   ret void
 }
 
-define void @reduce_maximum() {
-; CHECK-LABEL: 'reduce_maximum'
+define void @maximum() {
+; CHECK-LABEL: 'maximum'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f32 = call float @llvm.maximum.f32(float undef, float undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.maximum.f64(double undef, double undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2f32 = call <2 x float> @llvm.maximum.v2f32(<2 x float> undef, <2 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4f32 = call <4 x float> @llvm.maximum.v4f32(<4 x float> undef, <4 x float> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call <8 x float> @llvm.maximum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -307,6 +365,8 @@ define void @reduce_maximum() {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call <4 x double> @llvm.maximum.v4f64(<4 x double> undef, <4 x double> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
+  %f32 = call float @llvm.maximum.f32(float undef, float undef)
+  %f64 = call double @llvm.maximum.f64(double undef, double undef)
   %V2f32 = call <2 x float> @llvm.maximum.v2f32(<2 x float> undef, <2 x float> undef)
   %V4f32 = call <4 x float> @llvm.maximum.v4f32(<4 x float> undef, <4 x float> undef)
   %V8f32 = call <8 x float> @llvm.maximum.v8f32(<8 x float> undef, <8 x float> undef)
@@ -315,6 +375,10 @@ define void @reduce_maximum() {
   ret void
 }
 
+declare i8 @llvm.umin.i8(i8, i8)
+declare i16 @llvm.umin.i16(i16, i16)
+declare i32 @llvm.umin.i32(i32, i32)
+declare i64 @llvm.umin.i64(i64, i64)
 declare <1 x i8> @llvm.umin.v1i8(<1 x i8>, <1 x i8>)
 declare <3 x i8> @llvm.umin.v3i8(<3 x i8>, <3 x i8>)
 declare <4 x i8> @llvm.umin.v4i8(<4 x i8>, <4 x i8>)
@@ -332,6 +396,10 @@ declare <8 x i32> @llvm.umin.v8i32(<8 x i32>, <8 x i32>)
 declare <2 x i64> @llvm.umin.v2i64(<2 x i64>, <2 x i64>)
 declare <4 x i64> @llvm.umin.v4i64(<4 x i64>, <4 x i64>)
 
+declare i8 @llvm.umax.i8(i8, i8)
+declare i16 @llvm.umax.i16(i16, i16)
+declare i32 @llvm.umax.i32(i32, i32)
+declare i64 @llvm.umax.i64(i64, i64)
 declare <1 x i8> @llvm.umax.v1i8(<1 x i8>, <1 x i8>)
 declare <3 x i8> @llvm.umax.v3i8(<3 x i8>, <3 x i8>)
 declare <4 x i8> @llvm.umax.v4i8(<4 x i8>, <4 x i8>)
@@ -349,6 +417,10 @@ declare <8 x i32> @llvm.umax.v8i32(<8 x i32>, <8 x i32>)
 declare <2 x i64> @llvm.umax.v2i64(<2 x i64>, <2 x i64>)
 declare <4 x i64> @llvm.umax.v4i64(<4 x i64>, <4 x i64>)
 
+declare i8 @llvm.smin.i8(i8, i8)
+declare i16 @llvm.smin.i16(i16, i16)
+declare i32 @llvm.smin.i32(i32, i32)
+declare i64 @llvm.smin.i64(i64, i64)
 declare <1 x i8> @llvm.smin.v1i8(<1 x i8>, <1 x i8>)
 declare <3 x i8> @llvm.smin.v3i8(<3 x i8>, <3 x i8>)
 declare <4 x i8> @llvm.smin.v4i8(<4 x i8>, <4 x i8>)
@@ -366,6 +438,10 @@ declare <8 x i32> @llvm.smin.v8i32(<8 x i32>, <8 x i32>)
 declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>)
 declare <4 x i64> @llvm.smin.v4i64(<4 x i64>, <4 x i64>)
 
+declare i8 @llvm.smax.i8(i8, i8)
+declare i16 @llvm.smax.i16(i16, i16)
+declare i32 @llvm.smax.i32(i32, i32)
+declare i64 @llvm.smax.i64(i64, i64)
 declare <1 x i8> @llvm.smax.v1i8(<1 x i8>, <1 x i8>)
 declare <3 x i8> @llvm.smax.v3i8(<3 x i8>, <3 x i8>)
 declare <4 x i8> @llvm.smax.v4i8(<4 x i8>, <4 x i8>)
@@ -383,6 +459,9 @@ declare <8 x i32> @llvm.smax.v8i32(<8 x i32>, <8 x i32>)
 declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>)
 declare <4 x i64> @llvm.smax.v4i64(<4 x i64>, <4 x i64>)
 
+declare half @llvm.minnum.f16(half, half)
+declare float @llvm.minnum.f32(float, float)
+declare double @llvm.minnum.f64(double, double)
 declare <2 x half> @llvm.minnum.v2f16(<2 x half>, <2 x half>)
 declare <4 x half> @llvm.minnum.v4f16(<4 x half>, <4 x half>)
 declare <8 x half> @llvm.minnum.v8f16(<8 x half>, <8 x half>)
@@ -393,6 +472,9 @@ declare <8 x float> @llvm.minnum.v8f32(<8 x float>, <8 x float>)
 declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
 declare <4 x double> @llvm.minnum.v4f64(<4 x double>, <4 x double>)
 
+declare half @llvm.maxnum.f16(half, half)
+declare float @llvm.maxnum.f32(float, float)
+declare double @llvm.maxnum.f64(double, double)
 declare <2 x half> @llvm.maxnum.v2f16(<2 x half>, <2 x half>)
 declare <4 x half> @llvm.maxnum.v4f16(<4 x half>, <4 x half>)
 declare <8 x half> @llvm.maxnum.v8f16(<8 x half>, <8 x half>)
@@ -403,6 +485,9 @@ declare <8 x float> @llvm.maxnum.v8f32(<8 x float>, <8 x float>)
 declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
 declare <4 x double> @llvm.maxnum.v4f64(<4 x double>, <4 x double>)
 
+declare half @llvm.minimum.f16(half, half)
+declare float @llvm.minimum.f32(float, float)
+declare double @llvm.minimum.f64(double, double)
 declare <2 x half> @llvm.minimum.v2f16(<2 x half>, <2 x half>)
 declare <4 x half> @llvm.minimum.v4f16(<4 x half>, <4 x half>)
 declare <8 x half> @llvm.minimum.v8f16(<8 x half>, <8 x half>)
@@ -413,6 +498,9 @@ declare <8 x float> @llvm.minimum.v8f32(<8 x float>, <8 x float>)
 declare <2 x double> @llvm.minimum.v2f64(<2 x double>, <2 x double>)
 declare <4 x double> @llvm.minimum.v4f64(<4 x double>, <4 x double>)
 
+declare half @llvm.maximum.f16(half, half)
+declare float @llvm.maximum.f32(float, float)
+declare double @llvm.maximum.f64(double, double)
 declare <2 x half> @llvm.maximum.v2f16(<2 x half>, <2 x half>)
 declare <4 x half> @llvm.maximum.v4f16(<4 x half>, <4 x half>)
 declare <8 x half> @llvm.maximum.v8f16(<8 x half>, <8 x half>)


        


More information about the llvm-commits mailing list