39 lines · plain
1; Test BRCTH.2 3; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu -mcpu=z196 \4; RUN: -no-integrated-as -disable-block-placement | FileCheck %s5 6; Test a loop that should be converted into dbr form and then use BRCTH.7define void @f2(ptr %src, ptr %dest) {8; CHECK-LABEL: f2:9; CHECK: blah [[REG:%r[0-5]]]10; CHECK: [[LABEL:\.[^:]*]]:{{.*}} %loop11; CHECK: brcth [[REG]], [[LABEL]]12; CHECK: br %r1413entry:14 ; Force upper bound into a high register in order to encourage the15 ; register allocator to use a high register for the count variable.16 %top = call i32 asm sideeffect "blah $0", "=h"()17 br label %loop18 19loop:20 %count = phi i32 [ 0, %entry ], [ %next, %loop.next ]21 %next = add i32 %count, 122 %val = load volatile i32, ptr %src23 %cmp = icmp eq i32 %val, 024 br i1 %cmp, label %loop.next, label %loop.store25 26loop.store:27 %add = add i32 %val, 128 store volatile i32 %add, ptr %dest29 br label %loop.next30 31loop.next:32 %cont = icmp ne i32 %next, %top33 br i1 %cont, label %loop, label %exit34 35exit:36 ret void37}38 39