1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=ELF64
3 ; RUN: llc -mtriple=powerpc64-ibm-aix-xcoff < %s | FileCheck %s -check-prefix=AIX64
5 @x = global i32 1000, align 4
7 define signext i32 @bar() #0 {
9 ; ELF64: # %bb.0: # %entry
11 ; ELF64-NEXT: stdu 1, -112(1)
12 ; ELF64-NEXT: std 0, 128(1)
13 ; ELF64-NEXT: .cfi_def_cfa_offset 112
14 ; ELF64-NEXT: .cfi_offset lr, 16
16 ; ELF64-NEXT: stw 3, 108(1)
18 ; ELF64-NEXT: stw 3, 104(1)
19 ; ELF64-NEXT: .LBB0_1: # %for.cond
21 ; ELF64-NEXT: lwz 3, 104(1)
22 ; ELF64-NEXT: addis 4, 2, .LC0@toc@ha
23 ; ELF64-NEXT: ld 4, .LC0@toc@l(4)
24 ; ELF64-NEXT: lwz 4, 0(4)
25 ; ELF64-NEXT: cmpw 3, 4
26 ; ELF64-NEXT: bge 0, .LBB0_4
27 ; ELF64-NEXT: # %bb.2: # %for.body
31 ; ELF64-NEXT: # %bb.3: # %for.inc
33 ; ELF64-NEXT: lwz 3, 104(1)
34 ; ELF64-NEXT: addi 3, 3, 1
35 ; ELF64-NEXT: stw 3, 104(1)
36 ; ELF64-NEXT: b .LBB0_1
37 ; ELF64-NEXT: .LBB0_4: # %for.end
39 ; ELF64-NEXT: addi 1, 1, 112
40 ; ELF64-NEXT: ld 0, 16(1)
45 ; AIX64: # %bb.0: # %entry
47 ; AIX64-NEXT: stdu 1, -128(1)
48 ; AIX64-NEXT: std 0, 144(1)
50 ; AIX64-NEXT: stw 3, 124(1)
52 ; AIX64-NEXT: stw 3, 120(1)
53 ; AIX64-NEXT: L..BB0_1: # %for.cond
55 ; AIX64-NEXT: lwz 3, 120(1)
56 ; AIX64-NEXT: ld 4, L..C0(2) # @x
57 ; AIX64-NEXT: lwz 4, 0(4)
58 ; AIX64-NEXT: cmpw 3, 4
59 ; AIX64-NEXT: bge 0, L..BB0_4
60 ; AIX64-NEXT: # %bb.2: # %for.body
62 ; AIX64-NEXT: bl .foo[PR]
64 ; AIX64-NEXT: # %bb.3: # %for.inc
66 ; AIX64-NEXT: lwz 3, 120(1)
67 ; AIX64-NEXT: addi 3, 3, 1
68 ; AIX64-NEXT: stw 3, 120(1)
69 ; AIX64-NEXT: b L..BB0_1
70 ; AIX64-NEXT: L..BB0_4: # %for.end
72 ; AIX64-NEXT: addi 1, 1, 128
73 ; AIX64-NEXT: ld 0, 16(1)
77 %retval = alloca i32, align 4
78 %i = alloca i32, align 4
79 store i32 0, i32* %retval, align 4
80 store i32 0, i32* %i, align 4
84 %0 = load i32, i32* %i, align 4
85 %1 = load i32, i32* @x, align 4
86 %cmp = icmp slt i32 %0, %1
87 br i1 %cmp, label %for.body, label %for.end
90 call void bitcast (void (...)* @foo to void ()*)()
94 %2 = load i32, i32* %i, align 4
95 %inc = add nsw i32 %2, 1
96 store i32 %inc, i32* %i, align 4
103 declare void @foo(...)
105 attributes #0 = { optnone noinline }