[llvm] r366313 - AMDGPU: Improve alias analysis for GDS
Nicolai Haehnle via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 17 04:22:19 PDT 2019
Author: nha
Date: Wed Jul 17 04:22:19 2019
New Revision: 366313
URL: http://llvm.org/viewvc/llvm-project?rev=366313&view=rev
Log:
AMDGPU: Improve alias analysis for GDS
Summary: GDS cannot alias anything else.
Original patch by: Marek Olšák
Reviewers: arsenm, mareko
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64114
Change-Id: I07bfbd96f5d5c37a6dfba7997df12f291dd794b0
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp?rev=366313&r1=366312&r2=366313&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp Wed Jul 17 04:22:19 2019
@@ -56,13 +56,13 @@ void AMDGPUAAWrapperPass::getAnalysisUsa
// These arrays are indexed by address space value enum elements 0 ... to 7
static const AliasResult ASAliasRules[8][8] = {
/* Flat Global Region Group Constant Private Constant 32-bit Buffer Fat Ptr */
- /* Flat */ {MayAlias, MayAlias, MayAlias, MayAlias, MayAlias, MayAlias, MayAlias, MayAlias},
+ /* Flat */ {MayAlias, MayAlias, NoAlias, MayAlias, MayAlias, MayAlias, MayAlias, MayAlias},
/* Global */ {MayAlias, MayAlias, NoAlias , NoAlias , MayAlias, NoAlias , MayAlias, MayAlias},
- /* Region */ {MayAlias, NoAlias , NoAlias , NoAlias , MayAlias, NoAlias , MayAlias, NoAlias},
+ /* Region */ {NoAlias, NoAlias , MayAlias, NoAlias , NoAlias, NoAlias , NoAlias, NoAlias},
/* Group */ {MayAlias, NoAlias , NoAlias , MayAlias, NoAlias , NoAlias , NoAlias , NoAlias},
- /* Constant */ {MayAlias, MayAlias, MayAlias, NoAlias , NoAlias , NoAlias , MayAlias, MayAlias},
+ /* Constant */ {MayAlias, MayAlias, NoAlias, NoAlias , NoAlias , NoAlias , MayAlias, MayAlias},
/* Private */ {MayAlias, NoAlias , NoAlias , NoAlias , NoAlias , MayAlias, NoAlias , NoAlias},
- /* Constant 32-bit */ {MayAlias, MayAlias, MayAlias, NoAlias , MayAlias, NoAlias , NoAlias , MayAlias},
+ /* Constant 32-bit */ {MayAlias, MayAlias, NoAlias, NoAlias , MayAlias, NoAlias , NoAlias , MayAlias},
/* Buffer Fat Ptr */ {MayAlias, MayAlias, NoAlias , NoAlias , MayAlias, NoAlias , MayAlias, MayAlias}
};
Modified: llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll?rev=366313&r1=366312&r2=366313&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll Wed Jul 17 04:22:19 2019
@@ -51,42 +51,77 @@ define void @test_999_1(i8 addrspace(999
ret void
}
+; CHECK: NoAlias: i8 addrspace(2)* %p, i8* %p1
+define void @test_region_vs_flat(i8 addrspace(2)* %p, i8 addrspace(0)* %p1) {
+ ret void
+}
+
+; CHECK: NoAlias: i8 addrspace(1)* %p1, i8 addrspace(2)* %p
+define void @test_region_vs_global(i8 addrspace(2)* %p, i8 addrspace(1)* %p1) {
+ ret void
+}
+
+; CHECK: MayAlias: i8 addrspace(2)* %p, i8 addrspace(2)* %p1
+define void @test_region(i8 addrspace(2)* %p, i8 addrspace(2)* %p1) {
+ ret void
+}
+
+; CHECK: NoAlias: i8 addrspace(2)* %p, i8 addrspace(3)* %p1
+define void @test_region_vs_group(i8 addrspace(2)* %p, i8 addrspace(3)* %p1) {
+ ret void
+}
+
+; CHECK: NoAlias: i8 addrspace(2)* %p, i8 addrspace(4)* %p1
+define void @test_region_vs_constant(i8 addrspace(2)* %p, i8 addrspace(4)* %p1) {
+ ret void
+}
+
+; CHECK: NoAlias: i8 addrspace(2)* %p, i8 addrspace(5)* %p1
+define void @test_region_vs_private(i8 addrspace(2)* %p, i8 addrspace(5)* %p1) {
+ ret void
+}
+
+; CHECK: NoAlias: i8 addrspace(2)* %p, i8 addrspace(6)* %p1
+define void @test_region_vs_const32(i8 addrspace(2)* %p, i8 addrspace(6)* %p1) {
+ ret void
+}
+
; CHECK: MayAlias: i8 addrspace(7)* %p, i8* %p1
define void @test_7_0(i8 addrspace(7)* %p, i8 addrspace(0)* %p1) {
- ret void
+ ret void
}
; CHECK: MayAlias: i8 addrspace(1)* %p1, i8 addrspace(7)* %p
define void @test_7_1(i8 addrspace(7)* %p, i8 addrspace(1)* %p1) {
- ret void
+ ret void
}
; CHECK: NoAlias: i8 addrspace(2)* %p1, i8 addrspace(7)* %p
define void @test_7_2(i8 addrspace(7)* %p, i8 addrspace(2)* %p1) {
- ret void
+ ret void
}
; CHECK: NoAlias: i8 addrspace(3)* %p1, i8 addrspace(7)* %p
define void @test_7_3(i8 addrspace(7)* %p, i8 addrspace(3)* %p1) {
- ret void
+ ret void
}
; CHECK: MayAlias: i8 addrspace(4)* %p1, i8 addrspace(7)* %p
define void @test_7_4(i8 addrspace(7)* %p, i8 addrspace(4)* %p1) {
- ret void
+ ret void
}
; CHECK: NoAlias: i8 addrspace(5)* %p1, i8 addrspace(7)* %p
define void @test_7_5(i8 addrspace(7)* %p, i8 addrspace(5)* %p1) {
- ret void
+ ret void
}
; CHECK: MayAlias: i8 addrspace(6)* %p1, i8 addrspace(7)* %p
define void @test_7_6(i8 addrspace(7)* %p, i8 addrspace(6)* %p1) {
- ret void
+ ret void
}
; CHECK: MayAlias: i8 addrspace(7)* %p, i8 addrspace(7)* %p1
define void @test_7_7(i8 addrspace(7)* %p, i8 addrspace(7)* %p1) {
- ret void
+ ret void
}
More information about the llvm-commits
mailing list