• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Mem2reg used to only add one incoming value to a PHI node, even if it had
2; multiple incoming edges from a block.
3;
4; RUN: opt < %s -mem2reg -disable-output
5
6define i32 @test(i1 %c1, i1 %c2) {
7	%X = alloca i32		; <i32*> [#uses=2]
8	br i1 %c1, label %Exit, label %B2
9B2:		; preds = %0
10	store i32 2, i32* %X
11	br i1 %c2, label %Exit, label %Exit
12Exit:		; preds = %B2, %B2, %0
13	%Y = load i32* %X		; <i32> [#uses=1]
14	ret i32 %Y
15}
16
17