mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-25 14:32:53 +00:00
3a4c856323
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48527 91177308-0d34-0410-b5e6-96231b3b80d8
22 lines
730 B
LLVM
22 lines
730 B
LLVM
; 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.
|
|
|
|
; RUN: llvm-as < %s | opt -licm | llvm-dis | \
|
|
; RUN: %prcontext getelementptr 1 | grep Out:
|
|
|
|
%Ty = type { i32, i32 }
|
|
@X = external global %Ty ; <%Ty*> [#uses=1]
|
|
|
|
define i32 @test() {
|
|
br label %Loop
|
|
Loop: ; preds = %Loop, %0
|
|
%dead = getelementptr %Ty* @X, i64 0, i32 0 ; <i32*> [#uses=1]
|
|
%sunk2 = load i32* %dead ; <i32> [#uses=1]
|
|
br i1 false, label %Loop, label %Out
|
|
Out: ; preds = %Loop
|
|
ret i32 %sunk2
|
|
}
|
|
|