projects
/
oota-llvm.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
The simplifycfg pass should be able to turn stuff like:
[oota-llvm.git]
/
test
/
Transforms
/
SimplifyCFG
/
switch_create.ll
1
; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
2
3
declare void %foo1()
4
declare void %foo2()
5
6
void %test1(uint %V) {
7
%C1 = seteq uint %V, 4
8
%C2 = seteq uint %V, 17
9
%CN = or bool %C1, %C2
10
br bool %CN, label %T, label %F
11
T:
12
call void %foo1()
13
ret void
14
F:
15
call void %foo2()
16
ret void
17
}
18
19
20
void %test2(int %V) {
21
%C1 = setne int %V, 4
22
%C2 = setne int %V, 17
23
%CN = and bool %C1, %C2
24
br bool %CN, label %T, label %F
25
T:
26
call void %foo1()
27
ret void
28
F:
29
call void %foo2()
30
ret void
31
}
32
33