RecursivelyDeleteTriviallyDeadInstructions() could remove

more than 1 instruction. The caller need to be aware of this
and adjust instruction iterators accordingly.

rdar://16679376



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207302 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gerolf Hoflehner
2014-04-26 01:19:16 +00:00
parent 9e93e47b7f
commit 4c9277bb9f
3 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
; RUN: opts -instsimplify -S < %s | FileCheck %s
define void @foo() nounwind {
br i1 undef, label %1, label %4
; <label>:1 ; preds = %1, %0
; CHECK-NOT: phi
; CHECK-NOT: sub
%2 = phi i32 [ %3, %1 ], [ undef, %0 ]
%3 = sub i32 0, undef
br label %1
; <label>:4 ; preds = %0
ret void
}