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
4 ; testb should be scheduled right before je to enable macro-fusion.
6 define 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
17 %and = and i32 %flags, 512
18 %tobool = icmp eq i32 %and, 0
19 br i1 %tobool, label %if.end, label %if.then
25 %hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]