2003-12-19 06:54:37 +00:00
|
|
|
; The loop sinker was running from the bottom of the loop to the top, causing
|
|
|
|
; it to miss opportunities to sink instructions that depended on sinking other
|
|
|
|
; instructions from the loop. Instead they got hoisted, which is better than
|
|
|
|
; leaving them in the loop, but increases register pressure pointlessly.
|
|
|
|
|
2007-04-15 08:30:33 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | \
|
|
|
|
; RUN: %prcontext getelementptr 1 | grep Out:
|
2003-12-19 06:54:37 +00:00
|
|
|
|
|
|
|
%Ty = type { int, int }
|
|
|
|
%X = external global %Ty
|
|
|
|
|
|
|
|
int %test() {
|
|
|
|
br label %Loop
|
|
|
|
Loop:
|
2006-11-23 15:14:52 +00:00
|
|
|
%dead = getelementptr %Ty* %X, long 0, uint 0
|
2003-12-19 06:54:37 +00:00
|
|
|
%sunk2 = load int* %dead
|
|
|
|
br bool false, label %Loop, label %Out
|
|
|
|
Out:
|
|
|
|
ret int %sunk2
|
|
|
|
}
|