llvm-6502/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll
2006-12-02 04:23:10 +00:00

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
}