3 ; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu -mcpu=z196 \
4 ; RUN: -no-integrated-as -disable-block-placement | FileCheck %s
6 ; Test a loop that should be converted into dbr form and then use BRCTH.
7 define void @f2(ptr %src, ptr %dest) {
9 ; CHECK: blah [[REG:%r[0-5]]]
10 ; CHECK: [[LABEL:\.[^:]*]]:{{.*}} %loop
11 ; CHECK: brcth [[REG]], [[LABEL]]
14 ; Force upper bound into a high register in order to encourage the
15 ; register allocator to use a high register for the count variable.
16 %top = call i32 asm sideeffect "blah $0", "=h"()
20 %count = phi i32 [ 0, %entry ], [ %next, %loop.next ]
21 %next = add i32 %count, 1
22 %val = load volatile i32, ptr %src
23 %cmp = icmp eq i32 %val, 0
24 br i1 %cmp, label %loop.next, label %loop.store
27 %add = add i32 %val, 1
28 store volatile i32 %add, ptr %dest
32 %cont = icmp ne i32 %next, %top
33 br i1 %cont, label %loop, label %exit