[llvm] b003fed - [CostModel] Add some ssa.copy costmodel tests. NFC
David Green via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 12 23:26:21 PST 2023
Author: David Green
Date: 2023-12-13T07:26:17Z
New Revision: b003fed283d2d8dc0715964fcd84bd1298c75578
URL: https://github.com/llvm/llvm-project/commit/b003fed283d2d8dc0715964fcd84bd1298c75578
DIFF: https://github.com/llvm/llvm-project/commit/b003fed283d2d8dc0715964fcd84bd1298c75578.diff
LOG: [CostModel] Add some ssa.copy costmodel tests. NFC
Added:
Modified:
llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll b/llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
index 1565a138b93d3c..9a9193b36de029 100644
--- a/llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
+++ b/llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll
@@ -42,6 +42,10 @@ declare float @llvm.vector.reduce.fmax.v16f32(<16 x float>)
declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
+declare i32 @llvm.ssa.copy.i32(i32)
+declare float @llvm.ssa.copy.f32(float)
+declare ptr @llvm.ssa.copy.p0(ptr)
+
define void @smax(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) {
; THRU-LABEL: 'smax'
; THRU-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b)
@@ -333,3 +337,35 @@ define void @memcpy(ptr %a, ptr %b, i32 %c) {
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
ret void
}
+
+define void @ssa_copy() {
+ ; CHECK: %{{.*}} = llvm.intr.ssa.copy %{{.*}} : f32
+; THRU-LABEL: 'ssa_copy'
+; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
+; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
+; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
+; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
+; LATE-LABEL: 'ssa_copy'
+; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
+; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
+; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
+; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; SIZE-LABEL: 'ssa_copy'
+; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
+; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
+; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
+; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+; SIZE_LATE-LABEL: 'ssa_copy'
+; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
+; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
+; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
+; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
+;
+ %i = call i32 @llvm.ssa.copy.i32(i32 undef)
+ %f = call float @llvm.ssa.copy.f32(float undef)
+ %p = call ptr @llvm.ssa.copy.p0(ptr undef)
+ ret void
+}
More information about the llvm-commits
mailing list