; RUN: opt < %s -cost-model -analyze -mtriple=aarch64-linux-gnu -mattr=+sve | FileCheck %s define <16 x i32> @extract_cost( %vec) { ; CHECK-LABEL: 'extract_cost' ; CHECK-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ret = call <16 x i32> @llvm.experimental.vector.extract.v16i32.nxv4i32( %vec, i64 0) ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ret %ret = call <16 x i32> @llvm.experimental.vector.extract.v16i32.nxv4i32( %vec, i64 0) ret <16 x i32> %ret } define @insert_cost( %vec, <16 x i32> %subVec) { ; CHECK-LABEL: 'insert_cost' ; CHECK-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ret = call @llvm.experimental.vector.insert.nxv4i32.v16i32( %vec, <16 x i32> %subVec, i64 0) ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret %ret %ret = call @llvm.experimental.vector.insert.nxv4i32.v16i32( %vec, <16 x i32> %subVec, i64 0) ret %ret } define @extract_cost_scalable( %vec) { ; CHECK-LABEL: 'extract_cost_scalable' ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ret = call @llvm.experimental.vector.extract.nxv4i32.nxv16i32( %vec, i64 0) ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret %ret %ret = call @llvm.experimental.vector.extract.nxv4i32.nxv16i32( %vec, i64 0) ret %ret } define @insert_cost_scalable( %vec, %subVec) { ; CHECK-LABEL: 'insert_cost_scalable' ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ret = call @llvm.experimental.vector.insert.nxv16i32.nxv4i32( %vec, %subVec, i64 0) ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret %ret %ret = call @llvm.experimental.vector.insert.nxv16i32.nxv4i32( %vec, %subVec, i64 0) ret %ret } declare <16 x i32> @llvm.experimental.vector.extract.v16i32.nxv4i32(, i64) declare @llvm.experimental.vector.insert.nxv4i32.v16i32(, <16 x i32>, i64) declare @llvm.experimental.vector.extract.nxv4i32.nxv16i32(, i64) declare @llvm.experimental.vector.insert.nxv16i32.nxv4i32(, , i64)