• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-- -mcpu=corei7-avx | FileCheck %s
3
4; testb should be scheduled right before je to enable macro-fusion.
5
6define i32 @check_flag(i32 %flags, ...) nounwind {
7; CHECK-LABEL: check_flag:
8; CHECK:       # %bb.0: # %entry
9; CHECK-NEXT:    xorl %eax, %eax
10; CHECK-NEXT:    testl $512, %edi # imm = 0x200
11; CHECK-NEXT:    je .LBB0_2
12; CHECK-NEXT:  # %bb.1: # %if.then
13; CHECK-NEXT:    movl $1, %eax
14; CHECK-NEXT:  .LBB0_2: # %if.end
15; CHECK-NEXT:    retq
16entry:
17  %and = and i32 %flags, 512
18  %tobool = icmp eq i32 %and, 0
19  br i1 %tobool, label %if.end, label %if.then
20
21if.then:
22  br label %if.end
23
24if.end:
25  %hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]
26  ret i32 %hasflag
27}
28