mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-28 14:32:51 +01:00
90da2d674f
if (X == 4 || X == 7) and if (X != 4 && X != 7) into switch instructions. llvm-svn: 11791
34 lines
500 B
LLVM
34 lines
500 B
LLVM
; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
|
|
|
|
declare void %foo1()
|
|
declare void %foo2()
|
|
|
|
void %test1(uint %V) {
|
|
%C1 = seteq uint %V, 4
|
|
%C2 = seteq uint %V, 17
|
|
%CN = or bool %C1, %C2
|
|
br bool %CN, label %T, label %F
|
|
T:
|
|
call void %foo1()
|
|
ret void
|
|
F:
|
|
call void %foo2()
|
|
ret void
|
|
}
|
|
|
|
|
|
void %test2(int %V) {
|
|
%C1 = setne int %V, 4
|
|
%C2 = setne int %V, 17
|
|
%CN = and bool %C1, %C2
|
|
br bool %CN, label %T, label %F
|
|
T:
|
|
call void %foo1()
|
|
ret void
|
|
F:
|
|
call void %foo2()
|
|
ret void
|
|
}
|
|
|
|
|