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