diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp --- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp @@ -1107,11 +1107,24 @@ TTI::TargetCostKind CostKind, TTI::OperandValueInfo OpInfo, const Instruction *I) { + EVT VT = TLI->getValueType(DL, Src, true); + // Type legalization can't handle structs + if (VT == MVT::Other) + return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, + CostKind, OpInfo, I); InstructionCost Cost = 0; if (Opcode == Instruction::Store && OpInfo.isConstant()) Cost += getStoreImmCost(Src, OpInfo, CostKind); - return Cost + BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, - CostKind, OpInfo, I); + + std::pair LT = getTypeLegalizationCost(Src); + if (!LT.second.isVector()) + return Cost + BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, + CostKind, OpInfo, I); + if (CostKind == TTI::TCK_CodeSize) + return Cost + BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, + CostKind, OpInfo, I); + Cost += LT.first * getLMULCost(LT.second); + return Cost; } InstructionCost RISCVTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, diff --git a/llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll b/llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll --- a/llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll +++ b/llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll @@ -19,7 +19,7 @@ ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f32 = call <2 x float> @llvm.masked.load.v2f32.p0(ptr undef, i32 8, <2 x i1> undef, <2 x float> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4f32 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr undef, i32 8, <4 x i1> undef, <4 x float> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v2f64 = call <2 x double> @llvm.masked.load.v2f64.p0(ptr undef, i32 8, <2 x i1> undef, <2 x double> undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v4i64 = call <4 x i64> @llvm.masked.load.v4i64.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i64> undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v4i64 = call <4 x i64> @llvm.masked.load.v4i64.p0(ptr undef, i32 8, <4 x i1> undef, <4 x i64> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %v32f16 = call <32 x half> @llvm.masked.load.v32f16.p0(ptr undef, i32 8, <32 x i1> undef, <32 x half> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; @@ -56,21 +56,21 @@ ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i8 = call @llvm.masked.load.nxv2i8.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i8 = call @llvm.masked.load.nxv4i8.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i8 = call @llvm.masked.load.nxv8i8.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv16i8 = call @llvm.masked.load.nxv16i8.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv16i8 = call @llvm.masked.load.nxv16i8.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i16 = call @llvm.masked.load.nxv2i16.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i16 = call @llvm.masked.load.nxv4i16.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv8i16 = call @llvm.masked.load.nxv8i16.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv8i16 = call @llvm.masked.load.nxv8i16.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i32 = call @llvm.masked.load.nxv2i32.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i32 = call @llvm.masked.load.nxv4i32.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2i64 = call @llvm.masked.load.nxv2i64.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4i32 = call @llvm.masked.load.nxv4i32.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2i64 = call @llvm.masked.load.nxv2i64.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nxv2f16 = call @llvm.masked.load.nxv2f16.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nxv4f16 = call @llvm.masked.load.nxv4f16.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nxv8f16 = call @llvm.masked.load.nxv8f16.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f32 = call @llvm.masked.load.nxv2f32.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4f32 = call @llvm.masked.load.nxv4f32.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv2f64 = call @llvm.masked.load.nxv2f64.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv4f32 = call @llvm.masked.load.nxv4f32.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nxv2f64 = call @llvm.masked.load.nxv2f64.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv1i64 = call @llvm.masked.load.nxv1i64.p0(ptr undef, i32 8, undef, undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nxv4i64 = call @llvm.masked.load.nxv4i64.p0(ptr undef, i32 8, undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nxv4i64 = call @llvm.masked.load.nxv4i64.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nxv32f16 = call @llvm.masked.load.nxv32f16.p0(ptr undef, i32 8, undef, undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; diff --git a/llvm/test/Analysis/CostModel/RISCV/rvv-load-store.ll b/llvm/test/Analysis/CostModel/RISCV/rvv-load-store.ll --- a/llvm/test/Analysis/CostModel/RISCV/rvv-load-store.ll +++ b/llvm/test/Analysis/CostModel/RISCV/rvv-load-store.ll @@ -1,76 +1,146 @@ ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py -; RUN: opt -passes="print" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+experimental-zvfh -riscv-v-vector-bits-min=128 -riscv-v-fixed-length-vector-lmul-max=1 < %s | FileCheck %s +; RUN: opt -passes="print" -cost-kind=throughput 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+experimental-zvfh -riscv-v-vector-bits-min=128 -riscv-v-fixed-length-vector-lmul-max=1 < %s | FileCheck %s --check-prefix=THROUGHPUT +; RUN: opt -passes="print" -cost-kind=code-size 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+experimental-zvfh -riscv-v-vector-bits-min=128 -riscv-v-fixed-length-vector-lmul-max=1 < %s | FileCheck %s --check-prefix=SIZE ; Check that we don't crash querying costs when vectors are not enabled. -; RUN: opt -passes="print" 2>&1 -disable-output -mtriple=riscv64 +; RUN: opt -passes="print" -cost-kind=throughput 2>&1 -disable-output -mtriple=riscv64 +; RUN: opt -passes="print" -cost-kind=code-size 2>&1 -disable-output -mtriple=riscv64 define void @load(ptr %p) { -; CHECK-LABEL: 'load' -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i8, ptr %p, align 1 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr %p, align 1 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <2 x i8>, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i8>, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <8 x i8>, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <16 x i8>, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %7 = load <32 x i8>, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load , ptr %p, align 1 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load , ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load , ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = load , ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = load , ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load i16, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <1 x i16>, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <2 x i16>, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = load <4 x i16>, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <8 x i16>, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %19 = load <16 x i16>, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %20 = load <32 x i16>, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = load , ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = load , ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load , ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %25 = load , ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = load , ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load i32, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <1 x i32>, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %29 = load <2 x i32>, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = load <4 x i32>, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <8 x i32>, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %32 = load <16 x i32>, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %33 = load <32 x i32>, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %34 = load , ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %35 = load , ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %36 = load , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %37 = load , ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %38 = load , ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %39 = load , ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %40 = load i64, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %41 = load <1 x i64>, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %42 = load <2 x i64>, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %43 = load <4 x i64>, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %44 = load <8 x i64>, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %45 = load <16 x i64>, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %46 = load <32 x i64>, ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %47 = load , ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %48 = load , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %49 = load , ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %50 = load , ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %51 = load , ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %52 = load , ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %53 = load ptr, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %54 = load <1 x ptr>, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %55 = load <2 x ptr>, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %56 = load <4 x ptr>, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %57 = load <8 x ptr>, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %58 = load <16 x ptr>, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %59 = load <32 x ptr>, ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %60 = load , ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %61 = load , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %62 = load , ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %63 = load , ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %64 = load , ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %65 = load , ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; THROUGHPUT-LABEL: 'load' +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i8, ptr %p, align 1 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr %p, align 1 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <2 x i8>, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i8>, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <8 x i8>, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <16 x i8>, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %7 = load <32 x i8>, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load , ptr %p, align 1 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load , ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load , ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = load , ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %12 = load , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = load , ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load i16, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <1 x i16>, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <2 x i16>, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = load <4 x i16>, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <8 x i16>, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %19 = load <16 x i16>, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %20 = load <32 x i16>, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = load , ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = load , ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load , ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %24 = load , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %25 = load , ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %26 = load , ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load i32, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <1 x i32>, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %29 = load <2 x i32>, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = load <4 x i32>, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <8 x i32>, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %32 = load <16 x i32>, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %33 = load <32 x i32>, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %34 = load , ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %35 = load , ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %36 = load , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %37 = load , ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %38 = load , ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %39 = load , ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %40 = load i64, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %41 = load <1 x i64>, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %42 = load <2 x i64>, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %43 = load <4 x i64>, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %44 = load <8 x i64>, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %45 = load <16 x i64>, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %46 = load <32 x i64>, ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %47 = load , ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %48 = load , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %49 = load , ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %50 = load , ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %51 = load , ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %52 = load , ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %53 = load ptr, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %54 = load <1 x ptr>, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %55 = load <2 x ptr>, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %56 = load <4 x ptr>, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %57 = load <8 x ptr>, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %58 = load <16 x ptr>, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %59 = load <32 x ptr>, ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %60 = load , ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %61 = load , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %62 = load , ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %63 = load , ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %64 = load , ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %65 = load , ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; +; SIZE-LABEL: 'load' +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i8, ptr %p, align 1 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr %p, align 1 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <2 x i8>, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i8>, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <8 x i8>, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <16 x i8>, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %7 = load <32 x i8>, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load , ptr %p, align 1 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load , ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load , ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = load , ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = load , ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load i16, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <1 x i16>, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <2 x i16>, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = load <4 x i16>, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <8 x i16>, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %19 = load <16 x i16>, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %20 = load <32 x i16>, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = load , ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = load , ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load , ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %25 = load , ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = load , ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load i32, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <1 x i32>, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %29 = load <2 x i32>, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = load <4 x i32>, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <8 x i32>, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %32 = load <16 x i32>, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %33 = load <32 x i32>, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %34 = load , ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %35 = load , ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %36 = load , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %37 = load , ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %38 = load , ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %39 = load , ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %40 = load i64, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %41 = load <1 x i64>, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %42 = load <2 x i64>, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %43 = load <4 x i64>, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %44 = load <8 x i64>, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %45 = load <16 x i64>, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %46 = load <32 x i64>, ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %47 = load , ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %48 = load , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %49 = load , ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %50 = load , ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %51 = load , ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %52 = load , ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %53 = load ptr, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %54 = load <1 x ptr>, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %55 = load <2 x ptr>, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %56 = load <4 x ptr>, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %57 = load <8 x ptr>, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %58 = load <16 x ptr>, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %59 = load <32 x ptr>, ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %60 = load , ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %61 = load , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %62 = load , ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %63 = load , ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %64 = load , ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %65 = load , ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; load i8, ptr %p load <1 x i8>, ptr %p @@ -147,73 +217,141 @@ } define void @store(ptr %p) { -; CHECK-LABEL: 'store' -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i8 undef, ptr %p, align 1 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i8> undef, ptr %p, align 1 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i8> undef, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <32 x i8> undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 1 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i16 undef, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i16> undef, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i16> undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <32 x i16> undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 2 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i32 undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i32> undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i32> undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <32 x i32> undef, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i64 undef, ptr %p, align 4 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i64> undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <8 x i64> undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <16 x i64> undef, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store <32 x i64> undef, ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store ptr undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x ptr> undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x ptr> undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x ptr> undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <8 x ptr> undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <16 x ptr> undef, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store <32 x ptr> undef, ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 128 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 256 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; THROUGHPUT-LABEL: 'store' +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i8 undef, ptr %p, align 1 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i8> undef, ptr %p, align 1 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i8> undef, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <32 x i8> undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 1 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i16 undef, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i16> undef, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i16> undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <32 x i16> undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 2 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i32 undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i32> undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i32> undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <32 x i32> undef, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store undef, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i64 undef, ptr %p, align 4 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i64> undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <8 x i64> undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <16 x i64> undef, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store <32 x i64> undef, ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store undef, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 32 for instruction: store undef, ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store ptr undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x ptr> undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x ptr> undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x ptr> undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <8 x ptr> undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <16 x ptr> undef, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store <32 x ptr> undef, ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store undef, ptr %p, align 64 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store undef, ptr %p, align 128 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 32 for instruction: store undef, ptr %p, align 256 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; +; SIZE-LABEL: 'store' +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i8 undef, ptr %p, align 1 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i8> undef, ptr %p, align 1 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i8> undef, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <32 x i8> undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 1 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i16 undef, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i16> undef, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i16> undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <32 x i16> undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 2 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i32 undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i32> undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i32> undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <32 x i32> undef, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store i64 undef, ptr %p, align 4 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x i64> undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <8 x i64> undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <16 x i64> undef, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store <32 x i64> undef, ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store ptr undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <1 x ptr> undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x ptr> undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x ptr> undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <8 x ptr> undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store <16 x ptr> undef, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: store <32 x ptr> undef, ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 8 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store undef, ptr %p, align 64 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store undef, ptr %p, align 128 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store undef, ptr %p, align 256 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; store i8 undef, ptr %p store <1 x i8> undef, ptr %p @@ -292,26 +430,43 @@ ; For constants, have to account for cost of materializing the constant itself ; This test exercises a few interesting constant patterns at VLEN=128 define void @store_of_constant(ptr %p) { -; CHECK-LABEL: 'store_of_constant' -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> poison, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> undef, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> zeroinitializer, ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> zeroinitializer, ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: store <4 x i64> , ptr %p, align 32 -; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void -; - ; poison and undef +; THROUGHPUT-LABEL: 'store_of_constant' +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> poison, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> undef, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> zeroinitializer, ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> zeroinitializer, ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: store <4 x i64> , ptr %p, align 32 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; +; SIZE-LABEL: 'store_of_constant' +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> poison, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> undef, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> zeroinitializer, ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> zeroinitializer, ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: store <4 x i64> , ptr %p, align 32 +; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store <4 x i32> , ptr %p, align 16 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; store <4 x i32> poison, ptr %p store <4 x i32> undef, ptr %p diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll b/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll --- a/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll +++ b/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll @@ -36,10 +36,10 @@ ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %i.0 = add nsw i32 %i.0.in8, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %idxprom = zext i32 %i.0 to i64 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx = getelementptr inbounds i32, ptr %B, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: %1 = load i32, ptr %arrayidx, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: %1 = load i32, ptr %arrayidx, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %add9 = add i32 %1, 1 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: store i32 %add9, ptr %arrayidx3, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: store i32 %add9, ptr %arrayidx3, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %cmp = icmp ugt i64 %indvars.iv, 1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %indvars.iv.next = add nsw i64 %indvars.iv, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !0 @@ -79,10 +79,10 @@ ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %i.0 = add nsw i32 %i.0.in8, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %idxprom = zext i32 %i.0 to i64 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx = getelementptr inbounds i32, ptr %B, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: %1 = load i32, ptr %arrayidx, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: %1 = load i32, ptr %arrayidx, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %add9 = add i32 %1, 1 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: store i32 %add9, ptr %arrayidx3, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: store i32 %add9, ptr %arrayidx3, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %cmp = icmp ugt i64 %indvars.iv, 1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %indvars.iv.next = add nsw i64 %indvars.iv, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !0 @@ -105,7 +105,7 @@ ; CHECK-NEXT: LV(REG): RegisterClass: RISCV::VRRC, 4 registers ; CHECK-NEXT: LV: The target has 31 registers of RISCV::GPRRC register class ; CHECK-NEXT: LV: The target has 32 registers of RISCV::VRRC register class -; CHECK-NEXT: LV: Loop cost is 23 +; CHECK-NEXT: LV: Loop cost is 25 ; CHECK-NEXT: LV: IC is 2 ; CHECK-NEXT: LV: VF is vscale x 4 ; CHECK-NEXT: LV: Not Interleaving. @@ -168,10 +168,10 @@ ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %i.0 = add nsw i32 %i.0.in8, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %idxprom = zext i32 %i.0 to i64 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx = getelementptr inbounds float, ptr %B, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: %1 = load float, ptr %arrayidx, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: %1 = load float, ptr %arrayidx, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %conv1 = fadd float %1, 1.000000e+00 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx3 = getelementptr inbounds float, ptr %A, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: store float %conv1, ptr %arrayidx3, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: store float %conv1, ptr %arrayidx3, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %cmp = icmp ugt i64 %indvars.iv, 1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %indvars.iv.next = add nsw i64 %indvars.iv, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !0 @@ -211,10 +211,10 @@ ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %i.0 = add nsw i32 %i.0.in8, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %idxprom = zext i32 %i.0 to i64 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx = getelementptr inbounds float, ptr %B, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: %1 = load float, ptr %arrayidx, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: %1 = load float, ptr %arrayidx, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %conv1 = fadd float %1, 1.000000e+00 ; CHECK-NEXT: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %arrayidx3 = getelementptr inbounds float, ptr %A, i64 %idxprom -; CHECK-NEXT: LV: Found an estimated cost of 7 for VF vscale x 4 For instruction: store float %conv1, ptr %arrayidx3, align 4 +; CHECK-NEXT: LV: Found an estimated cost of 8 for VF vscale x 4 For instruction: store float %conv1, ptr %arrayidx3, align 4 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %cmp = icmp ugt i64 %indvars.iv, 1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: %indvars.iv.next = add nsw i64 %indvars.iv, -1 ; CHECK-NEXT: LV: Found an estimated cost of 1 for VF vscale x 4 For instruction: br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !0 @@ -237,7 +237,7 @@ ; CHECK-NEXT: LV(REG): RegisterClass: RISCV::VRRC, 4 registers ; CHECK-NEXT: LV: The target has 31 registers of RISCV::GPRRC register class ; CHECK-NEXT: LV: The target has 32 registers of RISCV::VRRC register class -; CHECK-NEXT: LV: Loop cost is 23 +; CHECK-NEXT: LV: Loop cost is 25 ; CHECK-NEXT: LV: IC is 2 ; CHECK-NEXT: LV: VF is vscale x 4 ; CHECK-NEXT: LV: Not Interleaving.