brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · c6df237 Raw
84 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i386-unknown-unknown -jump-is-expensive=0 | FileCheck %s --check-prefix=JUMP23; RUN: llc < %s -mtriple=i386-unknown-unknown -jump-is-expensive=1 | FileCheck %s --check-prefix=JUMP14 5define void @foo(i32 %X, i32 %Y, i32 %Z) nounwind {6; JUMP2-LABEL: foo:7; JUMP2:       # %bb.0: # %entry8; JUMP2-NEXT:    cmpl $0, {{[0-9]+}}(%esp)9; JUMP2-NEXT:    setne %al10; JUMP2-NEXT:    cmpl $5, {{[0-9]+}}(%esp)11; JUMP2-NEXT:    setge %cl12; JUMP2-NEXT:    testb %al, %cl13; JUMP2-NEXT:    je bar@PLT # TAILCALL14; JUMP2-NEXT:  # %bb.1: # %UnifiedReturnBlock15; JUMP2-NEXT:    retl16;17; JUMP1-LABEL: foo:18; JUMP1:       # %bb.0: # %entry19; JUMP1-NEXT:    cmpl $0, {{[0-9]+}}(%esp)20; JUMP1-NEXT:    setne %al21; JUMP1-NEXT:    cmpl $5, {{[0-9]+}}(%esp)22; JUMP1-NEXT:    setge %cl23; JUMP1-NEXT:    testb %al, %cl24; JUMP1-NEXT:    je bar@PLT # TAILCALL25; JUMP1-NEXT:  # %bb.1: # %UnifiedReturnBlock26; JUMP1-NEXT:    retl27entry:28  %tmp1 = icmp eq i32 %X, 029  %tmp3 = icmp slt i32 %Y, 530  %tmp4 = or i1 %tmp3, %tmp131  br i1 %tmp4, label %cond_true, label %UnifiedReturnBlock32 33cond_true:34  %tmp5 = tail call i32 (...) @bar( )35  ret void36 37UnifiedReturnBlock:38  ret void39}40 41; If the branch is unpredictable, don't add another branch42; regardless of whether they are expensive or not.43 44define void @unpredictable(i32 %X, i32 %Y, i32 %Z) nounwind {45; JUMP2-LABEL: unpredictable:46; JUMP2:       # %bb.0: # %entry47; JUMP2-NEXT:    cmpl $0, {{[0-9]+}}(%esp)48; JUMP2-NEXT:    setne %al49; JUMP2-NEXT:    cmpl $5, {{[0-9]+}}(%esp)50; JUMP2-NEXT:    setge %cl51; JUMP2-NEXT:    testb %al, %cl52; JUMP2-NEXT:    je bar@PLT # TAILCALL53; JUMP2-NEXT:  # %bb.1: # %UnifiedReturnBlock54; JUMP2-NEXT:    retl55;56; JUMP1-LABEL: unpredictable:57; JUMP1:       # %bb.0: # %entry58; JUMP1-NEXT:    cmpl $0, {{[0-9]+}}(%esp)59; JUMP1-NEXT:    setne %al60; JUMP1-NEXT:    cmpl $5, {{[0-9]+}}(%esp)61; JUMP1-NEXT:    setge %cl62; JUMP1-NEXT:    testb %al, %cl63; JUMP1-NEXT:    je bar@PLT # TAILCALL64; JUMP1-NEXT:  # %bb.1: # %UnifiedReturnBlock65; JUMP1-NEXT:    retl66entry:67  %tmp1 = icmp eq i32 %X, 068  %tmp3 = icmp slt i32 %Y, 569  %tmp4 = or i1 %tmp3, %tmp170  br i1 %tmp4, label %cond_true, label %UnifiedReturnBlock, !unpredictable !071 72cond_true:73  %tmp5 = tail call i32 (...) @bar( )74  ret void75 76UnifiedReturnBlock:77  ret void78}79 80declare i32 @bar(...)81 82!0 = !{}83 84