1 # Test normal conditional branches in cases where block alignments cause
2 # some branches to be out of range.
3 # RUN: %python %s | llc -mtriple=s390x-linux-gnu -align-all-blocks=8 | FileCheck %s
8 # conditional branch to end
11 # conditional branch to end
13 # conditional branch to b0
16 # conditional branch to b0
19 # with N == 256 + 4. The -align-all-blocks=8 option ensures that all blocks
20 # are 256 bytes in size. The first 4 blocks and the last 4 blocks are then
23 # CHECK: c %r4, 0(%r3)
24 # CHECK: jge [[LABEL:\.L[^ ]*]]
25 # CHECK: c %r4, 4(%r3)
26 # CHECK: jge [[LABEL]]
27 # CHECK: c %r4, 8(%r3)
28 # CHECK: jge [[LABEL]]
29 # CHECK: c %r4, 12(%r3)
30 # CHECK: jge [[LABEL]]
31 # CHECK: c %r4, 16(%r3)
33 # CHECK: c %r4, 20(%r3)
35 # CHECK: c %r4, 24(%r3)
37 # CHECK: c %r4, 28(%r3)
39 # ...lots of other blocks...
40 # CHECK: c %r4, 1004(%r3)
41 # CHECK: je [[LABEL:\.L[^ ]*]]
42 # CHECK: c %r4, 1008(%r3)
44 # CHECK: c %r4, 1012(%r3)
46 # CHECK: c %r4, 1016(%r3)
48 # CHECK: c %r4, 1020(%r3)
50 # CHECK: c %r4, 1024(%r3)
51 # CHECK: jge [[LABEL]]
52 # CHECK: c %r4, 1028(%r3)
53 # CHECK: jge [[LABEL]]
54 # CHECK: c %r4, 1032(%r3)
55 # CHECK: jge [[LABEL]]
56 # CHECK: c %r4, 1036(%r3)
57 # CHECK: jge [[LABEL]]
59 from __future__
import print_function
63 print("define void @f1(i8 *%base, i32 *%stop, i32 %limit) {")
65 print(" br label %b0")
69 for i
in range(blocks
):
72 next
= "b%d" % (i
+ 1) if i
+ 1 < blocks
else "end"
73 other
= "end" if 2 * i
< blocks
else "b0"
75 print(" store volatile i8 %d, i8 *%%base" % value
)
76 print(" %%astop%d = getelementptr i32, i32 *%%stop, i64 %d" % (i
, i
))
77 print(" %%acur%d = load i32 , i32 *%%astop%d" % (i
, i
))
78 print(" %%atest%d = icmp eq i32 %%limit, %%acur%d" % (i
, i
))
79 print(" br i1 %%atest%d, label %%%s, label %%%s" % (i
, other
, next
))