mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 03:29:40 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41097 91177308-0d34-0410-b5e6-96231b3b80d8
41 lines
939 B
LLVM
41 lines
939 B
LLVM
; Check that this test makes INDVAR and related stuff dead.
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | count 2
|
|
|
|
declare bool %pred()
|
|
|
|
void %test1({ int, int }* %P) {
|
|
br label %Loop
|
|
Loop:
|
|
%INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
|
|
|
|
%gep1 = getelementptr { int, int}* %P, int %INDVAR, uint 0
|
|
store int 0, int* %gep1
|
|
|
|
%gep2 = getelementptr { int, int}* %P, int %INDVAR, uint 1
|
|
store int 0, int* %gep2
|
|
|
|
%INDVAR2 = add int %INDVAR, 1
|
|
%cond = call bool %pred()
|
|
br bool %cond, label %Loop, label %Out
|
|
Out:
|
|
ret void
|
|
}
|
|
|
|
void %test2([2 x int]* %P) {
|
|
br label %Loop
|
|
Loop:
|
|
%INDVAR = phi int [0, %0], [%INDVAR2, %Loop]
|
|
|
|
%gep1 = getelementptr [2 x int]* %P, int %INDVAR, uint 0
|
|
store int 0, int* %gep1
|
|
|
|
%gep2 = getelementptr [2 x int]* %P, int %INDVAR, uint 1
|
|
store int 0, int* %gep2
|
|
|
|
%INDVAR2 = add int %INDVAR, 1
|
|
%cond = call bool %pred()
|
|
br bool %cond, label %Loop, label %Out
|
|
Out:
|
|
ret void
|
|
}
|