aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/store-merge.ll
blob: e334c90c9bee005d63e2638de464a92e09a80156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; RUN: opt %s -instcombine -S | \
; RUN:    grep {ret i32 %.toremerge} | count 2
;; Simple sinking tests

; "if then else"
define i32 @test1(i1 %C) {
	%A = alloca i32
        br i1 %C, label %Cond, label %Cond2

Cond:
        store i32 -987654321, i32* %A
        br label %Cont

Cond2:
	store i32 47, i32* %A
	br label %Cont

Cont:
	%V = load i32* %A
	ret i32 %V
}

; "if then"
define i32 @test2(i1 %C) {
	%A = alloca i32
	store i32 47, i32* %A
        br i1 %C, label %Cond, label %Cont

Cond:
        store i32 -987654321, i32* %A
        br label %Cont

Cont:
	%V = load i32* %A
	ret i32 %V
}