[llvm] de281fe - [SystemZ] Implement getCFInstrCost(). (#191017)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 02:52:41 PDT 2026


Author: Jonas Paulsson
Date: 2026-04-23T11:52:36+02:00
New Revision: de281fe220550204ce1bba0973cfa13a770ac662

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

LOG: [SystemZ] Implement getCFInstrCost(). (#191017)

Implement SystemZTTIImpl::getCFInstrCost() they way it is done for X86 and
others - let these instructions be free with the cost kind TCK_RecipThroughput.

Added: 
    

Modified: 
    llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
    llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
    llvm/test/Analysis/CostModel/SystemZ/bitcast.ll
    llvm/test/Analysis/CostModel/SystemZ/cmp-mem.ll
    llvm/test/Analysis/CostModel/SystemZ/divrem-pow2.ll
    llvm/test/Analysis/CostModel/SystemZ/divrem-reg.ll
    llvm/test/Analysis/CostModel/SystemZ/int-operands-extcost.ll
    llvm/test/Analysis/CostModel/SystemZ/logicalop.ll
    llvm/test/Analysis/CostModel/SystemZ/reduce-and.ll
    llvm/test/Analysis/CostModel/SystemZ/reduce-or.ll
    llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
    llvm/test/Analysis/CostModel/SystemZ/vector-reductions.ll
    llvm/test/Transforms/LoopVectorize/SystemZ/branch-for-predicated-block.ll
    llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
index c3e3be0068a81..7ac19761341de 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -1128,6 +1128,15 @@ static unsigned getOperandsExtensionCost(const Instruction *I) {
   return ExtCost;
 }
 
+InstructionCost SystemZTTIImpl::getCFInstrCost(unsigned Opcode,
+                                               TTI::TargetCostKind CostKind,
+                                               const Instruction *I) const {
+  if (CostKind != TTI::TCK_RecipThroughput)
+    return Opcode == Instruction::PHI ? TTI::TCC_Free : TTI::TCC_Basic;
+  // Branches are assumed to be predicted.
+  return TTI::TCC_Free;
+}
+
 InstructionCost SystemZTTIImpl::getCmpSelInstrCost(
     unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred,
     TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info,

diff  --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
index 456604ef9f627..b7b63d232f3f7 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
@@ -124,6 +124,8 @@ class SystemZTTIImpl final : public BasicTTIImplBase<SystemZTTIImpl> {
   getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
                    TTI::CastContextHint CCH, TTI::TargetCostKind CostKind,
                    const Instruction *I = nullptr) const override;
+  InstructionCost getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind,
+                                 const Instruction *I = nullptr) const override;
   InstructionCost getCmpSelInstrCost(
       unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred,
       TTI::TargetCostKind CostKind,

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/bitcast.ll b/llvm/test/Analysis/CostModel/SystemZ/bitcast.ll
index 7927588623c52..06adfad28c499 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/bitcast.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/bitcast.ll
@@ -25,12 +25,12 @@ for.cond1:                                        ; preds = %for.cond1, %entry
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:   %d.sroa.0 = alloca i64, align 8
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   store i64 0, ptr %d.sroa.0, align 8
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   store i32 2, ptr @Glob, align 4
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   br label %for.cond1
+; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:   br label %for.cond1
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:   %L = load i64, ptr %d.sroa.0, align 8
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   %A0 = and i64 %L, 4294967295
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   store i64 %A0, ptr %d.sroa.0, align 8
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   %BC = bitcast i64 %A0 to <2 x i32>
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   %0 = and <2 x i32> %BC, splat (i32 10)
 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x i32> %0, ptr %d.sroa.0, align 8
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:   br label %for.cond1
+; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:   br label %for.cond1
 }

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/cmp-mem.ll b/llvm/test/Analysis/CostModel/SystemZ/cmp-mem.ll
index 7084f8551ba2c..a80f14999b4b3 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/cmp-mem.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/cmp-mem.ll
@@ -7,7 +7,7 @@ define i32 @fun0(ptr %Src, ptr %Dst, i8 %Val) {
 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction:   %Ld = load i8, ptr %Src
 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %Cmp = icmp eq i8 %Ld, 123
 ; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %Ret = zext i1 %Cmp to i32
-; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   ret i32 %Ret
+; CHECK: Cost Model: Found an estimated cost of 0 for instruction:   ret i32 %Ret
   %Ld = load i8, ptr %Src
   %Cmp = icmp eq i8 %Ld, 123
   %Ret = zext i1 %Cmp to i32
@@ -19,7 +19,7 @@ define i32 @fun1(ptr %Src, ptr %Dst, i16 %Val) {
 ; CHECK: Cost Model: Found an estimated cost of 0 for instruction:   %Ld = load i16, ptr %Src
 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %Cmp = icmp eq i16
 ; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %Ret = zext i1 %Cmp to i32
-; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   ret i32 %Ret
+; CHECK: Cost Model: Found an estimated cost of 0 for instruction:   ret i32 %Ret
   %Ld = load i16, ptr %Src
   %Cmp = icmp eq i16 %Ld, 1234
   %Ret = zext i1 %Cmp to i32

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/divrem-pow2.ll b/llvm/test/Analysis/CostModel/SystemZ/divrem-pow2.ll
index ebc8d83b7ac6e..f52a0f4eb386b 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/divrem-pow2.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/divrem-pow2.ll
@@ -12,7 +12,7 @@
 define i64 @fun0(i64 %a) {
 ; COST-LABEL: 'fun0'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i64 %a, 2
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = sdiv i64 %a, 2
   ret i64 %r
@@ -21,7 +21,7 @@ define i64 @fun0(i64 %a) {
 define i64 @fun1(i64 %a) {
 ; COST-LABEL: 'fun1'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i64 %a, -4
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = sdiv i64 %a, -4
   ret i64 %r
@@ -30,7 +30,7 @@ define i64 @fun1(i64 %a) {
 define i32 @fun2(i32 %a) {
 ; COST-LABEL: 'fun2'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i32 %a, 8
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = sdiv i32 %a, 8
   ret i32 %r
@@ -39,7 +39,7 @@ define i32 @fun2(i32 %a) {
 define i32 @fun3(i32 %a) {
 ; COST-LABEL: 'fun3'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i32 %a, -16
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = sdiv i32 %a, -16
   ret i32 %r
@@ -48,7 +48,7 @@ define i32 @fun3(i32 %a) {
 define i16 @fun4(i16 %a) {
 ; COST-LABEL: 'fun4'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i16 %a, 32
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = sdiv i16 %a, 32
   ret i16 %r
@@ -57,7 +57,7 @@ define i16 @fun4(i16 %a) {
 define i16 @fun5(i16 %a) {
 ; COST-LABEL: 'fun5'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i16 %a, -64
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = sdiv i16 %a, -64
   ret i16 %r
@@ -66,7 +66,7 @@ define i16 @fun5(i16 %a) {
 define i8 @fun6(i8 %a) {
 ; COST-LABEL: 'fun6'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i8 %a, 64
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = sdiv i8 %a, 64
   ret i8 %r
@@ -75,7 +75,7 @@ define i8 @fun6(i8 %a) {
 define i8 @fun7(i8 %a) {
 ; COST-LABEL: 'fun7'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv i8 %a, -128
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = sdiv i8 %a, -128
   ret i8 %r
@@ -86,7 +86,7 @@ define i8 @fun7(i8 %a) {
 define <2 x i64> @fun8(<2 x i64> %a) {
 ; COST-LABEL: 'fun8'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <2 x i64> %a, splat (i64 2)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = sdiv <2 x i64> %a, <i64 2, i64 2>
   ret <2 x i64> %r
@@ -95,7 +95,7 @@ define <2 x i64> @fun8(<2 x i64> %a) {
 define <2 x i64> @fun9(<2 x i64> %a) {
 ; COST-LABEL: 'fun9'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <2 x i64> %a, splat (i64 -4)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = sdiv <2 x i64> %a, <i64 -4, i64 -4>
   ret <2 x i64> %r
@@ -104,7 +104,7 @@ define <2 x i64> @fun9(<2 x i64> %a) {
 define <4 x i32> @fun10(<4 x i32> %a) {
 ; COST-LABEL: 'fun10'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <4 x i32> %a, splat (i32 8)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = sdiv <4 x i32> %a, <i32 8, i32 8, i32 8, i32 8>
   ret <4 x i32> %r
@@ -113,7 +113,7 @@ define <4 x i32> @fun10(<4 x i32> %a) {
 define <4 x i32> @fun11(<4 x i32> %a) {
 ; COST-LABEL: 'fun11'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <4 x i32> %a, splat (i32 -16)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = sdiv <4 x i32> %a, <i32 -16, i32 -16, i32 -16, i32 -16>
   ret <4 x i32> %r
@@ -122,7 +122,7 @@ define <4 x i32> @fun11(<4 x i32> %a) {
 define <2 x i32> @fun12(<2 x i32> %a) {
 ; COST-LABEL: 'fun12'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <2 x i32> %a, splat (i32 -16)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = sdiv <2 x i32> %a, <i32 -16, i32 -16>
   ret <2 x i32> %r
@@ -131,7 +131,7 @@ define <2 x i32> @fun12(<2 x i32> %a) {
 define <8 x i16> @fun13(<8 x i16> %a) {
 ; COST-LABEL: 'fun13'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <8 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = sdiv <8 x i16> %a, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
   ret <8 x i16> %r
@@ -140,7 +140,7 @@ define <8 x i16> @fun13(<8 x i16> %a) {
 define <8 x i16> @fun14(<8 x i16> %a) {
 ; COST-LABEL: 'fun14'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <8 x i16> %a, splat (i16 -64)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = sdiv <8 x i16> %a, <i16 -64, i16 -64, i16 -64, i16 -64, i16 -64, i16 -64, i16 -64, i16 -64>
   ret <8 x i16> %r
@@ -149,7 +149,7 @@ define <8 x i16> @fun14(<8 x i16> %a) {
 define <4 x i16> @fun15(<4 x i16> %a) {
 ; COST-LABEL: 'fun15'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <4 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = sdiv <4 x i16> %a, <i16 32, i16 32, i16 32, i16 32>
   ret <4 x i16> %r
@@ -158,7 +158,7 @@ define <4 x i16> @fun15(<4 x i16> %a) {
 define <16 x i8> @fun16(<16 x i8> %a) {
 ; COST-LABEL: 'fun16'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <16 x i8> %a, splat (i8 64)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = sdiv <16 x i8> %a, <i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64>
   ret <16 x i8> %r
@@ -167,7 +167,7 @@ define <16 x i8> @fun16(<16 x i8> %a) {
 define <16 x i8> @fun17(<16 x i8> %a) {
 ; COST-LABEL: 'fun17'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <16 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = sdiv <16 x i8> %a, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
   ret <16 x i8> %r
@@ -176,7 +176,7 @@ define <16 x i8> @fun17(<16 x i8> %a) {
 define <8 x i8> @fun18(<8 x i8> %a) {
 ; COST-LABEL: 'fun18'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = sdiv <8 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = sdiv <8 x i8> %a, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
   ret <8 x i8> %r
@@ -187,7 +187,7 @@ define <8 x i8> @fun18(<8 x i8> %a) {
 define i64 @fun19(i64 %a) {
 ; COST-LABEL: 'fun19'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv i64 %a, 2
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = udiv i64 %a, 2
   ret i64 %r
@@ -196,7 +196,7 @@ define i64 @fun19(i64 %a) {
 define i32 @fun20(i32 %a) {
 ; COST-LABEL: 'fun20'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv i32 %a, 8
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = udiv i32 %a, 8
   ret i32 %r
@@ -205,7 +205,7 @@ define i32 @fun20(i32 %a) {
 define i16 @fun21(i16 %a) {
 ; COST-LABEL: 'fun21'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv i16 %a, 32
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = udiv i16 %a, 32
   ret i16 %r
@@ -214,7 +214,7 @@ define i16 @fun21(i16 %a) {
 define i8 @fun22(i8 %a) {
 ; COST-LABEL: 'fun22'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv i8 %a, -128
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = udiv i8 %a, 128
   ret i8 %r
@@ -225,7 +225,7 @@ define i8 @fun22(i8 %a) {
 define <2 x i64> @fun23(<2 x i64> %a) {
 ; COST-LABEL: 'fun23'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <2 x i64> %a, splat (i64 2)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = udiv <2 x i64> %a, <i64 2, i64 2>
   ret <2 x i64> %r
@@ -234,7 +234,7 @@ define <2 x i64> @fun23(<2 x i64> %a) {
 define <4 x i32> @fun24(<4 x i32> %a) {
 ; COST-LABEL: 'fun24'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <4 x i32> %a, splat (i32 8)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = udiv <4 x i32> %a, <i32 8, i32 8, i32 8, i32 8>
   ret <4 x i32> %r
@@ -243,7 +243,7 @@ define <4 x i32> @fun24(<4 x i32> %a) {
 define <2 x i32> @fun25(<2 x i32> %a) {
 ; COST-LABEL: 'fun25'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <2 x i32> %a, splat (i32 8)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = udiv <2 x i32> %a, <i32 8, i32 8>
   ret <2 x i32> %r
@@ -252,7 +252,7 @@ define <2 x i32> @fun25(<2 x i32> %a) {
 define <8 x i16> @fun26(<8 x i16> %a) {
 ; COST-LABEL: 'fun26'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <8 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = udiv <8 x i16> %a, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
   ret <8 x i16> %r
@@ -261,7 +261,7 @@ define <8 x i16> @fun26(<8 x i16> %a) {
 define <4 x i16> @fun27(<4 x i16> %a) {
 ; COST-LABEL: 'fun27'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <4 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = udiv <4 x i16> %a, <i16 32, i16 32, i16 32, i16 32>
   ret <4 x i16> %r
@@ -270,7 +270,7 @@ define <4 x i16> @fun27(<4 x i16> %a) {
 define <16 x i8> @fun28(<16 x i8> %a) {
 ; COST-LABEL: 'fun28'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <16 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = udiv <16 x i8> %a, <i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128>
   ret <16 x i8> %r
@@ -279,7 +279,7 @@ define <16 x i8> @fun28(<16 x i8> %a) {
 define <8 x i8> @fun29(<8 x i8> %a) {
 ; COST-LABEL: 'fun29'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = udiv <8 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = udiv <8 x i8> %a, <i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128>
   ret <8 x i8> %r
@@ -290,7 +290,7 @@ define <8 x i8> @fun29(<8 x i8> %a) {
 define i64 @fun30(i64 %a) {
 ; COST-LABEL: 'fun30'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i64 %a, 2
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = srem i64 %a, 2
   ret i64 %r
@@ -299,7 +299,7 @@ define i64 @fun30(i64 %a) {
 define i64 @fun31(i64 %a) {
 ; COST-LABEL: 'fun31'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i64 %a, -4
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = srem i64 %a, -4
   ret i64 %r
@@ -308,7 +308,7 @@ define i64 @fun31(i64 %a) {
 define i32 @fun32(i32 %a) {
 ; COST-LABEL: 'fun32'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i32 %a, 8
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = srem i32 %a, 8
   ret i32 %r
@@ -317,7 +317,7 @@ define i32 @fun32(i32 %a) {
 define i32 @fun33(i32 %a) {
 ; COST-LABEL: 'fun33'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i32 %a, -16
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = srem i32 %a, -16
   ret i32 %r
@@ -326,7 +326,7 @@ define i32 @fun33(i32 %a) {
 define i16 @fun34(i16 %a) {
 ; COST-LABEL: 'fun34'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i16 %a, 32
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = srem i16 %a, 32
   ret i16 %r
@@ -335,7 +335,7 @@ define i16 @fun34(i16 %a) {
 define i16 @fun35(i16 %a) {
 ; COST-LABEL: 'fun35'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i16 %a, -64
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = srem i16 %a, -64
   ret i16 %r
@@ -344,7 +344,7 @@ define i16 @fun35(i16 %a) {
 define i8 @fun36(i8 %a) {
 ; COST-LABEL: 'fun36'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i8 %a, 64
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = srem i8 %a, 64
   ret i8 %r
@@ -353,7 +353,7 @@ define i8 @fun36(i8 %a) {
 define i8 @fun37(i8 %a) {
 ; COST-LABEL: 'fun37'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem i8 %a, -128
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = srem i8 %a, -128
   ret i8 %r
@@ -364,7 +364,7 @@ define i8 @fun37(i8 %a) {
 define <2 x i64> @fun38(<2 x i64> %a) {
 ; COST-LABEL: 'fun38'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <2 x i64> %a, splat (i64 2)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = srem <2 x i64> %a, <i64 2, i64 2>
   ret <2 x i64> %r
@@ -373,7 +373,7 @@ define <2 x i64> @fun38(<2 x i64> %a) {
 define <2 x i64> @fun39(<2 x i64> %a) {
 ; COST-LABEL: 'fun39'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <2 x i64> %a, splat (i64 -4)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = srem <2 x i64> %a, <i64 -4, i64 -4>
   ret <2 x i64> %r
@@ -382,7 +382,7 @@ define <2 x i64> @fun39(<2 x i64> %a) {
 define <4 x i32> @fun40(<4 x i32> %a) {
 ; COST-LABEL: 'fun40'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <4 x i32> %a, splat (i32 8)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = srem <4 x i32> %a, <i32 8, i32 8, i32 8, i32 8>
   ret <4 x i32> %r
@@ -391,7 +391,7 @@ define <4 x i32> @fun40(<4 x i32> %a) {
 define <4 x i32> @fun41(<4 x i32> %a) {
 ; COST-LABEL: 'fun41'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <4 x i32> %a, splat (i32 -16)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = srem <4 x i32> %a, <i32 -16, i32 -16, i32 -16, i32 -16>
   ret <4 x i32> %r
@@ -400,7 +400,7 @@ define <4 x i32> @fun41(<4 x i32> %a) {
 define <2 x i32> @fun42(<2 x i32> %a) {
 ; COST-LABEL: 'fun42'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <2 x i32> %a, splat (i32 -16)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = srem <2 x i32> %a, <i32 -16, i32 -16>
   ret <2 x i32> %r
@@ -409,7 +409,7 @@ define <2 x i32> @fun42(<2 x i32> %a) {
 define <8 x i16> @fun43(<8 x i16> %a) {
 ; COST-LABEL: 'fun43'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <8 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = srem <8 x i16> %a, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
   ret <8 x i16> %r
@@ -418,7 +418,7 @@ define <8 x i16> @fun43(<8 x i16> %a) {
 define <8 x i16> @fun44(<8 x i16> %a) {
 ; COST-LABEL: 'fun44'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <8 x i16> %a, splat (i16 -64)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = srem <8 x i16> %a, <i16 -64, i16 -64, i16 -64, i16 -64, i16 -64, i16 -64, i16 -64, i16 -64>
   ret <8 x i16> %r
@@ -427,7 +427,7 @@ define <8 x i16> @fun44(<8 x i16> %a) {
 define <4 x i16> @fun45(<4 x i16> %a) {
 ; COST-LABEL: 'fun45'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <4 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = srem <4 x i16> %a, <i16 32, i16 32, i16 32, i16 32>
   ret <4 x i16> %r
@@ -436,7 +436,7 @@ define <4 x i16> @fun45(<4 x i16> %a) {
 define <16 x i8> @fun46(<16 x i8> %a) {
 ; COST-LABEL: 'fun46'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <16 x i8> %a, splat (i8 64)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = srem <16 x i8> %a, <i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64>
   ret <16 x i8> %r
@@ -445,7 +445,7 @@ define <16 x i8> @fun46(<16 x i8> %a) {
 define <16 x i8> @fun47(<16 x i8> %a) {
 ; COST-LABEL: 'fun47'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <16 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = srem <16 x i8> %a, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
   ret <16 x i8> %r
@@ -454,7 +454,7 @@ define <16 x i8> @fun47(<16 x i8> %a) {
 define <8 x i8> @fun48(<8 x i8> %a) {
 ; COST-LABEL: 'fun48'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %r = srem <8 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = srem <8 x i8> %a, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
   ret <8 x i8> %r
@@ -465,7 +465,7 @@ define <8 x i8> @fun48(<8 x i8> %a) {
 define i64 @fun49(i64 %a) {
 ; COST-LABEL: 'fun49'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem i64 %a, 2
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = urem i64 %a, 2
   ret i64 %r
@@ -474,7 +474,7 @@ define i64 @fun49(i64 %a) {
 define i32 @fun50(i32 %a) {
 ; COST-LABEL: 'fun50'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem i32 %a, 8
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = urem i32 %a, 8
   ret i32 %r
@@ -483,7 +483,7 @@ define i32 @fun50(i32 %a) {
 define i16 @fun51(i16 %a) {
 ; COST-LABEL: 'fun51'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem i16 %a, 32
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = urem i16 %a, 32
   ret i16 %r
@@ -492,7 +492,7 @@ define i16 @fun51(i16 %a) {
 define i8 @fun52(i8 %a) {
 ; COST-LABEL: 'fun52'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem i8 %a, -128
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = urem i8 %a, 128
   ret i8 %r
@@ -503,7 +503,7 @@ define i8 @fun52(i8 %a) {
 define <2 x i64> @fun53(<2 x i64> %a) {
 ; COST-LABEL: 'fun53'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <2 x i64> %a, splat (i64 2)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = urem <2 x i64> %a, <i64 2, i64 2>
   ret <2 x i64> %r
@@ -512,7 +512,7 @@ define <2 x i64> @fun53(<2 x i64> %a) {
 define <4 x i32> @fun54(<4 x i32> %a) {
 ; COST-LABEL: 'fun54'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <4 x i32> %a, splat (i32 8)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = urem <4 x i32> %a, <i32 8, i32 8, i32 8, i32 8>
   ret <4 x i32> %r
@@ -521,7 +521,7 @@ define <4 x i32> @fun54(<4 x i32> %a) {
 define <2 x i32> @fun55(<2 x i32> %a) {
 ; COST-LABEL: 'fun55'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <2 x i32> %a, splat (i32 8)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = urem <2 x i32> %a, <i32 8, i32 8>
   ret <2 x i32> %r
@@ -530,7 +530,7 @@ define <2 x i32> @fun55(<2 x i32> %a) {
 define <8 x i16> @fun56(<8 x i16> %a) {
 ; COST-LABEL: 'fun56'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <8 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = urem <8 x i16> %a, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
   ret <8 x i16> %r
@@ -539,7 +539,7 @@ define <8 x i16> @fun56(<8 x i16> %a) {
 define <4 x i16> @fun57(<4 x i16> %a) {
 ; COST-LABEL: 'fun57'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <4 x i16> %a, splat (i16 32)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = urem <4 x i16> %a, <i16 32, i16 32, i16 32, i16 32>
   ret <4 x i16> %r
@@ -548,7 +548,7 @@ define <4 x i16> @fun57(<4 x i16> %a) {
 define <16 x i8> @fun58(<16 x i8> %a) {
 ; COST-LABEL: 'fun58'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <16 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = urem <16 x i8> %a, <i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128>
   ret <16 x i8> %r
@@ -557,7 +557,7 @@ define <16 x i8> @fun58(<16 x i8> %a) {
 define <8 x i8> @fun59(<8 x i8> %a) {
 ; COST-LABEL: 'fun59'
 ; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r = urem <8 x i8> %a, splat (i8 -128)
-; COST-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; COST-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = urem <8 x i8> %a, <i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128, i8 128>
   ret <8 x i8> %r

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/divrem-reg.ll b/llvm/test/Analysis/CostModel/SystemZ/divrem-reg.ll
index 68ffe5759e135..5d948a44db114 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/divrem-reg.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/divrem-reg.ll
@@ -12,7 +12,7 @@
 define i64 @fun0(i64 %a, i64 %b) {
 ; CHECK-LABEL: 'fun0'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv i64 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = sdiv i64 %a, %b
   ret i64 %r
@@ -21,7 +21,7 @@ define i64 @fun0(i64 %a, i64 %b) {
 define i32 @fun1(i32 %a, i32 %b) {
 ; CHECK-LABEL: 'fun1'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv i32 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = sdiv i32 %a, %b
   ret i32 %r
@@ -30,7 +30,7 @@ define i32 @fun1(i32 %a, i32 %b) {
 define i16 @fun2(i16 %a, i16 %b) {
 ; CHECK-LABEL: 'fun2'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv i16 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = sdiv i16 %a, %b
   ret i16 %r
@@ -39,7 +39,7 @@ define i16 @fun2(i16 %a, i16 %b) {
 define i8 @fun3(i8 %a, i8 %b) {
 ; CHECK-LABEL: 'fun3'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv i8 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = sdiv i8 %a, %b
   ret i8 %r
@@ -50,11 +50,11 @@ define i8 @fun3(i8 %a, i8 %b) {
 define <2 x i64> @fun4(<2 x i64> %a, <2 x i64> %b) {
 ; Z13-LABEL: 'fun4'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %r = sdiv <2 x i64> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
 ; Z17-LABEL: 'fun4'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv <2 x i64> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = sdiv <2 x i64> %a, %b
   ret <2 x i64> %r
@@ -63,11 +63,11 @@ define <2 x i64> @fun4(<2 x i64> %a, <2 x i64> %b) {
 define <4 x i32> @fun5(<4 x i32> %a, <4 x i32> %b) {
 ; Z13-LABEL: 'fun5'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = sdiv <4 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
 ; Z17-LABEL: 'fun5'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv <4 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = sdiv <4 x i32> %a, %b
   ret <4 x i32> %r
@@ -76,11 +76,11 @@ define <4 x i32> @fun5(<4 x i32> %a, <4 x i32> %b) {
 define <2 x i32> @fun6(<2 x i32> %a, <2 x i32> %b) {
 ; Z13-LABEL: 'fun6'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %r = sdiv <2 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
 ; Z17-LABEL: 'fun6'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = sdiv <2 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = sdiv <2 x i32> %a, %b
   ret <2 x i32> %r
@@ -89,7 +89,7 @@ define <2 x i32> @fun6(<2 x i32> %a, <2 x i32> %b) {
 define <8 x i16> @fun7(<8 x i16> %a, <8 x i16> %b) {
 ; CHECK-LABEL: 'fun7'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = sdiv <8 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = sdiv <8 x i16> %a, %b
   ret <8 x i16> %r
@@ -98,7 +98,7 @@ define <8 x i16> @fun7(<8 x i16> %a, <8 x i16> %b) {
 define <4 x i16> @fun8(<4 x i16> %a, <4 x i16> %b) {
 ; CHECK-LABEL: 'fun8'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = sdiv <4 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = sdiv <4 x i16> %a, %b
   ret <4 x i16> %r
@@ -107,7 +107,7 @@ define <4 x i16> @fun8(<4 x i16> %a, <4 x i16> %b) {
 define <16 x i8> @fun9(<16 x i8> %a, <16 x i8> %b) {
 ; CHECK-LABEL: 'fun9'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = sdiv <16 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = sdiv <16 x i8> %a, %b
   ret <16 x i8> %r
@@ -116,7 +116,7 @@ define <16 x i8> @fun9(<16 x i8> %a, <16 x i8> %b) {
 define <8 x i8> @fun10(<8 x i8> %a, <8 x i8> %b) {
 ; CHECK-LABEL: 'fun10'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = sdiv <8 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = sdiv <8 x i8> %a, %b
   ret <8 x i8> %r
@@ -127,7 +127,7 @@ define <8 x i8> @fun10(<8 x i8> %a, <8 x i8> %b) {
 define i64 @fun11(i64 %a, i64 %b) {
 ; CHECK-LABEL: 'fun11'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv i64 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = udiv i64 %a, %b
   ret i64 %r
@@ -136,7 +136,7 @@ define i64 @fun11(i64 %a, i64 %b) {
 define i32 @fun12(i32 %a, i32 %b) {
 ; CHECK-LABEL: 'fun12'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv i32 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = udiv i32 %a, %b
   ret i32 %r
@@ -145,7 +145,7 @@ define i32 @fun12(i32 %a, i32 %b) {
 define i16 @fun13(i16 %a, i16 %b) {
 ; CHECK-LABEL: 'fun13'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv i16 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = udiv i16 %a, %b
   ret i16 %r
@@ -154,7 +154,7 @@ define i16 @fun13(i16 %a, i16 %b) {
 define i8 @fun14(i8 %a, i8 %b) {
 ; CHECK-LABEL: 'fun14'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv i8 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = udiv i8 %a, %b
   ret i8 %r
@@ -165,11 +165,11 @@ define i8 @fun14(i8 %a, i8 %b) {
 define <2 x i64> @fun15(<2 x i64> %a, <2 x i64> %b) {
 ; Z13-LABEL: 'fun15'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %r = udiv <2 x i64> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
 ; Z17-LABEL: 'fun15'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv <2 x i64> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = udiv <2 x i64> %a, %b
   ret <2 x i64> %r
@@ -178,11 +178,11 @@ define <2 x i64> @fun15(<2 x i64> %a, <2 x i64> %b) {
 define <4 x i32> @fun16(<4 x i32> %a, <4 x i32> %b) {
 ; Z13-LABEL: 'fun16'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = udiv <4 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
 ; Z17-LABEL: 'fun16'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv <4 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = udiv <4 x i32> %a, %b
   ret <4 x i32> %r
@@ -191,11 +191,11 @@ define <4 x i32> @fun16(<4 x i32> %a, <4 x i32> %b) {
 define <2 x i32> @fun17(<2 x i32> %a, <2 x i32> %b) {
 ; Z13-LABEL: 'fun17'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %r = udiv <2 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
 ; Z17-LABEL: 'fun17'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = udiv <2 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = udiv <2 x i32> %a, %b
   ret <2 x i32> %r
@@ -204,7 +204,7 @@ define <2 x i32> @fun17(<2 x i32> %a, <2 x i32> %b) {
 define <8 x i16> @fun18(<8 x i16> %a, <8 x i16> %b) {
 ; CHECK-LABEL: 'fun18'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = udiv <8 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = udiv <8 x i16> %a, %b
   ret <8 x i16> %r
@@ -213,7 +213,7 @@ define <8 x i16> @fun18(<8 x i16> %a, <8 x i16> %b) {
 define <4 x i16> @fun19(<4 x i16> %a, <4 x i16> %b) {
 ; CHECK-LABEL: 'fun19'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = udiv <4 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = udiv <4 x i16> %a, %b
   ret <4 x i16> %r
@@ -222,7 +222,7 @@ define <4 x i16> @fun19(<4 x i16> %a, <4 x i16> %b) {
 define <16 x i8> @fun20(<16 x i8> %a, <16 x i8> %b) {
 ; CHECK-LABEL: 'fun20'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = udiv <16 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = udiv <16 x i8> %a, %b
   ret <16 x i8> %r
@@ -231,7 +231,7 @@ define <16 x i8> @fun20(<16 x i8> %a, <16 x i8> %b) {
 define <8 x i8> @fun21(<8 x i8> %a, <8 x i8> %b) {
 ; CHECK-LABEL: 'fun21'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = udiv <8 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = udiv <8 x i8> %a, %b
   ret <8 x i8> %r
@@ -242,7 +242,7 @@ define <8 x i8> @fun21(<8 x i8> %a, <8 x i8> %b) {
 define i64 @fun22(i64 %a, i64 %b) {
 ; CHECK-LABEL: 'fun22'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem i64 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = srem i64 %a, %b
   ret i64 %r
@@ -251,7 +251,7 @@ define i64 @fun22(i64 %a, i64 %b) {
 define i32 @fun23(i32 %a, i32 %b) {
 ; CHECK-LABEL: 'fun23'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem i32 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = srem i32 %a, %b
   ret i32 %r
@@ -260,7 +260,7 @@ define i32 @fun23(i32 %a, i32 %b) {
 define i16 @fun24(i16 %a, i16 %b) {
 ; CHECK-LABEL: 'fun24'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem i16 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = srem i16 %a, %b
   ret i16 %r
@@ -269,7 +269,7 @@ define i16 @fun24(i16 %a, i16 %b) {
 define i8 @fun25(i8 %a, i8 %b) {
 ; CHECK-LABEL: 'fun25'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem i8 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = srem i8 %a, %b
   ret i8 %r
@@ -280,11 +280,11 @@ define i8 @fun25(i8 %a, i8 %b) {
 define <2 x i64> @fun26(<2 x i64> %a, <2 x i64> %b) {
 ; Z13-LABEL: 'fun26'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %r = srem <2 x i64> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
 ; Z17-LABEL: 'fun26'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem <2 x i64> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = srem <2 x i64> %a, %b
   ret <2 x i64> %r
@@ -293,11 +293,11 @@ define <2 x i64> @fun26(<2 x i64> %a, <2 x i64> %b) {
 define <4 x i32> @fun27(<4 x i32> %a, <4 x i32> %b) {
 ; Z13-LABEL: 'fun27'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = srem <4 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
 ; Z17-LABEL: 'fun27'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem <4 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = srem <4 x i32> %a, %b
   ret <4 x i32> %r
@@ -306,11 +306,11 @@ define <4 x i32> @fun27(<4 x i32> %a, <4 x i32> %b) {
 define <2 x i32> @fun28(<2 x i32> %a, <2 x i32> %b) {
 ; Z13-LABEL: 'fun28'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %r = srem <2 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
 ; Z17-LABEL: 'fun28'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = srem <2 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = srem <2 x i32> %a, %b
   ret <2 x i32> %r
@@ -319,7 +319,7 @@ define <2 x i32> @fun28(<2 x i32> %a, <2 x i32> %b) {
 define <8 x i16> @fun29(<8 x i16> %a, <8 x i16> %b) {
 ; CHECK-LABEL: 'fun29'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = srem <8 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = srem <8 x i16> %a, %b
   ret <8 x i16> %r
@@ -328,7 +328,7 @@ define <8 x i16> @fun29(<8 x i16> %a, <8 x i16> %b) {
 define <4 x i16> @fun30(<4 x i16> %a, <4 x i16> %b) {
 ; CHECK-LABEL: 'fun30'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = srem <4 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = srem <4 x i16> %a, %b
   ret <4 x i16> %r
@@ -337,7 +337,7 @@ define <4 x i16> @fun30(<4 x i16> %a, <4 x i16> %b) {
 define <16 x i8> @fun31(<16 x i8> %a, <16 x i8> %b) {
 ; CHECK-LABEL: 'fun31'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = srem <16 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = srem <16 x i8> %a, %b
   ret <16 x i8> %r
@@ -346,7 +346,7 @@ define <16 x i8> @fun31(<16 x i8> %a, <16 x i8> %b) {
 define <8 x i8> @fun32(<8 x i8> %a, <8 x i8> %b) {
 ; CHECK-LABEL: 'fun32'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = srem <8 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = srem <8 x i8> %a, %b
   ret <8 x i8> %r
@@ -357,7 +357,7 @@ define <8 x i8> @fun32(<8 x i8> %a, <8 x i8> %b) {
 define i64 @fun33(i64 %a, i64 %b) {
 ; CHECK-LABEL: 'fun33'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem i64 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %r
 ;
   %r = urem i64 %a, %b
   ret i64 %r
@@ -366,7 +366,7 @@ define i64 @fun33(i64 %a, i64 %b) {
 define i32 @fun34(i32 %a, i32 %b) {
 ; CHECK-LABEL: 'fun34'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem i32 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
 ;
   %r = urem i32 %a, %b
   ret i32 %r
@@ -375,7 +375,7 @@ define i32 @fun34(i32 %a, i32 %b) {
 define i16 @fun35(i16 %a, i16 %b) {
 ; CHECK-LABEL: 'fun35'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem i16 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i16 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %r
 ;
   %r = urem i16 %a, %b
   ret i16 %r
@@ -384,7 +384,7 @@ define i16 @fun35(i16 %a, i16 %b) {
 define i8 @fun36(i8 %a, i8 %b) {
 ; CHECK-LABEL: 'fun36'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem i8 %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i8 %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %r
 ;
   %r = urem i8 %a, %b
   ret i8 %r
@@ -395,11 +395,11 @@ define i8 @fun36(i8 %a, i8 %b) {
 define <2 x i64> @fun37(<2 x i64> %a, <2 x i64> %b) {
 ; Z13-LABEL: 'fun37'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 47 for instruction: %r = urem <2 x i64> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
 ; Z17-LABEL: 'fun37'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem <2 x i64> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %r
 ;
   %r = urem <2 x i64> %a, %b
   ret <2 x i64> %r
@@ -408,11 +408,11 @@ define <2 x i64> @fun37(<2 x i64> %a, <2 x i64> %b) {
 define <4 x i32> @fun38(<4 x i32> %a, <4 x i32> %b) {
 ; Z13-LABEL: 'fun38'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = urem <4 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
 ; Z17-LABEL: 'fun38'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem <4 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %r
 ;
   %r = urem <4 x i32> %a, %b
   ret <4 x i32> %r
@@ -421,11 +421,11 @@ define <4 x i32> @fun38(<4 x i32> %a, <4 x i32> %b) {
 define <2 x i32> @fun39(<2 x i32> %a, <2 x i32> %b) {
 ; Z13-LABEL: 'fun39'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %r = urem <2 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
 ; Z17-LABEL: 'fun39'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %r = urem <2 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %r
 ;
   %r = urem <2 x i32> %a, %b
   ret <2 x i32> %r
@@ -434,7 +434,7 @@ define <2 x i32> @fun39(<2 x i32> %a, <2 x i32> %b) {
 define <8 x i16> @fun40(<8 x i16> %a, <8 x i16> %b) {
 ; CHECK-LABEL: 'fun40'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = urem <8 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %r
 ;
   %r = urem <8 x i16> %a, %b
   ret <8 x i16> %r
@@ -443,7 +443,7 @@ define <8 x i16> @fun40(<8 x i16> %a, <8 x i16> %b) {
 define <4 x i16> @fun41(<4 x i16> %a, <4 x i16> %b) {
 ; CHECK-LABEL: 'fun41'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 94 for instruction: %r = urem <4 x i16> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %r
 ;
   %r = urem <4 x i16> %a, %b
   ret <4 x i16> %r
@@ -452,7 +452,7 @@ define <4 x i16> @fun41(<4 x i16> %a, <4 x i16> %b) {
 define <16 x i8> @fun42(<16 x i8> %a, <16 x i8> %b) {
 ; CHECK-LABEL: 'fun42'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = urem <16 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %r
 ;
   %r = urem <16 x i8> %a, %b
   ret <16 x i8> %r
@@ -461,7 +461,7 @@ define <16 x i8> @fun42(<16 x i8> %a, <16 x i8> %b) {
 define <8 x i8> @fun43(<8 x i8> %a, <8 x i8> %b) {
 ; CHECK-LABEL: 'fun43'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = urem <8 x i8> %a, %b
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %r
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %r
 ;
   %r = urem <8 x i8> %a, %b
   ret <8 x i8> %r
@@ -471,11 +471,11 @@ define <8 x i8> @fun43(<8 x i8> %a, <8 x i8> %b) {
 define <8 x i64> @fun44(<8 x i64> %a, <8 x i64> %b) {
 ; Z13-LABEL: 'fun44'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = sdiv <8 x i64> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %r
 ;
 ; Z17-LABEL: 'fun44'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %r = sdiv <8 x i64> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %r
 ;
   %r = sdiv <8 x i64> %a, %b
   ret <8 x i64> %r
@@ -484,11 +484,11 @@ define <8 x i64> @fun44(<8 x i64> %a, <8 x i64> %b) {
 define <8 x i32> @fun45(<8 x i32> %a, <8 x i32> %b) {
 ; Z13-LABEL: 'fun45'
 ; Z13-NEXT:  Cost Model: Found an estimated cost of 1000 for instruction: %r = urem <8 x i32> %a, %b
-; Z13-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %r
+; Z13-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %r
 ;
 ; Z17-LABEL: 'fun45'
 ; Z17-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %r = urem <8 x i32> %a, %b
-; Z17-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %r
+; Z17-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %r
 ;
   %r = urem <8 x i32> %a, %b
   ret <8 x i32> %r

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/int-operands-extcost.ll b/llvm/test/Analysis/CostModel/SystemZ/int-operands-extcost.ll
index 2f8743a5f5ae6..fcfb208c9483c 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/int-operands-extcost.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/int-operands-extcost.ll
@@ -41,5 +41,5 @@ define void @icmp() {
 ; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %a3 = add i16 %li16_1, 1
 ; CHECK: Cost Model: Found an estimated cost of 3 for instruction:   %5 = icmp slt i16 %a2, %a3
 ; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %6 = icmp slt i16 %a2, 123
-; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   ret void
+; CHECK: Cost Model: Found an estimated cost of 0 for instruction:   ret void
 }

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/logicalop.ll b/llvm/test/Analysis/CostModel/SystemZ/logicalop.ll
index 3c3fa0b530dd8..0512e8f76ff35 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/logicalop.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/logicalop.ll
@@ -9,7 +9,7 @@ define void @op() {
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %band = and i1 undef, undef
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sor = select i1 undef, i1 true, i1 undef
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bor = or i1 undef, undef
-; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; CHECK-SIZE-LABEL: 'op'
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sand = select i1 undef, i1 undef, i1 false
@@ -32,7 +32,7 @@ define void @vecop() {
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %band = and <4 x i1> undef, undef
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sor = select <4 x i1> undef, <4 x i1> splat (i1 true), <4 x i1> undef
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bor = or <4 x i1> undef, undef
-; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
 ; CHECK-SIZE-LABEL: 'vecop'
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %sand = select <4 x i1> undef, <4 x i1> undef, <4 x i1> zeroinitializer

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/reduce-and.ll b/llvm/test/Analysis/CostModel/SystemZ/reduce-and.ll
index 064d03edf171b..4dda90c675639 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/reduce-and.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/reduce-and.ll
@@ -11,7 +11,7 @@ define i32 @reduce_i1(i32 %arg) {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 66 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 130 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 258 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
 ;
   %V1   = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
   %V2   = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/reduce-or.ll b/llvm/test/Analysis/CostModel/SystemZ/reduce-or.ll
index 5f464f6077498..bb29b8b15b799 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/reduce-or.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/reduce-or.ll
@@ -11,7 +11,7 @@ define i32 @reduce_i1(i32 %arg) {
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 66 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 130 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 258 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
 ;
   %V1   = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
   %V2   = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll b/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
index bad23baff2d1c..b7783e91cb243 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
@@ -11,10 +11,10 @@ declare { i64, i32 } @bar()
 
 define i8 @foo() {
 ; CHECK-LABEL: 'foo'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: br label %1
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %1
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = call { i64, i32 } @bar()
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: br label %1
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: br label %1
 ;
   br label %1
 

diff  --git a/llvm/test/Analysis/CostModel/SystemZ/vector-reductions.ll b/llvm/test/Analysis/CostModel/SystemZ/vector-reductions.ll
index 0def20215e988..6422364f9674a 100644
--- a/llvm/test/Analysis/CostModel/SystemZ/vector-reductions.ll
+++ b/llvm/test/Analysis/CostModel/SystemZ/vector-reductions.ll
@@ -9,7 +9,7 @@ define void @fadd_reductions() {
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %fadd_v2f64 = call double @llvm.vector.reduce.fadd.v2f64(double 0.000000e+00, <2 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %fadd_v4f64 = call double @llvm.vector.reduce.fadd.v4f64(double 0.000000e+00, <4 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %fadd_v4f128 = call fp128 @llvm.vector.reduce.fadd.v4f128(fp128 undef, <4 x fp128> undef)
-; Z15-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; Z15-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
   %fadd_v4f32 = call float @llvm.vector.reduce.fadd.v4f32(float 0.0, <4 x float> undef)
   %fadd_v8f32 = call float @llvm.vector.reduce.fadd.v8f32(float 0.0, <8 x float> undef)
@@ -26,7 +26,7 @@ define void @fast_fadd_reductions(ptr %src, ptr %dst) {
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %fadd_v2f64 = call fast double @llvm.vector.reduce.fadd.v2f64(double 0.000000e+00, <2 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %fadd_v4f64 = call fast double @llvm.vector.reduce.fadd.v4f64(double 0.000000e+00, <4 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %fadd_v4f128 = call fast fp128 @llvm.vector.reduce.fadd.v4f128(fp128 undef, <4 x fp128> undef)
-; Z15-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; Z15-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
   %fadd_v4f32 = call fast float @llvm.vector.reduce.fadd.v4f32(float 0.0, <4 x float> undef)
   %fadd_v8f32 = call fast float @llvm.vector.reduce.fadd.v8f32(float 0.0, <8 x float> undef)
@@ -43,7 +43,7 @@ define void @fmul_reductions() {
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %fmul_v2f64 = call double @llvm.vector.reduce.fmul.v2f64(double 0.000000e+00, <2 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %fmul_v4f64 = call double @llvm.vector.reduce.fmul.v4f64(double 0.000000e+00, <4 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %fmul_v4f128 = call fp128 @llvm.vector.reduce.fmul.v4f128(fp128 undef, <4 x fp128> undef)
-; Z15-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; Z15-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
   %fmul_v4f32 = call float @llvm.vector.reduce.fmul.v4f32(float 0.0, <4 x float> undef)
   %fmul_v8f32 = call float @llvm.vector.reduce.fmul.v8f32(float 0.0, <8 x float> undef)
@@ -60,7 +60,7 @@ define void @fast_fmul_reductions() {
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %fmul_v2f64 = call fast double @llvm.vector.reduce.fmul.v2f64(double 0.000000e+00, <2 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %fmul_v4f64 = call fast double @llvm.vector.reduce.fmul.v4f64(double 0.000000e+00, <4 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %fadd_v4f128 = call fast fp128 @llvm.vector.reduce.fmul.v4f128(fp128 undef, <4 x fp128> undef)
-; Z15-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; Z15-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
   %fmul_v4f32 = call fast float @llvm.vector.reduce.fmul.v4f32(float 0.0, <4 x float> undef)
   %fmul_v8f32 = call fast float @llvm.vector.reduce.fmul.v8f32(float 0.0, <8 x float> undef)
@@ -78,7 +78,7 @@ define void @fmin_reductions() {
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call double @llvm.vector.reduce.fmin.v2f64(<2 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4f64 = call double @llvm.vector.reduce.fmin.v4f64(<4 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4f128 = call fp128 @llvm.vector.reduce.fmin.v4f128(<4 x fp128> undef)
-; Z15-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; Z15-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
   %V4f32 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> undef)
   %V8f32 = call float @llvm.vector.reduce.fmin.v8f32(<8 x float> undef)
@@ -95,7 +95,7 @@ define void @fmax_reductions() {
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call double @llvm.vector.reduce.fmax.v2f64(<2 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4f64 = call double @llvm.vector.reduce.fmax.v4f64(<4 x double> undef)
 ; Z15-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4f128 = call fp128 @llvm.vector.reduce.fmax.v4f128(<4 x fp128> undef)
-; Z15-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
+; Z15-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
 ;
   %V4f32 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> undef)
   %V8f32 = call float @llvm.vector.reduce.fmax.v8f32(<8 x float> undef)

diff  --git a/llvm/test/Transforms/LoopVectorize/SystemZ/branch-for-predicated-block.ll b/llvm/test/Transforms/LoopVectorize/SystemZ/branch-for-predicated-block.ll
index 677b94163592d..7678c06a04759 100644
--- a/llvm/test/Transforms/LoopVectorize/SystemZ/branch-for-predicated-block.ll
+++ b/llvm/test/Transforms/LoopVectorize/SystemZ/branch-for-predicated-block.ll
@@ -35,5 +35,5 @@ for.end.loopexit:
 ; CHECK: Cost of 1 for VF 2: profitable to scalarize   store i32 %sub, ptr %arrayidx, align 4
 ; CHECK: Cost of 2 for VF 2: profitable to scalarize   %sub = sub nsw i32 0, %l
 ; CHECK: Cost of 1 for VF 2: WIDEN ir<%cmp55> = icmp sgt ir<%l>, ir<0>
-; CHECK: Cost of 1 for VF 2: vector loop backedge
+; CHECK: Cost of 0 for VF 2: vector loop backedge
 }

diff  --git a/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll b/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll
index bf837c413492c..0a4fbc54a954c 100644
--- a/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll
+++ b/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll
@@ -1,5 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -p loop-vectorize -mtriple=s390x-unknown-linux -mcpu=z16 -S %s | FileCheck %s
+; RUN: opt -p loop-vectorize -mtriple=s390x-unknown-linux -mcpu=z16 -S %s \
+; RUN:     -force-target-instruction-cost=1 | FileCheck %s
 
 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
 


        


More information about the llvm-commits mailing list