mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
d84561bf69
In a previous iteration of the pass, we would try to compensate for writeback by updating later instructions and/or inserting a SUBS to reset the base register if necessary. Since such a SUBS sets the condition flags it's not generally safe to do this. For now, only merge LDR/STRs if there is no writeback to the base register (LDM that loads into the base register) or the base register is killed by one of the merged instructions. These cases are clear wins both in terms of instruction count and performance. Also add three new test cases, and update the existing ones accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215729 91177308-0d34-0410-b5e6-96231b3b80d8
18 lines
431 B
LLVM
18 lines
431 B
LLVM
; RUN: llc < %s -mtriple=thumbv6m-eabi -verify-machineinstrs -o - | FileCheck %s
|
|
|
|
define void @foo(i32* %A) #0 {
|
|
entry:
|
|
; CHECK-LABEL: foo:
|
|
; CHECK: push {r7, lr}
|
|
; CHECK: ldr
|
|
; CHECK-NEXT: ldr
|
|
; CHECK-NEXT: bl
|
|
%0 = load i32* %A, align 4
|
|
%arrayidx1 = getelementptr inbounds i32* %A, i32 1
|
|
%1 = load i32* %arrayidx1, align 4
|
|
tail call void @bar(i32* %A, i32 %0, i32 %1) #2
|
|
ret void
|
|
}
|
|
|
|
declare void @bar(i32*, i32, i32) #1
|