[llvm] 1c8283a - [BasicTTIImpl] Add cost entries for ldexp, [l]lround (#146373)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 01:26:34 PDT 2025
Author: Ramkumar Ramachandra
Date: 2025-07-07T09:26:30+01:00
New Revision: 1c8283a30c6e87640510f523dfc244bd9d2b991a
URL: https://github.com/llvm/llvm-project/commit/1c8283a30c6e87640510f523dfc244bd9d2b991a
DIFF: https://github.com/llvm/llvm-project/commit/1c8283a30c6e87640510f523dfc244bd9d2b991a.diff
LOG: [BasicTTIImpl] Add cost entries for ldexp, [l]lround (#146373)
The ldexp intrinsic is incorrectly costed as 1, due to a missing entry
in BasicTTIImpl::getTypeBasedIntrinsicCost: fix this. While at it, fix
missing entries for [l]lround, which is costed as 1 anyway, making the
change non-functional.
Added:
Modified:
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/test/Analysis/CostModel/AArch64/ldexp.ll
llvm/test/Analysis/CostModel/AMDGPU/ldexp.ll
llvm/test/Analysis/CostModel/RISCV/exp.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index bf958e100f2ac..2b9be43eadb7a 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -2243,6 +2243,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
case Intrinsic::log2:
ISD = ISD::FLOG2;
break;
+ case Intrinsic::ldexp:
+ ISD = ISD::FLDEXP;
+ break;
case Intrinsic::fabs:
ISD = ISD::FABS;
break;
@@ -2297,6 +2300,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
case Intrinsic::roundeven:
ISD = ISD::FROUNDEVEN;
break;
+ case Intrinsic::lround:
+ ISD = ISD::LROUND;
+ break;
+ case Intrinsic::llround:
+ ISD = ISD::LLROUND;
+ break;
case Intrinsic::pow:
ISD = ISD::FPOW;
break;
diff --git a/llvm/test/Analysis/CostModel/AArch64/ldexp.ll b/llvm/test/Analysis/CostModel/AArch64/ldexp.ll
index 5668416c15641..8cc8657468930 100644
--- a/llvm/test/Analysis/CostModel/AArch64/ldexp.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/ldexp.ll
@@ -6,18 +6,31 @@ target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-linux-gnu"
define void @ldexp() {
-; CHECK-LABEL: 'ldexp'
-; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = call float @llvm.ldexp.f32.i32(float poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:20 CodeSize:14 Lat:20 SizeLat:20 for: %4 = call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:40 CodeSize:28 Lat:40 SizeLat:40 for: %5 = call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of 1 for: %6 = call double @llvm.ldexp.f64.i32(double poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %7 = call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:8 CodeSize:6 Lat:8 SizeLat:8 for: %8 = call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:16 CodeSize:12 Lat:16 SizeLat:16 for: %9 = call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:32 CodeSize:24 Lat:32 SizeLat:32 for: %10 = call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
+; CHECK-BASE-LABEL: 'ldexp'
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:10 SizeLat:10 for: %1 = call float @llvm.ldexp.f32.i32(float poison, i32 poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:22 CodeSize:3 Lat:22 SizeLat:22 for: %2 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:46 CodeSize:7 Lat:46 SizeLat:46 for: %3 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:92 CodeSize:14 Lat:92 SizeLat:92 for: %4 = call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:184 CodeSize:28 Lat:184 SizeLat:184 for: %5 = call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:10 SizeLat:10 for: %6 = call double @llvm.ldexp.f64.i32(double poison, i32 poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:22 CodeSize:3 Lat:22 SizeLat:22 for: %7 = call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:44 CodeSize:6 Lat:44 SizeLat:44 for: %8 = call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:88 CodeSize:12 Lat:88 SizeLat:88 for: %9 = call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:176 CodeSize:24 Lat:176 SizeLat:176 for: %10 = call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
+;
+; CHECK-SVE-LABEL: 'ldexp'
+; CHECK-SVE-NEXT: Cost Model: Found costs of 2 for: %1 = call float @llvm.ldexp.f32.i32(float poison, i32 poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:6 CodeSize:5 Lat:6 SizeLat:6 for: %2 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:14 CodeSize:11 Lat:14 SizeLat:14 for: %3 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:28 CodeSize:22 Lat:28 SizeLat:28 for: %4 = call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:56 CodeSize:44 Lat:56 SizeLat:56 for: %5 = call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of 2 for: %6 = call double @llvm.ldexp.f64.i32(double poison, i32 poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:6 CodeSize:5 Lat:6 SizeLat:6 for: %7 = call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:12 CodeSize:10 Lat:12 SizeLat:12 for: %8 = call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:24 CodeSize:20 Lat:24 SizeLat:24 for: %9 = call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:48 CodeSize:40 Lat:48 SizeLat:48 for: %10 = call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
call float @llvm.ldexp.f32.i32(float poison, i32 poison)
call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison)
@@ -33,13 +46,21 @@ define void @ldexp() {
}
define void @ldexp_fp16() {
-; CHECK-LABEL: 'ldexp_fp16'
-; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = call half @llvm.ldexp.f16.i32(half poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:22 CodeSize:15 Lat:22 SizeLat:22 for: %4 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:44 CodeSize:30 Lat:44 SizeLat:44 for: %5 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> poison, <16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
+; CHECK-BASE-LABEL: 'ldexp_fp16'
+; CHECK-BASE-NEXT: Cost Model: Found costs of 1 for: %1 = call half @llvm.ldexp.f16.i32(half poison, i32 poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> poison, <2 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> poison, <4 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:22 CodeSize:15 Lat:22 SizeLat:22 for: %4 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> poison, <8 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:44 CodeSize:30 Lat:44 SizeLat:44 for: %5 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> poison, <16 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
+;
+; CHECK-SVE-LABEL: 'ldexp_fp16'
+; CHECK-SVE-NEXT: Cost Model: Found costs of 2 for: %1 = call half @llvm.ldexp.f16.i32(half poison, i32 poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:6 CodeSize:5 Lat:6 SizeLat:6 for: %2 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> poison, <2 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:14 CodeSize:11 Lat:14 SizeLat:14 for: %3 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> poison, <4 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:30 CodeSize:23 Lat:30 SizeLat:30 for: %4 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> poison, <8 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:60 CodeSize:46 Lat:60 SizeLat:60 for: %5 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> poison, <16 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
call half @llvm.ldexp.f16.i32(half poison, i32 poison)
call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> poison, <2 x i32> poison)
@@ -50,13 +71,21 @@ define void @ldexp_fp16() {
}
define void @ldexp_bf16() {
-; CHECK-LABEL: 'ldexp_bf16'
-; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:22 CodeSize:15 Lat:22 SizeLat:22 for: %4 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:44 CodeSize:30 Lat:44 SizeLat:44 for: %5 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
+; CHECK-BASE-LABEL: 'ldexp_bf16'
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:10 CodeSize:1 Lat:10 SizeLat:10 for: %1 = call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:22 CodeSize:3 Lat:22 SizeLat:22 for: %2 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:46 CodeSize:7 Lat:46 SizeLat:46 for: %3 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:94 CodeSize:15 Lat:94 SizeLat:94 for: %4 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:188 CodeSize:30 Lat:188 SizeLat:188 for: %5 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison)
+; CHECK-BASE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
+;
+; CHECK-SVE-LABEL: 'ldexp_bf16'
+; CHECK-SVE-NEXT: Cost Model: Found costs of 2 for: %1 = call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:6 CodeSize:5 Lat:6 SizeLat:6 for: %2 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:14 CodeSize:11 Lat:14 SizeLat:14 for: %3 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:30 CodeSize:23 Lat:30 SizeLat:30 for: %4 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:60 CodeSize:46 Lat:60 SizeLat:60 for: %5 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison)
+; CHECK-SVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison)
call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison)
@@ -66,5 +95,4 @@ define void @ldexp_bf16() {
ret void
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; CHECK-BASE: {{.*}}
-; CHECK-SVE: {{.*}}
+; CHECK: {{.*}}
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/ldexp.ll b/llvm/test/Analysis/CostModel/AMDGPU/ldexp.ll
index 2b1b5906ad017..260cf696270cd 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/ldexp.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/ldexp.ll
@@ -13,45 +13,45 @@ define void @ldexp_f16_i32() {
; GFX7-LABEL: 'ldexp_f16_i32'
; GFX7-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> undef, <2 x i32> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> undef, <4 x i32> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> undef, <8 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> undef, <16 x i32> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX8PLUS-LABEL: 'ldexp_f16_i32'
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> undef, <2 x i32> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> undef, <4 x i32> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> undef, <8 x i32> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> undef, <16 x i32> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> undef, <2 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> undef, <4 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> undef, <8 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> undef, <16 x i32> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX7-SIZE-LABEL: 'ldexp_f16_i32'
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> undef, <2 x i32> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> undef, <4 x i32> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> undef, <8 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> undef, <16 x i32> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; GFX8PLUS-SIZE-LABEL: 'ldexp_f16_i32'
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> undef, <2 x i32> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> undef, <4 x i32> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> undef, <8 x i32> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> undef, <16 x i32> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> undef, <2 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> undef, <3 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> undef, <4 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i32(<5 x half> undef, <5 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> undef, <8 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> undef, <16 x i32> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i32(<17 x half> undef, <17 x i32> undef)
; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
%f16 = call half @llvm.ldexp.f16.i32(half undef, i32 undef)
@@ -69,45 +69,45 @@ define void @ldexp_f16_i16() {
; GFX7-LABEL: 'ldexp_f16_i16'
; GFX7-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i16(<2 x half> undef, <2 x i16> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i16(<4 x half> undef, <4 x i16> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i16(<8 x half> undef, <8 x i16> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i16(<16 x half> undef, <16 x i16> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX8PLUS-LABEL: 'ldexp_f16_i16'
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i16(<2 x half> undef, <2 x i16> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i16(<4 x half> undef, <4 x i16> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i16(<8 x half> undef, <8 x i16> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i16(<16 x half> undef, <16 x i16> undef)
-; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i16(<2 x half> undef, <2 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i16(<4 x half> undef, <4 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i16(<8 x half> undef, <8 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i16(<16 x half> undef, <16 x i16> undef)
+; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
; GFX8PLUS-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX7-SIZE-LABEL: 'ldexp_f16_i16'
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i16(<2 x half> undef, <2 x i16> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i16(<4 x half> undef, <4 x i16> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i16(<8 x half> undef, <8 x i16> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i16(<16 x half> undef, <16 x i16> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; GFX8PLUS-SIZE-LABEL: 'ldexp_f16_i16'
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i16(<2 x half> undef, <2 x i16> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i16(<4 x half> undef, <4 x i16> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i16(<8 x half> undef, <8 x i16> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i16(<16 x half> undef, <16 x i16> undef)
-; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.ldexp.v2f16.v2i16(<2 x half> undef, <2 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.ldexp.v3f16.v3i16(<3 x half> undef, <3 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.ldexp.v4f16.v4i16(<4 x half> undef, <4 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.ldexp.v5f16.v5i16(<5 x half> undef, <5 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.ldexp.v8f16.v8i16(<8 x half> undef, <8 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.ldexp.v16f16.v16i16(<16 x half> undef, <16 x i16> undef)
+; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.ldexp.v17f16.v17i16(<17 x half> undef, <17 x i16> undef)
; GFX8PLUS-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
%f16 = call half @llvm.ldexp.f16.i16(half undef, i16 undef)
@@ -125,12 +125,12 @@ define void @ldexp_bf16() {
; GFX7-LABEL: 'ldexp_bf16'
; GFX7-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.ldexp.bf16.i32(bfloat undef, i32 undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> undef, <2 x i32> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v3bf16 = call <3 x bfloat> @llvm.ldexp.v3bf16.v3i32(<3 x bfloat> undef, <3 x i32> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.ldexp.v3bf16.v3i32(<3 x bfloat> undef, <3 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> undef, <4 x i32> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %v5bf16 = call <5 x bfloat> @llvm.ldexp.v5bf16.v5i32(<5 x bfloat> undef, <5 x i32> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.ldexp.v5bf16.v5i32(<5 x bfloat> undef, <5 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> undef, <8 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> undef, <16 x i32> undef)
-; GFX7-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v17bf16 = call <17 x bfloat> @llvm.ldexp.v17bf16.v17i32(<17 x bfloat> undef, <17 x i32> undef)
+; GFX7-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.ldexp.v17bf16.v17i32(<17 x bfloat> undef, <17 x i32> undef)
; GFX7-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX8PLUS-LABEL: 'ldexp_bf16'
@@ -147,12 +147,12 @@ define void @ldexp_bf16() {
; GFX7-SIZE-LABEL: 'ldexp_bf16'
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.ldexp.bf16.i32(bfloat undef, i32 undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> undef, <2 x i32> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %v3bf16 = call <3 x bfloat> @llvm.ldexp.v3bf16.v3i32(<3 x bfloat> undef, <3 x i32> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.ldexp.v3bf16.v3i32(<3 x bfloat> undef, <3 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> undef, <4 x i32> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %v5bf16 = call <5 x bfloat> @llvm.ldexp.v5bf16.v5i32(<5 x bfloat> undef, <5 x i32> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.ldexp.v5bf16.v5i32(<5 x bfloat> undef, <5 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> undef, <8 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> undef, <16 x i32> undef)
-; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %v17bf16 = call <17 x bfloat> @llvm.ldexp.v17bf16.v17i32(<17 x bfloat> undef, <17 x i32> undef)
+; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.ldexp.v17bf16.v17i32(<17 x bfloat> undef, <17 x i32> undef)
; GFX7-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; GFX8PLUS-SIZE-LABEL: 'ldexp_bf16'
diff --git a/llvm/test/Analysis/CostModel/RISCV/exp.ll b/llvm/test/Analysis/CostModel/RISCV/exp.ll
index fa7a9451f567a..55c3f5554eff0 100644
--- a/llvm/test/Analysis/CostModel/RISCV/exp.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/exp.ll
@@ -3,51 +3,51 @@
define void @ldexp() {
; CHECK-LABEL: 'ldexp'
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %2 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %3 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %4 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %5 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %1 = call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %2 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %3 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %4 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %5 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %6 = call <vscale x 1 x bfloat> @llvm.ldexp.nxv1bf16.nxv1i32(<vscale x 1 x bfloat> poison, <vscale x 1 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %7 = call <vscale x 2 x bfloat> @llvm.ldexp.nxv2bf16.nxv2i32(<vscale x 2 x bfloat> poison, <vscale x 2 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %8 = call <vscale x 4 x bfloat> @llvm.ldexp.nxv4bf16.nxv4i32(<vscale x 4 x bfloat> poison, <vscale x 4 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %9 = call <vscale x 8 x bfloat> @llvm.ldexp.nxv8bf16.nxv8i32(<vscale x 8 x bfloat> poison, <vscale x 8 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %10 = call <vscale x 16 x bfloat> @llvm.ldexp.nxv16bf16.nxv16i32(<vscale x 16 x bfloat> poison, <vscale x 16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call float @llvm.ldexp.f32.i32(float poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %12 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %13 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %14 = call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %15 = call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %11 = call float @llvm.ldexp.f32.i32(float poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %12 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %13 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %14 = call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %15 = call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %16 = call <vscale x 1 x float> @llvm.ldexp.nxv1f32.nxv1i32(<vscale x 1 x float> poison, <vscale x 1 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %17 = call <vscale x 2 x float> @llvm.ldexp.nxv2f32.nxv2i32(<vscale x 2 x float> poison, <vscale x 2 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %18 = call <vscale x 4 x float> @llvm.ldexp.nxv4f32.nxv4i32(<vscale x 4 x float> poison, <vscale x 4 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %19 = call <vscale x 8 x float> @llvm.ldexp.nxv8f32.nxv8i32(<vscale x 8 x float> poison, <vscale x 8 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %20 = call <vscale x 16 x float> @llvm.ldexp.nxv16f32.nxv16i32(<vscale x 16 x float> poison, <vscale x 16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = call double @llvm.ldexp.f64.i32(double poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %22 = call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %23 = call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %24 = call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %25 = call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %21 = call double @llvm.ldexp.f64.i32(double poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %22 = call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %23 = call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %24 = call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %25 = call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %26 = call <vscale x 1 x double> @llvm.ldexp.nxv1f64.nxv1i32(<vscale x 1 x double> poison, <vscale x 1 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %27 = call <vscale x 2 x double> @llvm.ldexp.nxv2f64.nxv2i32(<vscale x 2 x double> poison, <vscale x 2 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %28 = call <vscale x 4 x double> @llvm.ldexp.nxv4f64.nxv4i32(<vscale x 4 x double> poison, <vscale x 4 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %29 = call <vscale x 8 x double> @llvm.ldexp.nxv8f64.nxv8i32(<vscale x 8 x double> poison, <vscale x 8 x i32> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %30 = call <vscale x 16 x double> @llvm.ldexp.nxv16f64.nxv16i32(<vscale x 16 x double> poison, <vscale x 16 x i32> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %31 = call float @llvm.ldexp.f32.i64(float poison, i64 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %32 = call <2 x float> @llvm.ldexp.v2f32.v2i64(<2 x float> poison, <2 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %33 = call <4 x float> @llvm.ldexp.v4f32.v4i64(<4 x float> poison, <4 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %34 = call <8 x float> @llvm.ldexp.v8f32.v8i64(<8 x float> poison, <8 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %35 = call <16 x float> @llvm.ldexp.v16f32.v16i64(<16 x float> poison, <16 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %31 = call float @llvm.ldexp.f32.i64(float poison, i64 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %32 = call <2 x float> @llvm.ldexp.v2f32.v2i64(<2 x float> poison, <2 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %33 = call <4 x float> @llvm.ldexp.v4f32.v4i64(<4 x float> poison, <4 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %34 = call <8 x float> @llvm.ldexp.v8f32.v8i64(<8 x float> poison, <8 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %35 = call <16 x float> @llvm.ldexp.v16f32.v16i64(<16 x float> poison, <16 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %36 = call <vscale x 1 x float> @llvm.ldexp.nxv1f32.nxv1i64(<vscale x 1 x float> poison, <vscale x 1 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %37 = call <vscale x 2 x float> @llvm.ldexp.nxv2f32.nxv2i64(<vscale x 2 x float> poison, <vscale x 2 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %38 = call <vscale x 4 x float> @llvm.ldexp.nxv4f32.nxv4i64(<vscale x 4 x float> poison, <vscale x 4 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %39 = call <vscale x 8 x float> @llvm.ldexp.nxv8f32.nxv8i64(<vscale x 8 x float> poison, <vscale x 8 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %40 = call <vscale x 16 x float> @llvm.ldexp.nxv16f32.nxv16i64(<vscale x 16 x float> poison, <vscale x 16 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %41 = call double @llvm.ldexp.f64.i64(double poison, i64 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %42 = call <2 x double> @llvm.ldexp.v2f64.v2i64(<2 x double> poison, <2 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %43 = call <4 x double> @llvm.ldexp.v4f64.v4i64(<4 x double> poison, <4 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %44 = call <8 x double> @llvm.ldexp.v8f64.v8i64(<8 x double> poison, <8 x i64> poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %45 = call <16 x double> @llvm.ldexp.v16f64.v16i64(<16 x double> poison, <16 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %41 = call double @llvm.ldexp.f64.i64(double poison, i64 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %42 = call <2 x double> @llvm.ldexp.v2f64.v2i64(<2 x double> poison, <2 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %43 = call <4 x double> @llvm.ldexp.v4f64.v4i64(<4 x double> poison, <4 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %44 = call <8 x double> @llvm.ldexp.v8f64.v8i64(<8 x double> poison, <8 x i64> poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %45 = call <16 x double> @llvm.ldexp.v16f64.v16i64(<16 x double> poison, <16 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %46 = call <vscale x 1 x double> @llvm.ldexp.nxv1f64.nxv1i64(<vscale x 1 x double> poison, <vscale x 1 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %47 = call <vscale x 2 x double> @llvm.ldexp.nxv2f64.nxv2i64(<vscale x 2 x double> poison, <vscale x 2 x i64> poison)
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %48 = call <vscale x 4 x double> @llvm.ldexp.nxv4f64.nxv4i64(<vscale x 4 x double> poison, <vscale x 4 x i64> poison)
More information about the llvm-commits
mailing list