2010-10-18 20:04:47 +02:00
|
|
|
; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
|
2007-07-25 21:57:03 +02:00
|
|
|
|
|
|
|
define i32 @main(i32** %p) {
|
|
|
|
block1:
|
|
|
|
br i1 true, label %block2, label %block3
|
|
|
|
|
|
|
|
block2:
|
|
|
|
%a = load i32** %p
|
|
|
|
br label %block4
|
|
|
|
|
|
|
|
block3:
|
|
|
|
%b = load i32** %p
|
|
|
|
br label %block4
|
|
|
|
|
|
|
|
block4:
|
2010-01-27 23:01:02 +01:00
|
|
|
; CHECK-NOT: %existingPHI = phi
|
|
|
|
; CHECK: %DEAD = phi
|
|
|
|
%existingPHI = phi i32* [ %a, %block2 ], [ %b, %block3 ]
|
2007-07-25 21:57:03 +02:00
|
|
|
%DEAD = load i32** %p
|
|
|
|
%c = load i32* %DEAD
|
2010-01-27 23:01:02 +01:00
|
|
|
%d = load i32* %existingPHI
|
|
|
|
%e = add i32 %c, %d
|
|
|
|
ret i32 %e
|
2007-08-15 15:36:28 +02:00
|
|
|
}
|