mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
69ccadd753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
452 B
LLVM
17 lines
452 B
LLVM
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | %prcontext Loop: 1 | grep %indvar
|
|
|
|
; The indvar simplification code should ensure that the first PHI in the block
|
|
; is the canonical one!
|
|
|
|
int %test() {
|
|
br label %Loop
|
|
Loop:
|
|
%NonIndvar = phi int [200, %0], [%NonIndvarNext, %Loop]
|
|
%Canonical = phi int [0, %0], [%CanonicalNext, %Loop]
|
|
|
|
%NonIndvarNext = div int %NonIndvar, 2
|
|
%CanonicalNext = add int %Canonical, 1
|
|
br label %Loop
|
|
}
|
|
|