mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
17 lines
436 B
LLVM
17 lines
436 B
LLVM
|
; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep -C 1 Loop: | grep Canonical
|
||
|
|
||
|
; 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
|
||
|
}
|
||
|
|