brintos

brintos / llvm-project-archived public Read only

0
0
Text · 947 B · 96b190c Raw
47 lines · plain
1; Test SystemZInstrInfo::analyzeBranch and SystemZInstrInfo::insertBranch.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s4 5declare void @foo() noreturn6 7; Check a case where a separate branch is needed and where the original8; order should be reversed.9define i32 @f1(i32 %a, ptr %bptr) {10; CHECK-LABEL: f1:11; CHECK: cl %r2, 0(%r3)12; CHECK: jl .L[[LABEL:.*]]13; CHECK: br %r1414; CHECK: .L[[LABEL]]:15; CHECK: brasl %r14, foo@PLT16entry:17  %b = load i32, ptr %bptr18  %cmp = icmp ult i32 %a, %b19  br i1 %cmp, label %callit, label %return20 21callit:22  call void @foo()23  unreachable24 25return:26  ret i32 127}28 29; Same again with a fused compare and branch.30define i32 @f2(i32 %a) {31; CHECK-LABEL: f2:32; CHECK: cije %r2, 0, .L[[LABEL:.*]]33; CHECK: br %r1434; CHECK: .L[[LABEL]]:35; CHECK: brasl %r14, foo@PLT36entry:37  %cmp = icmp eq i32 %a, 038  br i1 %cmp, label %callit, label %return39 40callit:41  call void @foo()42  unreachable43 44return:45  ret i32 146}47