2014-12-01 10:55:24 +08:00
|
|
|
; RUN: opt -gvn -S < %s | FileCheck %s
|
|
|
|
|
|
|
|
; Check that an unreachable predecessor to a PHI node doesn't cause a crash.
|
|
|
|
; PR21625.
|
|
|
|
|
|
|
|
define i32 @f(i32** %f) {
|
|
|
|
; CHECK: bb0:
|
|
|
|
; Load should be removed, since it's ignored.
|
|
|
|
; CHECK-NEXT: br label
|
|
|
|
bb0:
|
2015-02-28 05:17:42 +08:00
|
|
|
%bar = load i32*, i32** %f
|
2014-12-01 10:55:24 +08:00
|
|
|
br label %bb2
|
|
|
|
bb1:
|
2015-02-28 05:17:42 +08:00
|
|
|
%zed = load i32*, i32** %f
|
2014-12-01 10:55:24 +08:00
|
|
|
br i1 false, label %bb1, label %bb2
|
|
|
|
bb2:
|
|
|
|
%foo = phi i32* [ null, %bb0 ], [ %zed, %bb1 ]
|
2015-02-28 05:17:42 +08:00
|
|
|
%storemerge = load i32, i32* %foo
|
2014-12-01 10:55:24 +08:00
|
|
|
ret i32 %storemerge
|
|
|
|
}
|