Mercurial > hg > CbC > CbC_llvm
comparison test/Transforms/InstCombine/2012-05-28-select-hang.ll @ 0:95c75e76d11b LLVM3.4
LLVM 3.4
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 12 Dec 2013 13:56:28 +0900 |
parents | |
children | afa8332a0e37 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:95c75e76d11b |
---|---|
1 ; RUN: opt -S -instcombine < %s | FileCheck %s | |
2 | |
3 @c = common global i8 0, align 1 | |
4 @a = common global i8 0, align 1 | |
5 @b = common global i8 0, align 1 | |
6 | |
7 define void @func() nounwind uwtable ssp { | |
8 entry: | |
9 %0 = load i8* @c, align 1 | |
10 %conv = zext i8 %0 to i32 | |
11 %or = or i32 %conv, 1 | |
12 %conv1 = trunc i32 %or to i8 | |
13 store i8 %conv1, i8* @a, align 1 | |
14 %conv2 = zext i8 %conv1 to i32 | |
15 %neg = xor i32 %conv2, -1 | |
16 %and = and i32 1, %neg | |
17 %conv3 = trunc i32 %and to i8 | |
18 store i8 %conv3, i8* @b, align 1 | |
19 %1 = load i8* @a, align 1 | |
20 %conv4 = zext i8 %1 to i32 | |
21 %conv5 = zext i8 %conv3 to i32 | |
22 %tobool = icmp ne i32 %conv4, 0 | |
23 br i1 %tobool, label %land.rhs, label %land.end | |
24 | |
25 land.rhs: ; preds = %entry | |
26 %tobool8 = icmp ne i32 %conv5, 0 | |
27 br label %land.end | |
28 | |
29 land.end: ; preds = %land.rhs, %entry | |
30 %2 = phi i1 [ false, %entry ], [ %tobool8, %land.rhs ] | |
31 %land.ext = zext i1 %2 to i32 | |
32 %mul = mul nsw i32 3, %land.ext | |
33 %conv9 = trunc i32 %mul to i8 | |
34 store i8 %conv9, i8* @a, align 1 | |
35 ret void | |
36 | |
37 ; CHECK-LABEL: @func( | |
38 ; CHECK-NOT: select | |
39 } |