mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-17 02:46:00 +00:00

Move the stdu instruction in the prologue and epilogue. This should provide a small performance boost in functions that are able to do this. I've kept this change rather conservative at the moment and functions with frame pointers or base pointers will not try to move the stack pointer update. Differential Revision: https://reviews.llvm.org/D42590 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355085 91177308-0d34-0410-b5e6-96231b3b80d8
55 lines
2.0 KiB
LLVM
55 lines
2.0 KiB
LLVM
; RUN: llc -verify-machineinstrs -mtriple="powerpc64le-unknown-linux-gnu" -relocation-model=pic < %s | FileCheck %s
|
|
|
|
@a = thread_local global i32* null, align 8
|
|
|
|
define void @test_foo(i32* nocapture %x01, i32* nocapture %x02, i32* nocapture %x03, i32* nocapture %x04, i32* nocapture %x05, i32* nocapture %x06, i32* nocapture %x07, i32* nocapture %x08) #0 {
|
|
entry:
|
|
|
|
; CHECK-LABEL: test_foo:
|
|
; CHECK-DAG: stdu 1, {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: mr [[BACKUP_3:[0-9]+]], 3
|
|
; CHECK-DAG: mr [[BACKUP_4:[0-9]+]], 4
|
|
; CHECK-DAG: mr [[BACKUP_5:[0-9]+]], 5
|
|
; CHECK-DAG: mr [[BACKUP_6:[0-9]+]], 6
|
|
; CHECK-DAG: mr [[BACKUP_7:[0-9]+]], 7
|
|
; CHECK-DAG: mr [[BACKUP_8:[0-9]+]], 8
|
|
; CHECK-DAG: mr [[BACKUP_9:[0-9]+]], 9
|
|
; CHECK-DAG: mr [[BACKUP_10:[0-9]+]], 10
|
|
; CHECK-DAG: std [[BACKUP_3]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_4]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_5]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_6]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_7]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_8]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_9]], {{-?[0-9]+}}(1)
|
|
; CHECK-DAG: std [[BACKUP_10]], {{-?[0-9]+}}(1)
|
|
; CHECK: bl __tls_get_addr
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_3]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_4]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_5]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_6]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_7]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_8]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_9]])
|
|
; CHECK-DAG: stw 3, 0([[BACKUP_10]])
|
|
; CHECK: blr
|
|
|
|
%0 = load i32*, i32** @a, align 8
|
|
%cmp = icmp eq i32* %0, null
|
|
br i1 %cmp, label %return, label %if.end
|
|
|
|
if.end: ; preds = %entry
|
|
store i32 0, i32* %x01, align 4
|
|
store i32 0, i32* %x02, align 4
|
|
store i32 0, i32* %x03, align 4
|
|
store i32 0, i32* %x04, align 4
|
|
store i32 0, i32* %x05, align 4
|
|
store i32 0, i32* %x06, align 4
|
|
store i32 0, i32* %x07, align 4
|
|
store i32 0, i32* %x08, align 4
|
|
br label %return
|
|
|
|
return: ; preds = %entry, %if.end
|
|
ret void
|
|
}
|