[llvm] [AMDGPU][TTI] Update cost model for transcendental instructions to be more precise (PR #189430)

Chinmay Deshpande via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 09:56:21 PDT 2026


https://github.com/chinmaydd updated https://github.com/llvm/llvm-project/pull/189430

>From 36abd63d106fbfa3f34c6809b3404e7622fe2b38 Mon Sep 17 00:00:00 2001
From: Chinmay Deshpande <chdeshpa at amd.com>
Date: Thu, 26 Mar 2026 18:40:34 -0400
Subject: [PATCH] [AMDGPU] Update cost model for transcendental instructions to
 be more precise

---
 .../AMDGPU/AMDGPUTargetTransformInfo.cpp      |  93 ++-
 .../Target/AMDGPU/AMDGPUTargetTransformInfo.h |   2 +
 llvm/test/Analysis/CostModel/AMDGPU/log.ll    | 628 +++++++++++-------
 llvm/test/Analysis/CostModel/AMDGPU/log10.ll  | 628 +++++++++++-------
 llvm/test/Analysis/CostModel/AMDGPU/log2.ll   | 404 +++++------
 llvm/test/Analysis/CostModel/AMDGPU/sin.ll    | 340 +++++++---
 llvm/test/Analysis/CostModel/AMDGPU/sqrt.ll   | 436 ++++++------
 7 files changed, 1501 insertions(+), 1030 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index d02bc45bc14f6..5b2d29f495cb0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -641,7 +641,7 @@ InstructionCost GCNTTIImpl::getArithmeticInstrCost(
       // TODO: This is more complicated, unsafe flags etc.
       if ((SLT == MVT::f32 && !HasFP32Denormals) ||
           (SLT == MVT::f16 && ST->has16BitInsts())) {
-        return LT.first * getQuarterRateInstrCost(CostKind) * NElts;
+        return LT.first * getTransInstrCost(CostKind) * NElts;
       }
     }
 
@@ -651,8 +651,7 @@ InstructionCost GCNTTIImpl::getArithmeticInstrCost(
       // f32 fmul
       // v_cvt_f16_f32
       // f16 div_fixup
-      int Cost =
-          4 * getFullRateInstrCost() + 2 * getQuarterRateInstrCost(CostKind);
+      int Cost = 4 * getFullRateInstrCost() + 2 * getTransInstrCost(CostKind);
       return LT.first * Cost * NElts;
     }
 
@@ -660,14 +659,14 @@ InstructionCost GCNTTIImpl::getArithmeticInstrCost(
       // Fast unsafe fdiv lowering:
       // f32 rcp
       // f32 fmul
-      int Cost = getQuarterRateInstrCost(CostKind) + getFullRateInstrCost();
+      int Cost = getTransInstrCost(CostKind) + getFullRateInstrCost();
       return LT.first * Cost * NElts;
     }
 
     if (SLT == MVT::f32 || SLT == MVT::f16) {
       // 4 more v_cvt_* insts without f16 insts support
       int Cost = (SLT == MVT::f16 ? 14 : 10) * getFullRateInstrCost() +
-                 1 * getQuarterRateInstrCost(CostKind);
+                 1 * getTransInstrCost(CostKind);
 
       if (!HasFP32Denormals) {
         // FP mode switches.
@@ -764,8 +763,8 @@ GCNTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
 
     if (SLT == MVT::f32) {
       unsigned NumFullRateOps = 0;
-      // v_exp_f32 (quarter rate).
-      unsigned NumQuarterRateOps = 1;
+      // v_exp_f32 (transcendental).
+      unsigned NumTransOps = 1;
 
       if (!ICA.getFlags().approxFunc() && IID != Intrinsic::exp2) {
         // Non-AFN exp/exp10: range reduction + v_exp_f32 + ldexp +
@@ -779,16 +778,86 @@ GCNTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
         } else if (IID == Intrinsic::exp10) {
           // lowerFEXP10Unsafe: 3 fmul + 2 v_exp_f32 (double-exp2).
           NumFullRateOps = 3;
-          NumQuarterRateOps = 2;
+          NumTransOps = 2;
         }
         // Denorm scaling adds setcc + select + fadd + select + fmul.
         if (HasFP32Denormals)
           NumFullRateOps += 5;
       }
 
+      InstructionCost Cost = NumFullRateOps * getFullRateInstrCost() +
+                             NumTransOps * getTransInstrCost(CostKind);
+      return LT.first * NElts * Cost;
+    }
+
+    break;
+  }
+  case Intrinsic::log:
+  case Intrinsic::log2:
+  case Intrinsic::log10: {
+    std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(RetTy);
+    MVT::SimpleValueType SLT = LT.second.getScalarType().SimpleTy;
+    unsigned NElts =
+        LT.second.isVector() ? LT.second.getVectorNumElements() : 1;
+
+    if (SLT == MVT::f32) {
+      unsigned NumFullRateOps = 0;
+
+      if (IID == Intrinsic::log2) {
+        // LowerFLOG2: just v_log_f32.
+      } else if (ICA.getFlags().approxFunc()) {
+        // LowerFLOGUnsafe: v_log_f32 + fmul (base conversion).
+        NumFullRateOps = 1;
+      } else {
+        // LowerFLOGCommon non-AFN: v_log_f32 + extended-precision
+        // multiply + finite check.
+        NumFullRateOps = ST->hasFastFMAF32() ? 8 : 11;
+      }
+
+      if (HasFP32Denormals)
+        NumFullRateOps += 5;
+
+      InstructionCost Cost =
+          NumFullRateOps * getFullRateInstrCost() + getTransInstrCost(CostKind);
+      return LT.first * NElts * Cost;
+    }
+
+    break;
+  }
+  case Intrinsic::sin:
+  case Intrinsic::cos: {
+    std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(RetTy);
+    MVT::SimpleValueType SLT = LT.second.getScalarType().SimpleTy;
+    unsigned NElts =
+        LT.second.isVector() ? LT.second.getVectorNumElements() : 1;
+
+    if (SLT == MVT::f32) {
+      // LowerTrig: fmul(1/2pi) + v_sin/v_cos.
+      unsigned NumFullRateOps = ST->hasTrigReducedRange() ? 2 : 1;
+
+      InstructionCost Cost =
+          NumFullRateOps * getFullRateInstrCost() + getTransInstrCost(CostKind);
+      return LT.first * NElts * Cost;
+    }
+
+    break;
+  }
+  case Intrinsic::sqrt: {
+    std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(RetTy);
+    MVT::SimpleValueType SLT = LT.second.getScalarType().SimpleTy;
+    unsigned NElts =
+        LT.second.isVector() ? LT.second.getVectorNumElements() : 1;
+
+    if (SLT == MVT::f32) {
+      unsigned NumFullRateOps = 0;
+
+      if (!ICA.getFlags().approxFunc()) {
+        // lowerFSQRTF32 non-AFN: v_sqrt_f32 + refinement + scale fixup.
+        NumFullRateOps = HasFP32Denormals ? 17 : 16;
+      }
+
       InstructionCost Cost =
-          NumFullRateOps * getFullRateInstrCost() +
-          NumQuarterRateOps * getQuarterRateInstrCost(CostKind);
+          NumFullRateOps * getFullRateInstrCost() + getTransInstrCost(CostKind);
       return LT.first * NElts * Cost;
     }
 
@@ -1639,6 +1708,10 @@ void GCNTTIImpl::getPeelingPreferences(Loop *L, ScalarEvolution &SE,
   CommonTTI.getPeelingPreferences(L, SE, PP);
 }
 
+int GCNTTIImpl::getTransInstrCost(TTI::TargetCostKind CostKind) const {
+  return getQuarterRateInstrCost(CostKind);
+}
+
 int GCNTTIImpl::get64BitInstrCost(TTI::TargetCostKind CostKind) const {
   return ST->hasFullRate64Ops()
              ? getFullRateInstrCost()
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
index ea2bf72836199..727cf966b5d8d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
@@ -95,6 +95,8 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
                                          : 4 * TargetTransformInfo::TCC_Basic;
   }
 
+  int getTransInstrCost(TTI::TargetCostKind CostKind) const;
+
   // On some parts, normal fp64 operations are half rate, and others
   // quarter. This also applies to some integer operations.
   int get64BitInstrCost(TTI::TargetCostKind CostKind) const;
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/log.ll b/llvm/test/Analysis/CostModel/AMDGPU/log.ll
index 28d0123f34400..8791772caeb3e 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/log.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/log.ll
@@ -11,293 +11,359 @@
 
 define void @log_f16() {
 ; BASE-LABEL: 'log_f16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 320 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 680 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'log_f16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'log_f16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'log_f16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'log_f16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 612 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'log_f16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'log_f16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'log_f16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log.f16(half poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f16 = call half @llvm.log.f16(half undef)
-  %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> undef)
-  %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> undef)
-  %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> undef)
-  %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> undef)
-  %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> undef)
-  %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> undef)
-  %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> undef)
+  %f16 = call half @llvm.log.f16(half poison)
+  %v2f16 = call <2 x half> @llvm.log.v2f16(<2 x half> poison)
+  %v3f16 = call <3 x half> @llvm.log.v3f16(<3 x half> poison)
+  %v4f16 = call <4 x half> @llvm.log.v4f16(<4 x half> poison)
+  %v5f16 = call <5 x half> @llvm.log.v5f16(<5 x half> poison)
+  %v8f16 = call <8 x half> @llvm.log.v8f16(<8 x half> poison)
+  %v16f16 = call <16 x half> @llvm.log.v16f16(<16 x half> poison)
+  %v17f16 = call <17 x half> @llvm.log.v17f16(<17 x half> poison)
   ret void
 }
 
 define void @log_bf16() {
 ; BASE-LABEL: 'log_bf16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 320 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 680 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'log_bf16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'log_bf16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'log_bf16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'log_bf16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 612 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'log_bf16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'log_bf16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'log_bf16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %bf16 = call bfloat @llvm.log.bf16(bfloat undef)
-  %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> undef)
-  %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> undef)
-  %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> undef)
-  %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> undef)
-  %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> undef)
-  %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> undef)
-  %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> undef)
+  %bf16 = call bfloat @llvm.log.bf16(bfloat poison)
+  %v2bf16 = call <2 x bfloat> @llvm.log.v2bf16(<2 x bfloat> poison)
+  %v3bf16 = call <3 x bfloat> @llvm.log.v3bf16(<3 x bfloat> poison)
+  %v4bf16 = call <4 x bfloat> @llvm.log.v4bf16(<4 x bfloat> poison)
+  %v5bf16 = call <5 x bfloat> @llvm.log.v5bf16(<5 x bfloat> poison)
+  %v8bf16 = call <8 x bfloat> @llvm.log.v8bf16(<8 x bfloat> poison)
+  %v16bf16 = call <16 x bfloat> @llvm.log.v16bf16(<16 x bfloat> poison)
+  %v17bf16 = call <17 x bfloat> @llvm.log.v17bf16(<17 x bfloat> poison)
   ret void
 }
 
 define void @log_f32() {
-; ALL-LABEL: 'log_f32'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log.f32(float undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; BASE-LABEL: 'log_f32'
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 960 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 2560 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'log_f32'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log.f32(float undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; GFX8-LABEL: 'log_f32'
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 960 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 2560 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX9-LABEL: 'log_f32'
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 51 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 68 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 85 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 136 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 816 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 2176 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX10-LABEL: 'log_f32'
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 51 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 68 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 85 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 136 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 816 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 2176 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; BASE-SIZE-LABEL: 'log_f32'
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 54 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 90 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 864 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2304 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f32 = call float @llvm.log.f32(float undef)
-  %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> undef)
-  %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> undef)
-  %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> undef)
-  %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> undef)
-  %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> undef)
-  %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> undef)
-  %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> undef)
+; GFX8-SIZE-LABEL: 'log_f32'
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 54 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 90 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 864 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 2304 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX9-SIZE-LABEL: 'log_f32'
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX10-SIZE-LABEL: 'log_f32'
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+  %f32 = call float @llvm.log.f32(float poison)
+  %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+  %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+  %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+  %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+  %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+  %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+  %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
   ret void
 }
 
 define void @log_f64() {
 ; ALL-LABEL: 'log_f64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64 = call double @llvm.log.f64(double undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f64 = call <2 x double> @llvm.log.v2f64(<2 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f64 = call <3 x double> @llvm.log.v3f64(<3 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f64 = call <4 x double> @llvm.log.v4f64(<4 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f64 = call <5 x double> @llvm.log.v5f64(<5 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f64 = call <8 x double> @llvm.log.v8f64(<8 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v16f64 = call <16 x double> @llvm.log.v16f64(<16 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f64 = call <17 x double> @llvm.log.v17f64(<17 x double> undef)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64 = call double @llvm.log.f64(double poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f64 = call <2 x double> @llvm.log.v2f64(<2 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f64 = call <3 x double> @llvm.log.v3f64(<3 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f64 = call <4 x double> @llvm.log.v4f64(<4 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f64 = call <5 x double> @llvm.log.v5f64(<5 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f64 = call <8 x double> @llvm.log.v8f64(<8 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v16f64 = call <16 x double> @llvm.log.v16f64(<16 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f64 = call <17 x double> @llvm.log.v17f64(<17 x double> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log_f64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.log.f64(double undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2f64 = call <2 x double> @llvm.log.v2f64(<2 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v3f64 = call <3 x double> @llvm.log.v3f64(<3 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4f64 = call <4 x double> @llvm.log.v4f64(<4 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v5f64 = call <5 x double> @llvm.log.v5f64(<5 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v8f64 = call <8 x double> @llvm.log.v8f64(<8 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v16f64 = call <16 x double> @llvm.log.v16f64(<16 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v17f64 = call <17 x double> @llvm.log.v17f64(<17 x double> undef)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.log.f64(double poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2f64 = call <2 x double> @llvm.log.v2f64(<2 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v3f64 = call <3 x double> @llvm.log.v3f64(<3 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4f64 = call <4 x double> @llvm.log.v4f64(<4 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v5f64 = call <5 x double> @llvm.log.v5f64(<5 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v8f64 = call <8 x double> @llvm.log.v8f64(<8 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v16f64 = call <16 x double> @llvm.log.v16f64(<16 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v17f64 = call <17 x double> @llvm.log.v17f64(<17 x double> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f64 = call double @llvm.log.f64(double undef)
-  %v2f64 = call <2 x double> @llvm.log.v2f64(<2 x double> undef)
-  %v3f64 = call <3 x double> @llvm.log.v3f64(<3 x double> undef)
-  %v4f64 = call <4 x double> @llvm.log.v4f64(<4 x double> undef)
-  %v5f64 = call <5 x double> @llvm.log.v5f64(<5 x double> undef)
-  %v8f64 = call <8 x double> @llvm.log.v8f64(<8 x double> undef)
-  %v16f64 = call <16 x double> @llvm.log.v16f64(<16 x double> undef)
-  %v17f64 = call <17 x double> @llvm.log.v17f64(<17 x double> undef)
+  %f64 = call double @llvm.log.f64(double poison)
+  %v2f64 = call <2 x double> @llvm.log.v2f64(<2 x double> poison)
+  %v3f64 = call <3 x double> @llvm.log.v3f64(<3 x double> poison)
+  %v4f64 = call <4 x double> @llvm.log.v4f64(<4 x double> poison)
+  %v5f64 = call <5 x double> @llvm.log.v5f64(<5 x double> poison)
+  %v8f64 = call <8 x double> @llvm.log.v8f64(<8 x double> poison)
+  %v16f64 = call <16 x double> @llvm.log.v16f64(<16 x double> poison)
+  %v17f64 = call <17 x double> @llvm.log.v17f64(<17 x double> poison)
   ret void
 }
 
 define void @log_f32_afn_ieee() #0 {
 ; ALL-LABEL: 'log_f32_afn_ieee'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 480 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 1280 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log_f32_afn_ieee'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1024 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call afn float @llvm.log.f32(float poison)
@@ -313,25 +379,25 @@ define void @log_f32_afn_ieee() #0 {
 
 define void @log_f32_afn_daz() #1 {
 ; ALL-LABEL: 'log_f32_afn_daz'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log_f32_afn_daz'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call afn float @llvm.log.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call afn <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call afn <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call afn <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call afn <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call afn <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call afn <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call afn <17 x float> @llvm.log.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call afn float @llvm.log.f32(float poison)
@@ -346,27 +412,93 @@ define void @log_f32_afn_daz() #1 {
 }
 
 define void @log_f32_daz() #1 {
-; ALL-LABEL: 'log_f32_daz'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; BASE-LABEL: 'log_f32_daz'
+; BASE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'log_f32_daz'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; GFX8-LABEL: 'log_f32_daz'
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX9-LABEL: 'log_f32_daz'
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 576 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1536 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX10-LABEL: 'log_f32_daz'
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 576 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1536 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; BASE-SIZE-LABEL: 'log_f32_daz'
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 39 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 65 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 624 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1664 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX8-SIZE-LABEL: 'log_f32_daz'
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 39 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 65 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 624 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1664 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX9-SIZE-LABEL: 'log_f32_daz'
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 480 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1280 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX10-SIZE-LABEL: 'log_f32_daz'
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32 = call float @llvm.log.f32(float poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f32 = call <3 x float> @llvm.log.v3f32(<3 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f32 = call <4 x float> @llvm.log.v4f32(<4 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f32 = call <5 x float> @llvm.log.v5f32(<5 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f32 = call <8 x float> @llvm.log.v8f32(<8 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 480 for instruction: %v16f32 = call <16 x float> @llvm.log.v16f32(<16 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1280 for instruction: %v17f32 = call <17 x float> @llvm.log.v17f32(<17 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call float @llvm.log.f32(float poison)
   %v2f32 = call <2 x float> @llvm.log.v2f32(<2 x float> poison)
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/log10.ll b/llvm/test/Analysis/CostModel/AMDGPU/log10.ll
index 800fba7fbcafa..4ca92ea07cc37 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/log10.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/log10.ll
@@ -11,293 +11,359 @@
 
 define void @log10_f16() {
 ; BASE-LABEL: 'log10_f16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 320 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 680 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'log10_f16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'log10_f16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'log10_f16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'log10_f16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 612 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'log10_f16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'log10_f16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'log10_f16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log10.f16(half poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 23 for instruction: %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f16 = call half @llvm.log10.f16(half undef)
-  %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> undef)
-  %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> undef)
-  %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> undef)
-  %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> undef)
-  %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> undef)
-  %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> undef)
-  %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> undef)
+  %f16 = call half @llvm.log10.f16(half poison)
+  %v2f16 = call <2 x half> @llvm.log10.v2f16(<2 x half> poison)
+  %v3f16 = call <3 x half> @llvm.log10.v3f16(<3 x half> poison)
+  %v4f16 = call <4 x half> @llvm.log10.v4f16(<4 x half> poison)
+  %v5f16 = call <5 x half> @llvm.log10.v5f16(<5 x half> poison)
+  %v8f16 = call <8 x half> @llvm.log10.v8f16(<8 x half> poison)
+  %v16f16 = call <16 x half> @llvm.log10.v16f16(<16 x half> poison)
+  %v17f16 = call <17 x half> @llvm.log10.v17f16(<17 x half> poison)
   ret void
 }
 
 define void @log10_bf16() {
 ; BASE-LABEL: 'log10_bf16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 320 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 680 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'log10_bf16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'log10_bf16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'log10_bf16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'log10_bf16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 612 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'log10_bf16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'log10_bf16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'log10_bf16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %bf16 = call bfloat @llvm.log10.bf16(bfloat undef)
-  %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> undef)
-  %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> undef)
-  %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> undef)
-  %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> undef)
-  %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> undef)
-  %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> undef)
-  %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> undef)
+  %bf16 = call bfloat @llvm.log10.bf16(bfloat poison)
+  %v2bf16 = call <2 x bfloat> @llvm.log10.v2bf16(<2 x bfloat> poison)
+  %v3bf16 = call <3 x bfloat> @llvm.log10.v3bf16(<3 x bfloat> poison)
+  %v4bf16 = call <4 x bfloat> @llvm.log10.v4bf16(<4 x bfloat> poison)
+  %v5bf16 = call <5 x bfloat> @llvm.log10.v5bf16(<5 x bfloat> poison)
+  %v8bf16 = call <8 x bfloat> @llvm.log10.v8bf16(<8 x bfloat> poison)
+  %v16bf16 = call <16 x bfloat> @llvm.log10.v16bf16(<16 x bfloat> poison)
+  %v17bf16 = call <17 x bfloat> @llvm.log10.v17bf16(<17 x bfloat> poison)
   ret void
 }
 
 define void @log10_f32() {
-; ALL-LABEL: 'log10_f32'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log10.f32(float undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; BASE-LABEL: 'log10_f32'
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 960 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 2560 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'log10_f32'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log10.f32(float undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; GFX8-LABEL: 'log10_f32'
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 960 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 2560 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX9-LABEL: 'log10_f32'
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 51 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 68 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 85 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 136 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 816 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 2176 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX10-LABEL: 'log10_f32'
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 51 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 68 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 85 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 136 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 816 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 2176 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; BASE-SIZE-LABEL: 'log10_f32'
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 54 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 90 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 864 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2304 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f32 = call float @llvm.log10.f32(float undef)
-  %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> undef)
-  %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> undef)
-  %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> undef)
-  %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> undef)
-  %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> undef)
-  %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> undef)
-  %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> undef)
+; GFX8-SIZE-LABEL: 'log10_f32'
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 54 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 90 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 864 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 2304 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX9-SIZE-LABEL: 'log10_f32'
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX10-SIZE-LABEL: 'log10_f32'
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+  %f32 = call float @llvm.log10.f32(float poison)
+  %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+  %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+  %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+  %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+  %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+  %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+  %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
   ret void
 }
 
 define void @log10_f64() {
 ; ALL-LABEL: 'log10_f64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64 = call double @llvm.log10.f64(double undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f64 = call <2 x double> @llvm.log10.v2f64(<2 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f64 = call <3 x double> @llvm.log10.v3f64(<3 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f64 = call <4 x double> @llvm.log10.v4f64(<4 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f64 = call <5 x double> @llvm.log10.v5f64(<5 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f64 = call <8 x double> @llvm.log10.v8f64(<8 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v16f64 = call <16 x double> @llvm.log10.v16f64(<16 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f64 = call <17 x double> @llvm.log10.v17f64(<17 x double> undef)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64 = call double @llvm.log10.f64(double poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f64 = call <2 x double> @llvm.log10.v2f64(<2 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f64 = call <3 x double> @llvm.log10.v3f64(<3 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f64 = call <4 x double> @llvm.log10.v4f64(<4 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f64 = call <5 x double> @llvm.log10.v5f64(<5 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f64 = call <8 x double> @llvm.log10.v8f64(<8 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v16f64 = call <16 x double> @llvm.log10.v16f64(<16 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f64 = call <17 x double> @llvm.log10.v17f64(<17 x double> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log10_f64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.log10.f64(double undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2f64 = call <2 x double> @llvm.log10.v2f64(<2 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v3f64 = call <3 x double> @llvm.log10.v3f64(<3 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4f64 = call <4 x double> @llvm.log10.v4f64(<4 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v5f64 = call <5 x double> @llvm.log10.v5f64(<5 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v8f64 = call <8 x double> @llvm.log10.v8f64(<8 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v16f64 = call <16 x double> @llvm.log10.v16f64(<16 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v17f64 = call <17 x double> @llvm.log10.v17f64(<17 x double> undef)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.log10.f64(double poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2f64 = call <2 x double> @llvm.log10.v2f64(<2 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v3f64 = call <3 x double> @llvm.log10.v3f64(<3 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4f64 = call <4 x double> @llvm.log10.v4f64(<4 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v5f64 = call <5 x double> @llvm.log10.v5f64(<5 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v8f64 = call <8 x double> @llvm.log10.v8f64(<8 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v16f64 = call <16 x double> @llvm.log10.v16f64(<16 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v17f64 = call <17 x double> @llvm.log10.v17f64(<17 x double> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f64 = call double @llvm.log10.f64(double undef)
-  %v2f64 = call <2 x double> @llvm.log10.v2f64(<2 x double> undef)
-  %v3f64 = call <3 x double> @llvm.log10.v3f64(<3 x double> undef)
-  %v4f64 = call <4 x double> @llvm.log10.v4f64(<4 x double> undef)
-  %v5f64 = call <5 x double> @llvm.log10.v5f64(<5 x double> undef)
-  %v8f64 = call <8 x double> @llvm.log10.v8f64(<8 x double> undef)
-  %v16f64 = call <16 x double> @llvm.log10.v16f64(<16 x double> undef)
-  %v17f64 = call <17 x double> @llvm.log10.v17f64(<17 x double> undef)
+  %f64 = call double @llvm.log10.f64(double poison)
+  %v2f64 = call <2 x double> @llvm.log10.v2f64(<2 x double> poison)
+  %v3f64 = call <3 x double> @llvm.log10.v3f64(<3 x double> poison)
+  %v4f64 = call <4 x double> @llvm.log10.v4f64(<4 x double> poison)
+  %v5f64 = call <5 x double> @llvm.log10.v5f64(<5 x double> poison)
+  %v8f64 = call <8 x double> @llvm.log10.v8f64(<8 x double> poison)
+  %v16f64 = call <16 x double> @llvm.log10.v16f64(<16 x double> poison)
+  %v17f64 = call <17 x double> @llvm.log10.v17f64(<17 x double> poison)
   ret void
 }
 
 define void @log10_f32_afn_ieee() #0 {
 ; ALL-LABEL: 'log10_f32_afn_ieee'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 480 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 1280 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log10_f32_afn_ieee'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1024 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call afn float @llvm.log10.f32(float poison)
@@ -313,25 +379,25 @@ define void @log10_f32_afn_ieee() #0 {
 
 define void @log10_f32_afn_daz() #1 {
 ; ALL-LABEL: 'log10_f32_afn_daz'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log10_f32_afn_daz'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call afn float @llvm.log10.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call afn <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call afn <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call afn <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call afn <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call afn <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call afn <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call afn <17 x float> @llvm.log10.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call afn float @llvm.log10.f32(float poison)
@@ -346,27 +412,93 @@ define void @log10_f32_afn_daz() #1 {
 }
 
 define void @log10_f32_daz() #1 {
-; ALL-LABEL: 'log10_f32_daz'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log10.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; BASE-LABEL: 'log10_f32_daz'
+; BASE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'log10_f32_daz'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log10.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; GFX8-LABEL: 'log10_f32_daz'
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 75 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 120 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 720 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1920 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX9-LABEL: 'log10_f32_daz'
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 576 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1536 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX10-LABEL: 'log10_f32_daz'
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 576 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1536 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; BASE-SIZE-LABEL: 'log10_f32_daz'
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 39 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 65 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 624 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1664 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX8-SIZE-LABEL: 'log10_f32_daz'
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 39 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 65 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 104 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 624 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1664 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX9-SIZE-LABEL: 'log10_f32_daz'
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 480 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1280 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX10-SIZE-LABEL: 'log10_f32_daz'
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f32 = call float @llvm.log10.f32(float poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f32 = call <3 x float> @llvm.log10.v3f32(<3 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f32 = call <4 x float> @llvm.log10.v4f32(<4 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f32 = call <5 x float> @llvm.log10.v5f32(<5 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f32 = call <8 x float> @llvm.log10.v8f32(<8 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 480 for instruction: %v16f32 = call <16 x float> @llvm.log10.v16f32(<16 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1280 for instruction: %v17f32 = call <17 x float> @llvm.log10.v17f32(<17 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call float @llvm.log10.f32(float poison)
   %v2f32 = call <2 x float> @llvm.log10.v2f32(<2 x float> poison)
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/log2.ll b/llvm/test/Analysis/CostModel/AMDGPU/log2.ll
index 528846fcadf9f..2717992eb7b64 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/log2.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/log2.ll
@@ -11,282 +11,282 @@
 
 define void @log2_f16() {
 ; BASE-LABEL: 'log2_f16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 306 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'log2_f16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'log2_f16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'log2_f16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'log2_f16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 112 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 238 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'log2_f16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'log2_f16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'log2_f16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.log2.f16(half poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f16 = call half @llvm.log2.f16(half undef)
-  %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> undef)
-  %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> undef)
-  %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> undef)
-  %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> undef)
-  %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> undef)
-  %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> undef)
-  %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> undef)
+  %f16 = call half @llvm.log2.f16(half poison)
+  %v2f16 = call <2 x half> @llvm.log2.v2f16(<2 x half> poison)
+  %v3f16 = call <3 x half> @llvm.log2.v3f16(<3 x half> poison)
+  %v4f16 = call <4 x half> @llvm.log2.v4f16(<4 x half> poison)
+  %v5f16 = call <5 x half> @llvm.log2.v5f16(<5 x half> poison)
+  %v8f16 = call <8 x half> @llvm.log2.v8f16(<8 x half> poison)
+  %v16f16 = call <16 x half> @llvm.log2.v16f16(<16 x half> poison)
+  %v17f16 = call <17 x half> @llvm.log2.v17f16(<17 x half> poison)
   ret void
 }
 
 define void @log2_bf16() {
 ; BASE-LABEL: 'log2_bf16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 306 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'log2_bf16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'log2_bf16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'log2_bf16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'log2_bf16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 112 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 238 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'log2_bf16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'log2_bf16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'log2_bf16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %bf16 = call bfloat @llvm.log2.bf16(bfloat undef)
-  %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> undef)
-  %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> undef)
-  %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> undef)
-  %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> undef)
-  %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> undef)
-  %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> undef)
-  %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> undef)
+  %bf16 = call bfloat @llvm.log2.bf16(bfloat poison)
+  %v2bf16 = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> poison)
+  %v3bf16 = call <3 x bfloat> @llvm.log2.v3bf16(<3 x bfloat> poison)
+  %v4bf16 = call <4 x bfloat> @llvm.log2.v4bf16(<4 x bfloat> poison)
+  %v5bf16 = call <5 x bfloat> @llvm.log2.v5bf16(<5 x bfloat> poison)
+  %v8bf16 = call <8 x bfloat> @llvm.log2.v8bf16(<8 x bfloat> poison)
+  %v16bf16 = call <16 x bfloat> @llvm.log2.v16bf16(<16 x bfloat> poison)
+  %v17bf16 = call <17 x bfloat> @llvm.log2.v17bf16(<17 x bfloat> poison)
   ret void
 }
 
 define void @log2_f32() {
 ; ALL-LABEL: 'log2_f32'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log2.f32(float undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> undef)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %f32 = call float @llvm.log2.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 27 for instruction: %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 45 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 432 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 1152 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log2_f32'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log2.f32(float undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> undef)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %f32 = call float @llvm.log2.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 21 for instruction: %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 336 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 896 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f32 = call float @llvm.log2.f32(float undef)
-  %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> undef)
-  %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> undef)
-  %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> undef)
-  %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> undef)
-  %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> undef)
-  %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> undef)
-  %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> undef)
+  %f32 = call float @llvm.log2.f32(float poison)
+  %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> poison)
+  %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> poison)
+  %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> poison)
+  %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> poison)
+  %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> poison)
+  %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
+  %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
   ret void
 }
 
 define void @log2_f64() {
 ; ALL-LABEL: 'log2_f64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64 = call double @llvm.log2.f64(double undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f64 = call <2 x double> @llvm.log2.v2f64(<2 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f64 = call <3 x double> @llvm.log2.v3f64(<3 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f64 = call <4 x double> @llvm.log2.v4f64(<4 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f64 = call <5 x double> @llvm.log2.v5f64(<5 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f64 = call <8 x double> @llvm.log2.v8f64(<8 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v16f64 = call <16 x double> @llvm.log2.v16f64(<16 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f64 = call <17 x double> @llvm.log2.v17f64(<17 x double> undef)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %f64 = call double @llvm.log2.f64(double poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v2f64 = call <2 x double> @llvm.log2.v2f64(<2 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v3f64 = call <3 x double> @llvm.log2.v3f64(<3 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v4f64 = call <4 x double> @llvm.log2.v4f64(<4 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %v5f64 = call <5 x double> @llvm.log2.v5f64(<5 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v8f64 = call <8 x double> @llvm.log2.v8f64(<8 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v16f64 = call <16 x double> @llvm.log2.v16f64(<16 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f64 = call <17 x double> @llvm.log2.v17f64(<17 x double> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log2_f64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.log2.f64(double undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2f64 = call <2 x double> @llvm.log2.v2f64(<2 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v3f64 = call <3 x double> @llvm.log2.v3f64(<3 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4f64 = call <4 x double> @llvm.log2.v4f64(<4 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v5f64 = call <5 x double> @llvm.log2.v5f64(<5 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v8f64 = call <8 x double> @llvm.log2.v8f64(<8 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v16f64 = call <16 x double> @llvm.log2.v16f64(<16 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v17f64 = call <17 x double> @llvm.log2.v17f64(<17 x double> undef)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f64 = call double @llvm.log2.f64(double poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2f64 = call <2 x double> @llvm.log2.v2f64(<2 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v3f64 = call <3 x double> @llvm.log2.v3f64(<3 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v4f64 = call <4 x double> @llvm.log2.v4f64(<4 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v5f64 = call <5 x double> @llvm.log2.v5f64(<5 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v8f64 = call <8 x double> @llvm.log2.v8f64(<8 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v16f64 = call <16 x double> @llvm.log2.v16f64(<16 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 17 for instruction: %v17f64 = call <17 x double> @llvm.log2.v17f64(<17 x double> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f64 = call double @llvm.log2.f64(double undef)
-  %v2f64 = call <2 x double> @llvm.log2.v2f64(<2 x double> undef)
-  %v3f64 = call <3 x double> @llvm.log2.v3f64(<3 x double> undef)
-  %v4f64 = call <4 x double> @llvm.log2.v4f64(<4 x double> undef)
-  %v5f64 = call <5 x double> @llvm.log2.v5f64(<5 x double> undef)
-  %v8f64 = call <8 x double> @llvm.log2.v8f64(<8 x double> undef)
-  %v16f64 = call <16 x double> @llvm.log2.v16f64(<16 x double> undef)
-  %v17f64 = call <17 x double> @llvm.log2.v17f64(<17 x double> undef)
+  %f64 = call double @llvm.log2.f64(double poison)
+  %v2f64 = call <2 x double> @llvm.log2.v2f64(<2 x double> poison)
+  %v3f64 = call <3 x double> @llvm.log2.v3f64(<3 x double> poison)
+  %v4f64 = call <4 x double> @llvm.log2.v4f64(<4 x double> poison)
+  %v5f64 = call <5 x double> @llvm.log2.v5f64(<5 x double> poison)
+  %v8f64 = call <8 x double> @llvm.log2.v8f64(<8 x double> poison)
+  %v16f64 = call <16 x double> @llvm.log2.v16f64(<16 x double> poison)
+  %v17f64 = call <17 x double> @llvm.log2.v17f64(<17 x double> poison)
   ret void
 }
 
 define void @log2_f32_daz() #0 {
 ; ALL-LABEL: 'log2_f32_daz'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.log2.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %f32 = call float @llvm.log2.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v2f32 = call <2 x float> @llvm.log2.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3f32 = call <3 x float> @llvm.log2.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 512 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'log2_f32_daz'
@@ -296,8 +296,8 @@ define void @log2_f32_daz() #0 {
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.log2.v4f32(<4 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.log2.v5f32(<5 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.log2.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %v16f32 = call <16 x float> @llvm.log2.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 256 for instruction: %v17f32 = call <17 x float> @llvm.log2.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call float @llvm.log2.f32(float poison)
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/sin.ll b/llvm/test/Analysis/CostModel/AMDGPU/sin.ll
index 5db48622f4d9b..09b3e6c2582b8 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/sin.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/sin.ll
@@ -11,14 +11,14 @@
 
 define void @sin_f16() {
 ; BASE-LABEL: 'sin_f16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.sin.f16(half poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.sin.v2f16(<2 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.sin.v3f16(<3 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.sin.v4f16(<4 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.sin.v5f16(<5 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.sin.v8f16(<8 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.sin.v16f16(<16 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.sin.v17f16(<17 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16 = call half @llvm.sin.f16(half poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f16 = call <2 x half> @llvm.sin.v2f16(<2 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v3f16 = call <3 x half> @llvm.sin.v3f16(<3 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f16 = call <4 x half> @llvm.sin.v4f16(<4 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v5f16 = call <5 x half> @llvm.sin.v5f16(<5 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f16 = call <8 x half> @llvm.sin.v8f16(<8 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v16f16 = call <16 x half> @llvm.sin.v16f16(<16 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f16 = call <17 x half> @llvm.sin.v17f16(<17 x half> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'sin_f16'
@@ -55,14 +55,14 @@ define void @sin_f16() {
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'sin_f16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.sin.f16(half poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.sin.v2f16(<2 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.sin.v3f16(<3 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.sin.v4f16(<4 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.sin.v5f16(<5 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.sin.v8f16(<8 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.sin.v16f16(<16 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.sin.v17f16(<17 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16 = call half @llvm.sin.f16(half poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f16 = call <2 x half> @llvm.sin.v2f16(<2 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3f16 = call <3 x half> @llvm.sin.v3f16(<3 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f16 = call <4 x half> @llvm.sin.v4f16(<4 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v5f16 = call <5 x half> @llvm.sin.v5f16(<5 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f16 = call <8 x half> @llvm.sin.v8f16(<8 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v16f16 = call <16 x half> @llvm.sin.v16f16(<16 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 102 for instruction: %v17f16 = call <17 x half> @llvm.sin.v17f16(<17 x half> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'sin_f16'
@@ -111,14 +111,14 @@ define void @sin_f16() {
 
 define void @sin_bf16() {
 ; BASE-LABEL: 'sin_bf16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.sin.bf16(bfloat poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sin.v2bf16(<2 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sin.v3bf16(<3 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sin.v4bf16(<4 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sin.v5bf16(<5 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sin.v8bf16(<8 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sin.v16bf16(<16 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sin.v17bf16(<17 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %bf16 = call bfloat @llvm.sin.bf16(bfloat poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sin.v2bf16(<2 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sin.v3bf16(<3 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sin.v4bf16(<4 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sin.v5bf16(<5 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sin.v8bf16(<8 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sin.v16bf16(<16 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sin.v17bf16(<17 x bfloat> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'sin_bf16'
@@ -155,14 +155,14 @@ define void @sin_bf16() {
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'sin_bf16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.sin.bf16(bfloat poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sin.v2bf16(<2 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sin.v3bf16(<3 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sin.v4bf16(<4 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sin.v5bf16(<5 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sin.v8bf16(<8 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sin.v16bf16(<16 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sin.v17bf16(<17 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %bf16 = call bfloat @llvm.sin.bf16(bfloat poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sin.v2bf16(<2 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sin.v3bf16(<3 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sin.v4bf16(<4 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sin.v5bf16(<5 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sin.v8bf16(<8 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sin.v16bf16(<16 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 102 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sin.v17bf16(<17 x bfloat> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'sin_bf16'
@@ -210,27 +210,93 @@ define void @sin_bf16() {
 }
 
 define void @sin_f32() {
-; ALL-LABEL: 'sin_f32'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.sin.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; BASE-LABEL: 'sin_f32'
+; BASE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'sin_f32'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.sin.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; GFX8-LABEL: 'sin_f32'
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 768 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX9-LABEL: 'sin_f32'
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX10-LABEL: 'sin_f32'
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; BASE-SIZE-LABEL: 'sin_f32'
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX8-SIZE-LABEL: 'sin_f32'
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 512 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX9-SIZE-LABEL: 'sin_f32'
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX10-SIZE-LABEL: 'sin_f32'
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call float @llvm.sin.f32(float poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call <3 x float> @llvm.sin.v3f32(<3 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call <4 x float> @llvm.sin.v4f32(<4 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call <5 x float> @llvm.sin.v5f32(<5 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call <8 x float> @llvm.sin.v8f32(<8 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call <16 x float> @llvm.sin.v16f32(<16 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call <17 x float> @llvm.sin.v17f32(<17 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call float @llvm.sin.f32(float poison)
   %v2f32 = call <2 x float> @llvm.sin.v2f32(<2 x float> poison)
@@ -279,14 +345,14 @@ define void @sin_f64() {
 
 define void @cos_f16() {
 ; BASE-LABEL: 'cos_f16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.cos.f16(half poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.cos.v2f16(<2 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.cos.v3f16(<3 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.cos.v4f16(<4 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.cos.v5f16(<5 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.cos.v8f16(<8 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.cos.v16f16(<16 x half> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.cos.v17f16(<17 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f16 = call half @llvm.cos.f16(half poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f16 = call <2 x half> @llvm.cos.v2f16(<2 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v3f16 = call <3 x half> @llvm.cos.v3f16(<3 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f16 = call <4 x half> @llvm.cos.v4f16(<4 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v5f16 = call <5 x half> @llvm.cos.v5f16(<5 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f16 = call <8 x half> @llvm.cos.v8f16(<8 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v16f16 = call <16 x half> @llvm.cos.v16f16(<16 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17f16 = call <17 x half> @llvm.cos.v17f16(<17 x half> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'cos_f16'
@@ -323,14 +389,14 @@ define void @cos_f16() {
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'cos_f16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.cos.f16(half poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.cos.v2f16(<2 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.cos.v3f16(<3 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.cos.v4f16(<4 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.cos.v5f16(<5 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.cos.v8f16(<8 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.cos.v16f16(<16 x half> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.cos.v17f16(<17 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f16 = call half @llvm.cos.f16(half poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f16 = call <2 x half> @llvm.cos.v2f16(<2 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3f16 = call <3 x half> @llvm.cos.v3f16(<3 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f16 = call <4 x half> @llvm.cos.v4f16(<4 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v5f16 = call <5 x half> @llvm.cos.v5f16(<5 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f16 = call <8 x half> @llvm.cos.v8f16(<8 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v16f16 = call <16 x half> @llvm.cos.v16f16(<16 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 102 for instruction: %v17f16 = call <17 x half> @llvm.cos.v17f16(<17 x half> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'cos_f16'
@@ -379,14 +445,14 @@ define void @cos_f16() {
 
 define void @cos_bf16() {
 ; BASE-LABEL: 'cos_bf16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.cos.bf16(bfloat poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.cos.v2bf16(<2 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.cos.v3bf16(<3 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.cos.v4bf16(<4 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.cos.v5bf16(<5 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.cos.v8bf16(<8 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.cos.v16bf16(<16 x bfloat> poison)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.cos.v17bf16(<17 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %bf16 = call bfloat @llvm.cos.bf16(bfloat poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2bf16 = call <2 x bfloat> @llvm.cos.v2bf16(<2 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v3bf16 = call <3 x bfloat> @llvm.cos.v3bf16(<3 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4bf16 = call <4 x bfloat> @llvm.cos.v4bf16(<4 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v5bf16 = call <5 x bfloat> @llvm.cos.v5bf16(<5 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8bf16 = call <8 x bfloat> @llvm.cos.v8bf16(<8 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v16bf16 = call <16 x bfloat> @llvm.cos.v16bf16(<16 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 170 for instruction: %v17bf16 = call <17 x bfloat> @llvm.cos.v17bf16(<17 x bfloat> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'cos_bf16'
@@ -423,14 +489,14 @@ define void @cos_bf16() {
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'cos_bf16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.cos.bf16(bfloat poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.cos.v2bf16(<2 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.cos.v3bf16(<3 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.cos.v4bf16(<4 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.cos.v5bf16(<5 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.cos.v8bf16(<8 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.cos.v16bf16(<16 x bfloat> poison)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.cos.v17bf16(<17 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %bf16 = call bfloat @llvm.cos.bf16(bfloat poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2bf16 = call <2 x bfloat> @llvm.cos.v2bf16(<2 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3bf16 = call <3 x bfloat> @llvm.cos.v3bf16(<3 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4bf16 = call <4 x bfloat> @llvm.cos.v4bf16(<4 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v5bf16 = call <5 x bfloat> @llvm.cos.v5bf16(<5 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8bf16 = call <8 x bfloat> @llvm.cos.v8bf16(<8 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v16bf16 = call <16 x bfloat> @llvm.cos.v16bf16(<16 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 102 for instruction: %v17bf16 = call <17 x bfloat> @llvm.cos.v17bf16(<17 x bfloat> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'cos_bf16'
@@ -478,27 +544,93 @@ define void @cos_bf16() {
 }
 
 define void @cos_f32() {
-; ALL-LABEL: 'cos_f32'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.cos.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+; BASE-LABEL: 'cos_f32'
+; BASE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
-; ALL-SIZE-LABEL: 'cos_f32'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.cos.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; GFX8-LABEL: 'cos_f32'
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 288 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 768 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX9-LABEL: 'cos_f32'
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; GFX10-LABEL: 'cos_f32'
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 240 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+; BASE-SIZE-LABEL: 'cos_f32'
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX8-SIZE-LABEL: 'cos_f32'
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 512 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX9-SIZE-LABEL: 'cos_f32'
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; GFX10-SIZE-LABEL: 'cos_f32'
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %f32 = call float @llvm.cos.f32(float poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3f32 = call <3 x float> @llvm.cos.v3f32(<3 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v4f32 = call <4 x float> @llvm.cos.v4f32(<4 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v5f32 = call <5 x float> @llvm.cos.v5f32(<5 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %v8f32 = call <8 x float> @llvm.cos.v8f32(<8 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v16f32 = call <16 x float> @llvm.cos.v16f32(<16 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 384 for instruction: %v17f32 = call <17 x float> @llvm.cos.v17f32(<17 x float> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call float @llvm.cos.f32(float poison)
   %v2f32 = call <2 x float> @llvm.cos.v2f32(<2 x float> poison)
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/sqrt.ll b/llvm/test/Analysis/CostModel/AMDGPU/sqrt.ll
index 40d3e20be018d..3210c0c34ef3c 100644
--- a/llvm/test/Analysis/CostModel/AMDGPU/sqrt.ll
+++ b/llvm/test/Analysis/CostModel/AMDGPU/sqrt.ll
@@ -11,282 +11,282 @@
 
 define void @sqrt_f16() {
 ; BASE-LABEL: 'sqrt_f16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 21 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 42 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 84 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 84 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 168 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 168 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 336 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 714 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'sqrt_f16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'sqrt_f16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'sqrt_f16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'sqrt_f16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 38 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 152 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 152 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 304 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 646 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'sqrt_f16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'sqrt_f16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'sqrt_f16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %f16 = call half @llvm.sqrt.f16(half poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f16 = call half @llvm.sqrt.f16(half undef)
-  %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> undef)
-  %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> undef)
-  %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> undef)
-  %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> undef)
-  %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> undef)
-  %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> undef)
-  %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> undef)
+  %f16 = call half @llvm.sqrt.f16(half poison)
+  %v2f16 = call <2 x half> @llvm.sqrt.v2f16(<2 x half> poison)
+  %v3f16 = call <3 x half> @llvm.sqrt.v3f16(<3 x half> poison)
+  %v4f16 = call <4 x half> @llvm.sqrt.v4f16(<4 x half> poison)
+  %v5f16 = call <5 x half> @llvm.sqrt.v5f16(<5 x half> poison)
+  %v8f16 = call <8 x half> @llvm.sqrt.v8f16(<8 x half> poison)
+  %v16f16 = call <16 x half> @llvm.sqrt.v16f16(<16 x half> poison)
+  %v17f16 = call <17 x half> @llvm.sqrt.v17f16(<17 x half> poison)
   ret void
 }
 
 define void @sqrt_bf16() {
 ; BASE-LABEL: 'sqrt_bf16'
-; BASE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; BASE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 21 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 42 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 84 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 84 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 168 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 168 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 336 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; BASE-NEXT:  Cost Model: Found an estimated cost of 714 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; BASE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX8-LABEL: 'sqrt_bf16'
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; GFX8-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; GFX8-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX9-LABEL: 'sqrt_bf16'
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; GFX9-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; GFX9-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; GFX10-LABEL: 'sqrt_bf16'
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; GFX10-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; GFX10-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; BASE-SIZE-LABEL: 'sqrt_bf16'
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 38 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 152 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 152 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 304 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 646 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; BASE-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX8-SIZE-LABEL: 'sqrt_bf16'
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; GFX8-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX9-SIZE-LABEL: 'sqrt_bf16'
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; GFX9-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
 ; GFX10-SIZE-LABEL: 'sqrt_bf16'
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 33 for instruction: %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
 ; GFX10-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %bf16 = call bfloat @llvm.sqrt.bf16(bfloat undef)
-  %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> undef)
-  %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> undef)
-  %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> undef)
-  %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> undef)
-  %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> undef)
-  %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> undef)
-  %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> undef)
+  %bf16 = call bfloat @llvm.sqrt.bf16(bfloat poison)
+  %v2bf16 = call <2 x bfloat> @llvm.sqrt.v2bf16(<2 x bfloat> poison)
+  %v3bf16 = call <3 x bfloat> @llvm.sqrt.v3bf16(<3 x bfloat> poison)
+  %v4bf16 = call <4 x bfloat> @llvm.sqrt.v4bf16(<4 x bfloat> poison)
+  %v5bf16 = call <5 x bfloat> @llvm.sqrt.v5bf16(<5 x bfloat> poison)
+  %v8bf16 = call <8 x bfloat> @llvm.sqrt.v8bf16(<8 x bfloat> poison)
+  %v16bf16 = call <16 x bfloat> @llvm.sqrt.v16bf16(<16 x bfloat> poison)
+  %v17bf16 = call <17 x bfloat> @llvm.sqrt.v17bf16(<17 x bfloat> poison)
   ret void
 }
 
 define void @sqrt_f32() {
 ; ALL-LABEL: 'sqrt_f32'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.sqrt.f32(float undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> undef)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 21 for instruction: %f32 = call float @llvm.sqrt.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 42 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 63 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 84 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 105 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 168 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 1008 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 2688 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'sqrt_f32'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.sqrt.f32(float undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> undef)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 19 for instruction: %f32 = call float @llvm.sqrt.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 38 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 57 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 76 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 95 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 152 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 912 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2432 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f32 = call float @llvm.sqrt.f32(float undef)
-  %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> undef)
-  %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> undef)
-  %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> undef)
-  %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> undef)
-  %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> undef)
-  %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> undef)
-  %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> undef)
+  %f32 = call float @llvm.sqrt.f32(float poison)
+  %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
+  %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
+  %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
+  %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
+  %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
+  %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+  %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
   ret void
 }
 
 define void @sqrt_f64() {
 ; ALL-LABEL: 'sqrt_f64'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64 = call double @llvm.sqrt.f64(double undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f64 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f64 = call <3 x double> @llvm.sqrt.v3f64(<3 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f64 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f64 = call <5 x double> @llvm.sqrt.v5f64(<5 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f64 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f64 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f64 = call <17 x double> @llvm.sqrt.v17f64(<17 x double> undef)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64 = call double @llvm.sqrt.f64(double poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f64 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f64 = call <3 x double> @llvm.sqrt.v3f64(<3 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f64 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f64 = call <5 x double> @llvm.sqrt.v5f64(<5 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f64 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f64 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f64 = call <17 x double> @llvm.sqrt.v17f64(<17 x double> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'sqrt_f64'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64 = call double @llvm.sqrt.f64(double undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f64 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f64 = call <3 x double> @llvm.sqrt.v3f64(<3 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f64 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f64 = call <5 x double> @llvm.sqrt.v5f64(<5 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f64 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f64 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f64 = call <17 x double> @llvm.sqrt.v17f64(<17 x double> undef)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f64 = call double @llvm.sqrt.f64(double poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f64 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f64 = call <3 x double> @llvm.sqrt.v3f64(<3 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f64 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f64 = call <5 x double> @llvm.sqrt.v5f64(<5 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f64 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f64 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f64 = call <17 x double> @llvm.sqrt.v17f64(<17 x double> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
-  %f64 = call double @llvm.sqrt.f64(double undef)
-  %v2f64 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> undef)
-  %v3f64 = call <3 x double> @llvm.sqrt.v3f64(<3 x double> undef)
-  %v4f64 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> undef)
-  %v5f64 = call <5 x double> @llvm.sqrt.v5f64(<5 x double> undef)
-  %v8f64 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> undef)
-  %v16f64 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> undef)
-  %v17f64 = call <17 x double> @llvm.sqrt.v17f64(<17 x double> undef)
+  %f64 = call double @llvm.sqrt.f64(double poison)
+  %v2f64 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> poison)
+  %v3f64 = call <3 x double> @llvm.sqrt.v3f64(<3 x double> poison)
+  %v4f64 = call <4 x double> @llvm.sqrt.v4f64(<4 x double> poison)
+  %v5f64 = call <5 x double> @llvm.sqrt.v5f64(<5 x double> poison)
+  %v8f64 = call <8 x double> @llvm.sqrt.v8f64(<8 x double> poison)
+  %v16f64 = call <16 x double> @llvm.sqrt.v16f64(<16 x double> poison)
+  %v17f64 = call <17 x double> @llvm.sqrt.v17f64(<17 x double> poison)
   ret void
 }
 
 define void @sqrt_f32_afn() #0 {
 ; ALL-LABEL: 'sqrt_f32_afn'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call afn float @llvm.sqrt.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call afn <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call afn <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %f32 = call afn float @llvm.sqrt.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v2f32 = call afn <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %v3f32 = call afn <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v4f32 = call afn <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %v5f32 = call afn <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v8f32 = call afn <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %v16f32 = call afn <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 512 for instruction: %v17f32 = call afn <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'sqrt_f32_afn'
@@ -296,8 +296,8 @@ define void @sqrt_f32_afn() #0 {
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call afn <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call afn <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call afn <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call afn <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call afn <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %v16f32 = call afn <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 256 for instruction: %v17f32 = call afn <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call afn float @llvm.sqrt.f32(float poison)
@@ -313,25 +313,25 @@ define void @sqrt_f32_afn() #0 {
 
 define void @sqrt_f32_daz() #1 {
 ; ALL-LABEL: 'sqrt_f32_daz'
-; ALL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.sqrt.f32(float poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
-; ALL-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %f32 = call float @llvm.sqrt.f32(float poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 100 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 960 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+; ALL-NEXT:  Cost Model: Found an estimated cost of 2560 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
 ; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
 ;
 ; ALL-SIZE-LABEL: 'sqrt_f32_daz'
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %f32 = call float @llvm.sqrt.f32(float poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
-; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 34 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %f32 = call float @llvm.sqrt.f32(float poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %v2f32 = call <2 x float> @llvm.sqrt.v2f32(<2 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 54 for instruction: %v3f32 = call <3 x float> @llvm.sqrt.v3f32(<3 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %v4f32 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 90 for instruction: %v5f32 = call <5 x float> @llvm.sqrt.v5f32(<5 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 144 for instruction: %v8f32 = call <8 x float> @llvm.sqrt.v8f32(<8 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 864 for instruction: %v16f32 = call <16 x float> @llvm.sqrt.v16f32(<16 x float> poison)
+; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 2304 for instruction: %v17f32 = call <17 x float> @llvm.sqrt.v17f32(<17 x float> poison)
 ; ALL-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   %f32 = call float @llvm.sqrt.f32(float poison)



More information about the llvm-commits mailing list