35 lines · plain
1; RUN: llc < %s -mtriple=x86_64-apple-darwin -print-after=finalize-isel -o /dev/null 2>&1 | FileCheck %s2 3;; Make sure a transformation in SelectionDAGBuilder that converts "or + br" to4;; two branches correctly updates the branch probability.5 6@max_regno = common global i32 0, align 47 8define void @test(ptr %old, i32 %final) {9for.cond:10 br label %for.cond211 12for.cond2: ; preds = %for.inc, %for.cond13 %i.1 = phi i32 [ %inc19, %for.inc ], [ 0, %for.cond ]14 %bit.0 = phi i32 [ %shl, %for.inc ], [ 1, %for.cond ]15 %tobool = icmp eq i32 %bit.0, 016 %v3 = load i32, ptr @max_regno, align 417 %cmp4 = icmp eq i32 %i.1, %v318 %or.cond = or i1 %tobool, %cmp419 br i1 %or.cond, label %for.inc20, label %for.inc, !prof !020; CHECK: bb.1.for.cond2:21; CHECK: successors: %bb.3(0x01f3d4c5), %bb.4(0x7e0c2b3b)22; CHECK: bb.4.for.cond2:23; CHECK: successors: %bb.3(0x01fb92cf), %bb.2(0x7e046d31)24 25for.inc: ; preds = %for.cond226 %shl = shl i32 %bit.0, 127 %inc19 = add nsw i32 %i.1, 128 br label %for.cond229 30for.inc20: ; preds = %for.cond231 ret void32}33 34!0 = !{!"branch_weights", i32 112017436, i32 -735157296}35