-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Aliasing of operations to static alloca
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: 308025
- Loading branch information
1 parent
89ca10d
commit a8f63af
Showing
24 changed files
with
168 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
llvm/test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| ; RUN: llc -o - -mtriple=x86_64-linux-gnu %s | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-unknown-linux-gnu" | ||
|
|
||
| ; We should be able to bypass the load values to their corresponding | ||
| ; stores here. | ||
|
|
||
| ; CHECK-LABEL: foo | ||
| ; CHECK-DAG: movl %esi, -8(%rsp) | ||
| ; CHECK-DAG: movl %ecx, -16(%rsp) | ||
| ; CHECK-DAG: movl %edi, -4(%rsp) | ||
| ; CHECK-DAG: movl %edx, -12(%rsp) | ||
| ; CHECK: leal | ||
| ; CHECK: addl | ||
| ; CHECK: addl | ||
| ; CHECK: retq | ||
|
|
||
| define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) { | ||
| entry: | ||
| %a0 = alloca i32 | ||
| %a1 = alloca i32 | ||
| %a2 = alloca i32 | ||
| %a3 = alloca i32 | ||
| store i32 %b, i32* %a1 | ||
| store i32 %d, i32* %a3 | ||
| store i32 %a, i32* %a0 | ||
| store i32 %c, i32* %a2 | ||
| %l0 = load i32, i32* %a0 | ||
| %l1 = load i32, i32* %a1 | ||
| %l2 = load i32, i32* %a2 | ||
| %l3 = load i32, i32* %a3 | ||
| %add0 = add nsw i32 %l0, %l1 | ||
| %add1 = add nsw i32 %add0, %l2 | ||
| %add2 = add nsw i32 %add1, %l3 | ||
| ret i32 %add2 | ||
| } |
Oops, something went wrong.