2013-08-01 10:18:55 +02:00
|
|
|
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK-LABEL: f0Test
|
|
|
|
; CHECK: entsp 1
|
|
|
|
; CHECK: bl f0
|
|
|
|
; CHECK: retsp 1
|
|
|
|
%struct.st0 = type { [0 x i32] }
|
|
|
|
declare void @f0(%struct.st0*) nounwind
|
2020-11-20 16:52:27 +01:00
|
|
|
define void @f0Test(%struct.st0* byval(%struct.st0) %s0) nounwind {
|
2013-08-01 10:18:55 +02:00
|
|
|
entry:
|
|
|
|
call void @f0(%struct.st0* %s0) nounwind
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f1Test
|
|
|
|
; CHECK: entsp 13
|
|
|
|
; CHECK: stw r4, sp[12]
|
|
|
|
; CHECK: stw r5, sp[11]
|
|
|
|
; CHECK: mov r4, r0
|
|
|
|
; CHECK: ldaw r5, sp[1]
|
|
|
|
; CHECK: ldc r2, 40
|
|
|
|
; CHECK: mov r0, r5
|
2014-02-27 14:39:07 +01:00
|
|
|
; CHECK: bl __memcpy_4
|
2013-08-01 10:18:55 +02:00
|
|
|
; CHECK: mov r0, r5
|
|
|
|
; CHECK: bl f1
|
|
|
|
; CHECK: mov r0, r4
|
|
|
|
; CHECK: ldw r5, sp[11]
|
|
|
|
; CHECK: ldw r4, sp[12]
|
|
|
|
; CHECK: retsp 13
|
|
|
|
%struct.st1 = type { [10 x i32] }
|
|
|
|
declare void @f1(%struct.st1*) nounwind
|
2020-11-20 16:52:27 +01:00
|
|
|
define i32 @f1Test(i32 %i, %struct.st1* byval(%struct.st1) %s1) nounwind {
|
2013-08-01 10:18:55 +02:00
|
|
|
entry:
|
|
|
|
call void @f1(%struct.st1* %s1) nounwind
|
|
|
|
ret i32 %i
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f2Test
|
|
|
|
; CHECK: extsp 4
|
|
|
|
; CHECK: stw lr, sp[1]
|
2018-02-26 09:03:32 +01:00
|
|
|
; CHECK: mov r11, r1
|
[DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.
Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.
CodeGen tests with non-reordering changes:
X86/aligned-variadic.ll -- memory-based add folded into stored leaq
value.
X86/constant-combiners.ll -- Optimizes out overlap between stores.
X86/pr40631_deadstore_elision -- folds constant byte store into
preceding quad word constant store.
Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet
Reviewed By: courbet
Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59260
llvm-svn: 356068
2019-03-13 18:07:09 +01:00
|
|
|
; CHECK-DAG: stw r2, sp[3]
|
|
|
|
; CHECK-DAG: stw r3, sp[4]
|
2013-08-01 10:18:55 +02:00
|
|
|
; CHECK: ldw r0, r0[0]
|
|
|
|
; CHECK: stw r0, sp[2]
|
2018-02-26 09:03:32 +01:00
|
|
|
; CHECK: ldaw r1, sp[2]
|
|
|
|
; CHECK: mov r0, r11
|
2013-08-01 10:18:55 +02:00
|
|
|
; CHECK: bl f2
|
|
|
|
; CHECK: ldw lr, sp[1]
|
|
|
|
; CHECK: ldaw sp, sp[4]
|
|
|
|
; CHECK: retsp 0
|
|
|
|
%struct.st2 = type { i32 }
|
|
|
|
declare void @f2(i32, %struct.st2*) nounwind
|
2020-11-20 16:52:27 +01:00
|
|
|
define void @f2Test(%struct.st2* byval(%struct.st2) %s2, i32 %i, ...) nounwind {
|
2013-08-01 10:18:55 +02:00
|
|
|
entry:
|
|
|
|
call void @f2(i32 %i, %struct.st2* %s2)
|
|
|
|
ret void
|
|
|
|
}
|
2013-11-12 11:11:35 +01:00
|
|
|
|
|
|
|
; CHECK-LABEL: f3Test
|
|
|
|
; CHECK: entsp 2
|
|
|
|
; CHECK: ldc r1, 0
|
|
|
|
; CHECK: ld8u r2, r0[r1]
|
|
|
|
; CHECK: ldaw r0, sp[1]
|
|
|
|
; CHECK: st8 r2, r0[r1]
|
|
|
|
; CHECK: bl f
|
|
|
|
; CHECK: retsp 2
|
|
|
|
declare void @f3(i8*) nounwind
|
2020-11-20 16:52:27 +01:00
|
|
|
define void @f3Test(i8* byval(i8) %v) nounwind {
|
2013-11-12 11:11:35 +01:00
|
|
|
entry:
|
|
|
|
call void @f3(i8* %v) nounwind
|
|
|
|
ret void
|
|
|
|
}
|