Skip to content

Commit b003fed

Browse files
committed
[CostModel] Add some ssa.copy costmodel tests. NFC
1 parent 912506b commit b003fed

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

llvm/test/Analysis/CostModel/ARM/intrinsic-cost-kinds.ll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ declare float @llvm.vector.reduce.fmax.v16f32(<16 x float>)
4242

4343
declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
4444

45+
declare i32 @llvm.ssa.copy.i32(i32)
46+
declare float @llvm.ssa.copy.f32(float)
47+
declare ptr @llvm.ssa.copy.p0(ptr)
48+
4549
define void @smax(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) {
4650
; THRU-LABEL: 'smax'
4751
; 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) {
333337
call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 32, i1 false)
334338
ret void
335339
}
340+
341+
define void @ssa_copy() {
342+
; CHECK: %{{.*}} = llvm.intr.ssa.copy %{{.*}} : f32
343+
; THRU-LABEL: 'ssa_copy'
344+
; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
345+
; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
346+
; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
347+
; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
348+
;
349+
; LATE-LABEL: 'ssa_copy'
350+
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
351+
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
352+
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
353+
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
354+
;
355+
; SIZE-LABEL: 'ssa_copy'
356+
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
357+
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
358+
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
359+
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
360+
;
361+
; SIZE_LATE-LABEL: 'ssa_copy'
362+
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %i = call i32 @llvm.ssa.copy.i32(i32 undef)
363+
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = call float @llvm.ssa.copy.f32(float undef)
364+
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p = call ptr @llvm.ssa.copy.p0(ptr undef)
365+
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
366+
;
367+
%i = call i32 @llvm.ssa.copy.i32(i32 undef)
368+
%f = call float @llvm.ssa.copy.f32(float undef)
369+
%p = call ptr @llvm.ssa.copy.p0(ptr undef)
370+
ret void
371+
}

0 commit comments

Comments
 (0)