OSDN Git Service

It's not necessary to do rounding for alloca operations when the requested
[android-x86/external-llvm.git] / test / Transforms / ScalarRepl / select_promote.ll
1 ; Test promotion of loads that use the result of a select instruction.  This
2 ; should be simplified by the instcombine pass.
3
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | not grep alloca
5
6 int %main() {
7         %mem_tmp.0 = alloca int         ; <int*> [#uses=3]
8         %mem_tmp.1 = alloca int         ; <int*> [#uses=3]
9         store int 0, int* %mem_tmp.0
10         store int 1, int* %mem_tmp.1
11         %tmp.1.i = load int* %mem_tmp.1         ; <int> [#uses=1]
12         %tmp.3.i = load int* %mem_tmp.0         ; <int> [#uses=1]
13         %tmp.4.i = setle int %tmp.1.i, %tmp.3.i         ; <bool> [#uses=1]
14         %mem_tmp.i.0 = select bool %tmp.4.i, int* %mem_tmp.1, int* %mem_tmp.0           ; <int*> [#uses=1]
15         %tmp.3 = load int* %mem_tmp.i.0         ; <int> [#uses=1]
16         ret int %tmp.3
17 }
18