blob: 6314ed6bd5bf14bcad8d928171621b743d1a533f [file] [log] [blame]
Simon Pilgrim4793a112017-07-18 12:31:46 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-unknown-unknown -mcpu=haswell | FileCheck %s --check-prefix=X86
3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=haswell | FileCheck %s --check-prefix=X64
4
5@var_580 = external local_unnamed_addr global i8, align 1
6
7define void @foo() {
8; X86-LABEL: foo:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +00009; X86: # %bb.0: # %entry
Simon Pilgrim4793a112017-07-18 12:31:46 +000010; X86-NEXT: movsbl var_580, %eax
11; X86-NEXT: testl $-536870913, %eax # imm = 0xDFFFFFFF
12; X86-NEXT: jne .LBB0_1
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000013; X86-NEXT: # %bb.2: # %if.end13
Simon Pilgrim4793a112017-07-18 12:31:46 +000014; X86-NEXT: retl
15; X86-NEXT: .LBB0_1: # %if.then11
16;
17; X64-LABEL: foo:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000018; X64: # %bb.0: # %entry
Simon Pilgrim4793a112017-07-18 12:31:46 +000019; X64-NEXT: movsbl {{.*}}(%rip), %eax
20; X64-NEXT: testl $-536870913, %eax # imm = 0xDFFFFFFF
21; X64-NEXT: jne .LBB0_1
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000022; X64-NEXT: # %bb.2: # %if.end13
Simon Pilgrim4793a112017-07-18 12:31:46 +000023; X64-NEXT: retq
24; X64-NEXT: .LBB0_1: # %if.then11
25entry:
26 %tmp = icmp ugt i8 undef, 60
27 %phitmp = zext i1 %tmp to i16
28 br label %if.end
29
30if.end:
31 %tmp1 = load i8, i8* @var_580, align 1
32 %conv7 = sext i8 %tmp1 to i32
33 %conv8 = zext i16 %phitmp to i32
34 %mul = shl nuw nsw i32 %conv8, 1
35 %div9 = udiv i32 %mul, 71
36 %sub = add nsw i32 %div9, -3
37 %shl = shl i32 1, %sub
38 %neg = xor i32 %shl, -1
39 %and = and i32 %neg, %conv7
40 %tobool10 = icmp eq i32 %and, 0
41 br i1 %tobool10, label %if.end13, label %if.then11
42
43if.then11:
44 unreachable
45
46if.end13:
47 ret void
48}