• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
2
3define i32 @main(i32** %p) {
4block1:
5	br i1 true, label %block2, label %block3
6
7block2:
8 %a = load i32** %p
9 br label %block4
10
11block3:
12  %b = load i32** %p
13  br label %block4
14
15block4:
16; CHECK-NOT: %existingPHI = phi
17; CHECK: %DEAD = phi
18  %existingPHI = phi i32* [ %a, %block2 ], [ %b, %block3 ]
19  %DEAD = load i32** %p
20  %c = load i32* %DEAD
21  %d = load i32* %existingPHI
22  %e = add i32 %c, %d
23  ret i32 %e
24}
25