2015-07-29 06:44:28 +08:00
|
|
|
; RUN: llc -mtriple=arm-eabi -pre-RA-sched=source -mattr=+strict-align %s -o - \
|
2014-04-04 00:01:44 +08:00
|
|
|
; RUN: | FileCheck %s -check-prefix=EXPANDED
|
|
|
|
|
2015-07-29 06:44:28 +08:00
|
|
|
; RUN: llc -mtriple=armv6-apple-darwin -mcpu=cortex-a8 -mattr=-neon,+strict-align -pre-RA-sched=source %s -o - \
|
2014-04-04 00:01:44 +08:00
|
|
|
; RUN: | FileCheck %s -check-prefix=EXPANDED
|
|
|
|
|
|
|
|
; RUN: llc -mtriple=armv6-apple-darwin -mcpu=cortex-a8 %s -o - \
|
|
|
|
; RUN: | FileCheck %s -check-prefix=UNALIGNED
|
2007-08-02 03:34:21 +08:00
|
|
|
|
2009-08-16 05:21:19 +08:00
|
|
|
; rdar://7113725
|
2012-08-16 01:44:53 +08:00
|
|
|
; rdar://12091029
|
2007-08-02 03:34:21 +08:00
|
|
|
|
2010-06-17 23:18:27 +08:00
|
|
|
define void @t(i8* nocapture %a, i8* nocapture %b) nounwind {
|
2009-08-16 05:14:01 +08:00
|
|
|
entry:
|
2013-07-14 14:24:09 +08:00
|
|
|
; EXPANDED-LABEL: t:
|
[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-14 01:07:09 +08:00
|
|
|
; EXPANDED-DAG: ldrb [[R2:r[0-9]+]]
|
|
|
|
; EXPANDED-DAG: ldrb [[R3:r[0-9]+]]
|
|
|
|
; EXPANDED-DAG: ldrb [[R12:r[0-9]+]]
|
|
|
|
; EXPANDED-DAG: ldrb [[R1:r[0-9]+]]
|
|
|
|
; EXPANDED-DAG: strb [[R1]]
|
|
|
|
; EXPANDED-DAG: strb [[R12]]
|
|
|
|
; EXPANDED-DAG: strb [[R3]]
|
|
|
|
; EXPANDED-DAG: strb [[R2]]
|
2012-08-16 01:44:53 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNALIGNED-LABEL: t:
|
2012-08-16 01:44:53 +08:00
|
|
|
; UNALIGNED: ldr r1
|
|
|
|
; UNALIGNED: str r1
|
2009-08-16 05:21:19 +08:00
|
|
|
|
|
|
|
%__src1.i = bitcast i8* %b to i32* ; <i32*> [#uses=1]
|
|
|
|
%__dest2.i = bitcast i8* %a to i32* ; <i32*> [#uses=1]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp.i = load i32, i32* %__src1.i, align 1 ; <i32> [#uses=1]
|
2009-08-16 05:21:19 +08:00
|
|
|
store i32 %tmp.i, i32* %__dest2.i, align 1
|
|
|
|
ret void
|
2007-08-02 03:34:21 +08:00
|
|
|
}
|
2012-08-16 01:44:53 +08:00
|
|
|
|
|
|
|
define void @hword(double* %a, double* %b) nounwind {
|
|
|
|
entry:
|
2013-07-14 14:24:09 +08:00
|
|
|
; EXPANDED-LABEL: hword:
|
2012-08-16 01:44:53 +08:00
|
|
|
; EXPANDED-NOT: vld1
|
|
|
|
; EXPANDED: ldrh
|
|
|
|
; EXPANDED-NOT: str1
|
|
|
|
; EXPANDED: strh
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNALIGNED-LABEL: hword:
|
2012-08-16 01:44:53 +08:00
|
|
|
; UNALIGNED: vld1.16
|
|
|
|
; UNALIGNED: vst1.16
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load double, double* %a, align 2
|
2012-08-16 01:44:53 +08:00
|
|
|
store double %tmp, double* %b, align 2
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @byte(double* %a, double* %b) nounwind {
|
|
|
|
entry:
|
2013-07-14 14:24:09 +08:00
|
|
|
; EXPANDED-LABEL: byte:
|
2012-08-16 01:44:53 +08:00
|
|
|
; EXPANDED-NOT: vld1
|
|
|
|
; EXPANDED: ldrb
|
|
|
|
; EXPANDED-NOT: str1
|
|
|
|
; EXPANDED: strb
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNALIGNED-LABEL: byte:
|
2012-08-16 01:44:53 +08:00
|
|
|
; UNALIGNED: vld1.8
|
|
|
|
; UNALIGNED: vst1.8
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load double, double* %a, align 1
|
2012-08-16 01:44:53 +08:00
|
|
|
store double %tmp, double* %b, align 1
|
|
|
|
ret void
|
|
|
|
}
|
2012-09-18 09:42:45 +08:00
|
|
|
|
|
|
|
define void @byte_word_ops(i32* %a, i32* %b) nounwind {
|
|
|
|
entry:
|
2013-07-14 14:24:09 +08:00
|
|
|
; EXPANDED-LABEL: byte_word_ops:
|
2012-09-18 09:42:45 +08:00
|
|
|
; EXPANDED: ldrb
|
|
|
|
; EXPANDED: strb
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; UNALIGNED-LABEL: byte_word_ops:
|
2012-09-18 09:42:45 +08:00
|
|
|
; UNALIGNED-NOT: ldrb
|
|
|
|
; UNALIGNED: ldr
|
|
|
|
; UNALIGNED-NOT: strb
|
|
|
|
; UNALIGNED: str
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load i32, i32* %a, align 1
|
2012-09-18 09:42:45 +08:00
|
|
|
store i32 %tmp, i32* %b, align 1
|
|
|
|
ret void
|
|
|
|
}
|