mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
fc1584be52
Summary: Following https://reviews.llvm.org/D82607. Reviewers: ychen Subscribers: asbirlea, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82688
26 lines
536 B
LLVM
26 lines
536 B
LLVM
; RUN: opt < %s -basic-aa -gvn -S | FileCheck %s
|
|
|
|
define i32 @main(i32** %p, i32 %x, i32 %y) {
|
|
block1:
|
|
%cmp = icmp eq i32 %x, %y
|
|
br i1 %cmp , label %block2, label %block3
|
|
|
|
block2:
|
|
%a = load i32*, i32** %p
|
|
br label %block4
|
|
|
|
block3:
|
|
%b = load i32*, i32** %p
|
|
br label %block4
|
|
|
|
block4:
|
|
; CHECK-NOT: %existingPHI = phi
|
|
; CHECK: %DEAD = phi
|
|
%existingPHI = phi i32* [ %a, %block2 ], [ %b, %block3 ]
|
|
%DEAD = load i32*, i32** %p
|
|
%c = load i32, i32* %DEAD
|
|
%d = load i32, i32* %existingPHI
|
|
%e = add i32 %c, %d
|
|
ret i32 %e
|
|
}
|