brintos

brintos / llvm-project-archived public Read only

0
0
Text · 655 B · 00e9670 Raw
22 lines · plain
1; Check that the index of 'P[outer]' is pulled out of the loop.2; RUN: opt < %s -loop-reduce -S | \3; RUN:   not grep "getelementptr.*ptr %INDVAR"4 5target datalayout = "e-p:32:32:32-n32"6declare i1 @pred()7 8define void @test(ptr %P, i32 %outer) {9; <label>:010	br label %Loop11Loop:		; preds = %Loop, %012	%INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ]		; <i32> [#uses=2]13	%STRRED = getelementptr [10000 x i32], ptr %P, i32 %outer, i32 %INDVAR		; <ptr> [#uses=1]14	store i32 0, ptr %STRRED15	%INDVAR2 = add i32 %INDVAR, 1		; <i32> [#uses=1]16	%cond = call i1 @pred( )		; <i1> [#uses=1]17	br i1 %cond, label %Loop, label %Out18Out:		; preds = %Loop19	ret void20}21 22