2018-01-28 01:19:16 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-- -mcpu=corei7-avx | FileCheck %s
|
2014-07-11 02:00:53 +08:00
|
|
|
|
|
|
|
; testb should be scheduled right before je to enable macro-fusion.
|
|
|
|
|
|
|
|
define i32 @check_flag(i32 %flags, ...) nounwind {
|
2018-01-28 01:19:16 +08:00
|
|
|
; CHECK-LABEL: check_flag:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
2018-02-01 00:48:54 +08:00
|
|
|
; CHECK-NEXT: testl $512, %edi # imm = 0x200
|
2018-01-28 01:19:16 +08:00
|
|
|
; CHECK-NEXT: je .LBB0_2
|
|
|
|
; CHECK-NEXT: # %bb.1: # %if.then
|
|
|
|
; CHECK-NEXT: movl $1, %eax
|
|
|
|
; CHECK-NEXT: .LBB0_2: # %if.end
|
|
|
|
; CHECK-NEXT: retq
|
2014-07-11 02:00:53 +08:00
|
|
|
entry:
|
|
|
|
%and = and i32 %flags, 512
|
|
|
|
%tobool = icmp eq i32 %and, 0
|
2017-01-12 03:55:19 +08:00
|
|
|
br i1 %tobool, label %if.end, label %if.then
|
2014-07-11 02:00:53 +08:00
|
|
|
|
|
|
|
if.then:
|
|
|
|
br label %if.end
|
|
|
|
|
|
|
|
if.end:
|
|
|
|
%hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]
|
|
|
|
ret i32 %hasflag
|
|
|
|
}
|