mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Teach InstructionSimplify the trick of skipping incoming phi
values that are equal to the phi itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -469,3 +469,22 @@ ret:
|
||||
; CHECK: @test20
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
define i1 @test21(i1 %c1, i1 %c2) {
|
||||
%a = alloca i32
|
||||
%b = alloca i32
|
||||
%c = alloca i32
|
||||
br i1 %c1, label %true, label %false
|
||||
true:
|
||||
br label %loop
|
||||
false:
|
||||
br label %loop
|
||||
loop:
|
||||
%p = phi i32* [ %a, %true ], [ %b, %false ], [ %p, %loop ]
|
||||
%r = icmp eq i32* %p, %c
|
||||
br i1 %c2, label %ret, label %loop
|
||||
ret:
|
||||
ret i1 %r
|
||||
; CHECK: @test21
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user