mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-26 14:33:02 +02:00
9ebcb8b246
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. llvm-svn: 215729
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
|