mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
In which I discover the existence of loops. Threading an operation
over a phi node by applying it to each operand may be wrong if the operation and the phi node are mutually interdependent (the testcase has a simple example of this). So only do this transform if it would be correct to perform the operation in each predecessor of the block containing the phi, i.e. if the other operands all dominate the phi. This should fix the FFMPEG snow.c regression reported by İsmail Dönmez. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119347 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -488,3 +488,18 @@ ret:
|
||||
; CHECK: @test21
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
define void @test22() {
|
||||
; CHECK: @test22
|
||||
entry:
|
||||
br label %loop
|
||||
loop:
|
||||
%phi = phi i32 [ 0, %entry ], [ %y, %loop ]
|
||||
%y = add i32 %phi, 1
|
||||
%o = or i32 %y, %phi
|
||||
%e = icmp eq i32 %o, %y
|
||||
br i1 %e, label %loop, label %ret
|
||||
; CHECK: br i1 %e
|
||||
ret:
|
||||
ret void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user