1 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-linux -sink-insts-to-avoid-spills | FileCheck %s -check-prefix=SINK
4 ; Ensure that we sink copy-like instructions into loops to avoid register
10 %struct.A = type { i32, i32, i32, i32, i32, i32 }
12 define void @_Z1fPhP1A(i8* nocapture readonly %input, %struct.A* %a) {
13 %1 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 0
14 %2 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 1
15 %3 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 2
16 %4 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 3
17 %5 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 4
18 %6 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 5
22 %.0 = phi i8* [ %input, %0 ], [ %7, %.backedge.backedge ]
23 %7 = getelementptr inbounds i8, i8* %.0, i64 1
24 %8 = load i8, i8* %7, align 1
25 switch i8 %8, label %.backedge.backedge [
35 tail call void @_Z6assignPj(i32* %1)
36 br label %.backedge.backedge
39 tail call void @_Z6assignPj(i32* %2)
40 br label %.backedge.backedge
46 tail call void @_Z6assignPj(i32* %3)
47 br label %.backedge.backedge
50 tail call void @_Z6assignPj(i32* %4)
51 br label %.backedge.backedge
54 tail call void @_Z6assignPj(i32* %5)
55 br label %.backedge.backedge
58 tail call void @_Z6assignPj(i32* %6)
59 br label %.backedge.backedge
62 declare void @_Z6assignPj(i32*)