1 ; The loop sinker was running from the bottom of the loop to the top, causing
2 ; it to miss opportunities to sink instructions that depended on sinking other
3 ; instructions from the loop. Instead they got hoisted, which is better than
4 ; leaving them in the loop, but increases register pressure pointlessly.
6 ; RUN: llvm-as < %s | opt -licm | llvm-dis | \
7 ; RUN: %prcontext getelementptr 1 | grep Out:
9 %Ty = type { i32, i32 }
10 @X = external global %Ty ; <%Ty*> [#uses=1]
14 Loop: ; preds = %Loop, %0
15 %dead = getelementptr %Ty* @X, i64 0, i32 0 ; <i32*> [#uses=1]
16 %sunk2 = load i32* %dead ; <i32> [#uses=1]
17 br i1 false, label %Loop, label %Out