2016-07-19 21:35:11 +08:00
|
|
|
; RUN: llc -mtriple=arm64-eabi -mcpu=cyclone < %s | FileCheck %s
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
; CHECK: foo
|
[DAG] Improve Aliasing of operations to static alloca
Re-recommiting after landing DAG extension-crash fix.
Recommiting after adding check to avoid miscomputing alias information
on addresses of the same base but different subindices.
Memory accesses offset from frame indices may alias, e.g., we
may merge write from function arguments passed on the stack when they
are contiguous. As a result, when checking aliasing, we consider the
underlying frame index's offset from the stack pointer.
Static allocs are realized as stack objects in SelectionDAG, but its
offset is not set until post-DAG causing DAGCombiner's alias check to
consider access to static allocas to frequently alias. Modify isAlias
to consider access between static allocas and access from other frame
objects to be considered aliasing.
Many test changes are included here. Most are fixes for tests which
indirectly relied on our aliasing ability and needed to be modified to
preserve their original intent.
The remaining tests have minor improvements due to relaxed
ordering. The exception is CodeGen/X86/2011-10-19-widen_vselect.ll
which has a minor degradation dispite though the pre-legalized DAG is
improved.
Reviewers: rnk, mkuper, jonpa, hfinkel, uweigand
Reviewed By: rnk
Subscribers: sdardis, nemanjai, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33345
llvm-svn: 308350
2017-07-19 04:06:24 +08:00
|
|
|
; CHECK-DAG: str w[[REG0:[0-9]+]], [x19, #132]
|
|
|
|
; CHECK-DAG: str w[[REG0]], [x19, #264]
|
2014-03-29 18:18:08 +08:00
|
|
|
define i32 @foo(i32 %a) nounwind {
|
|
|
|
%retval = alloca i32, align 4
|
|
|
|
%a.addr = alloca i32, align 4
|
|
|
|
%arr = alloca [32 x i32], align 4
|
|
|
|
%i = alloca i32, align 4
|
|
|
|
%arr2 = alloca [32 x i32], align 4
|
|
|
|
%j = alloca i32, align 4
|
|
|
|
store i32 %a, i32* %a.addr, align 4
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load i32, i32* %a.addr, align 4
|
2014-03-29 18:18:08 +08:00
|
|
|
%tmp1 = zext i32 %tmp to i64
|
|
|
|
%v = mul i64 4, %tmp1
|
|
|
|
%vla = alloca i8, i64 %v, align 4
|
|
|
|
%tmp2 = bitcast i8* %vla to i32*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp3 = load i32, i32* %a.addr, align 4
|
2014-03-29 18:18:08 +08:00
|
|
|
store i32 %tmp3, i32* %i, align 4
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp4 = load i32, i32* %a.addr, align 4
|
2014-03-29 18:18:08 +08:00
|
|
|
store i32 %tmp4, i32* %j, align 4
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp5 = load i32, i32* %j, align 4
|
2014-03-29 18:18:08 +08:00
|
|
|
store i32 %tmp5, i32* %retval
|
2015-02-28 05:17:42 +08:00
|
|
|
%x = load i32, i32* %retval
|
2014-03-29 18:18:08 +08:00
|
|
|
ret i32 %x
|
|
|
|
}
|