https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/218771
>From 7015d43597e690bcf62cd16f6aaae4f97546d986 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak <[email protected]> Date: Thu, 20 Aug 2026 22:04:43 +0000 Subject: [PATCH 1/2] [AMDGPU] Use a disjoint scope domain for merged LDS structs When lowering LDS values, all the values are mutually disjoint, so we can use the newly-added disjoint scopes feature to simplify the IR. AI disclosure: Claude wrote this and I reviewed it and wrote the commit message --- .../AMDGPU/AMDGPULowerModuleLDSPass.cpp | 65 +++++-------------- .../AMDGPU/remove-no-kernel-id-attribute.ll | 20 +++--- 2 files changed, 24 insertions(+), 61 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp index f0f547ae48ceb3..5d09f1327c6a6a 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp @@ -183,8 +183,8 @@ #include "llvm/ADT/BitVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetOperations.h" +#include "llvm/ADT/SmallString.h" #include "llvm/Analysis/CallGraph.h" -#include "llvm/Analysis/ScopedNoAliasAA.h" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" @@ -1418,20 +1418,20 @@ class AMDGPULowerModuleLDS { auto LDSVarsToTransform = sortByName(std::vector<GlobalVariable *>( LDSVarsToTransformArg.begin(), LDSVarsToTransformArg.end())); - // Create alias.scope and their lists. Each field in the new structure - // does not alias with all other fields. + // Create an alias scope per field of the new structure. Each field does + // not alias with all other fields, which is what the domain having + // disjoint scopes records. SmallVector<MDNode *> AliasScopes; - SmallVector<Metadata *> NoAliasList; const size_t NumberVars = LDSVarsToTransform.size(); if (NumberVars > 1) { MDBuilder MDB(Ctx); AliasScopes.reserve(NumberVars); - MDNode *Domain = MDB.createAnonymousAliasScopeDomain(); + MDNode *Domain = + MDB.createAnonymousAliasScopeDomain("", /*DisjointScopes=*/true); for (size_t I = 0; I < NumberVars; I++) { MDNode *Scope = MDB.createAnonymousAliasScope(Domain); AliasScopes.push_back(Scope); } - NoAliasList.append(&AliasScopes[1], AliasScopes.end()); } // Replace uses of ith variable with a constantexpr to the corresponding @@ -1449,61 +1449,29 @@ class AMDGPULowerModuleLDS { Align A = commonAlignment(Replacement.SGV->getAlign().valueOrOne(), Offset); - if (I) - NoAliasList[I - 1] = AliasScopes[I - 1]; - MDNode *NoAlias = - NoAliasList.empty() ? nullptr : MDNode::get(Ctx, NoAliasList); MDNode *AliasScope = AliasScopes.empty() ? nullptr : MDNode::get(Ctx, {AliasScopes[I]}); - refineUsesAlignmentAndAA(GEP, A, DL, AliasScope, NoAlias); + refineUsesAlignmentAndAA(GEP, A, DL, AliasScope); } } static void refineUsesAlignmentAndAA(Value *Ptr, Align A, const DataLayout &DL, MDNode *AliasScope, - MDNode *NoAlias, unsigned MaxDepth = 5) { + unsigned MaxDepth = 5) { if (!MaxDepth || (A == 1 && !AliasScope)) return; for (User *U : Ptr->users()) { if (auto *I = dyn_cast<Instruction>(U)) { if (AliasScope && I->mayReadOrWriteMemory()) { - MDNode *AS = I->getMetadata(LLVMContext::MD_alias_scope); - AS = (AS ? MDNode::getMostGenericAliasScope(AS, AliasScope) - : AliasScope); + // An instruction that touches several of these variables, lake a + // mpmcpy, lands in the scopes of all + // of them and so stays noalias with the fields it doesn't touch. + // Concatenating also keeps the scopes from other domains. + MDNode *AS = MDNode::concatenate( + I->getMetadata(LLVMContext::MD_alias_scope), AliasScope); I->setMetadata(LLVMContext::MD_alias_scope, AS); - - MDNode *NA = I->getMetadata(LLVMContext::MD_noalias); - - // Scoped aliases can originate from two different domains. - // First domain would be from LDS domain (created by this pass). - // All entries (LDS vars) into LDS struct will have same domain. - - // Second domain could be existing scoped aliases that are the - // results of noalias params and subsequent optimizations that - // may alter thesse sets. - - // We need to be careful how we create new alias sets, and - // have right scopes and domains for loads/stores of these new - // LDS variables. We intersect NoAlias set if alias sets belong - // to the same domain. This is the case if we have memcpy using - // LDS variables. Both src and dst of memcpy would belong to - // LDS struct, they donot alias. - // On the other hand, if one of the domains is LDS and other is - // existing domain prior to LDS, we need to have a union of all - // these aliases set to preserve existing aliasing information. - - SmallPtrSet<const MDNode *, 16> ExistingDomains, LDSDomains; - ScopedNoAliasAAResult::collectScopedDomains(NA, ExistingDomains); - ScopedNoAliasAAResult::collectScopedDomains(NoAlias, LDSDomains); - auto Intersection = set_intersection(ExistingDomains, LDSDomains); - if (Intersection.empty()) { - NA = NA ? MDNode::concatenate(NA, NoAlias) : NoAlias; - } else { - NA = NA ? MDNode::intersect(NA, NoAlias) : NoAlias; - } - I->setMetadata(LLVMContext::MD_noalias, NA); } } @@ -1535,15 +1503,14 @@ class AMDGPULowerModuleLDS { Align GA; if (GEP->accumulateConstantOffset(DL, Off)) GA = commonAlignment(A, Off.getLimitedValue()); - refineUsesAlignmentAndAA(GEP, GA, DL, AliasScope, NoAlias, - MaxDepth - 1); + refineUsesAlignmentAndAA(GEP, GA, DL, AliasScope, MaxDepth - 1); } continue; } if (auto *I = dyn_cast<Instruction>(U)) { if (I->getOpcode() == Instruction::BitCast || I->getOpcode() == Instruction::AddrSpaceCast) - refineUsesAlignmentAndAA(I, A, DL, AliasScope, NoAlias, MaxDepth - 1); + refineUsesAlignmentAndAA(I, A, DL, AliasScope, MaxDepth - 1); } } } diff --git a/llvm/test/CodeGen/AMDGPU/remove-no-kernel-id-attribute.ll b/llvm/test/CodeGen/AMDGPU/remove-no-kernel-id-attribute.ll index d3b7690ff4eb07..25f7ac345de48a 100644 --- a/llvm/test/CodeGen/AMDGPU/remove-no-kernel-id-attribute.ll +++ b/llvm/test/CodeGen/AMDGPU/remove-no-kernel-id-attribute.ll @@ -113,7 +113,7 @@ define amdgpu_kernel void @k0_f0() { define amdgpu_kernel void @k1_f0() { ; CHECK-LABEL: define amdgpu_kernel void @k1_f0( ; CHECK-SAME: ) #[[ATTR3:[0-9]+]] !llvm.amdgcn.lds.kernel.id [[META3:![0-9]+]] { -; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k1_f0.lds) ], !alias.scope [[META4:![0-9]+]], !noalias [[META7:![0-9]+]] +; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k1_f0.lds) ], !alias.scope [[META4:![0-9]+]] ; CHECK-NEXT: call void @f0_transitive() ; CHECK-NEXT: [[FPTR:%.*]] = load volatile ptr, ptr addrspace(1) null, align 8 ; CHECK-NEXT: call void [[FPTR]]() @@ -173,8 +173,8 @@ define internal void @mutual_recursion_1(i16 %arg) { define amdgpu_kernel void @kernel_lds_recursion() { ; CHECK-LABEL: define amdgpu_kernel void @kernel_lds_recursion( -; CHECK-SAME: ) #[[ATTR5:[0-9]+]] !llvm.amdgcn.lds.kernel.id [[META9:![0-9]+]] { -; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.kernel_lds_recursion.lds) ], !alias.scope [[META10:![0-9]+]], !noalias [[META13:![0-9]+]] +; CHECK-SAME: ) #[[ATTR5:[0-9]+]] !llvm.amdgcn.lds.kernel.id [[META7:![0-9]+]] { +; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.kernel_lds_recursion.lds) ], !alias.scope [[META8:![0-9]+]] ; CHECK-NEXT: call void @mutual_recursion_0(i16 0) ; CHECK-NEXT: ret void ; @@ -201,15 +201,11 @@ define amdgpu_kernel void @kernel_lds_recursion() { ; CHECK: [[META3]] = !{i32 1} ; CHECK: [[META4]] = !{[[META5:![0-9]+]]} ; CHECK: [[META5]] = distinct !{[[META5]], [[META6:![0-9]+]]} -; CHECK: [[META6]] = distinct !{[[META6]], i1 false} -; CHECK: [[META7]] = !{[[META8:![0-9]+]]} -; CHECK: [[META8]] = distinct !{[[META8]], [[META6]]} -; CHECK: [[META9]] = !{i32 2} -; CHECK: [[META10]] = !{[[META11:![0-9]+]]} -; CHECK: [[META11]] = distinct !{[[META11]], [[META12:![0-9]+]]} -; CHECK: [[META12]] = distinct !{[[META12]], i1 false} -; CHECK: [[META13]] = !{[[META14:![0-9]+]]} -; CHECK: [[META14]] = distinct !{[[META14]], [[META12]]} +; CHECK: [[META6]] = distinct !{[[META6]], i1 true} +; CHECK: [[META7]] = !{i32 2} +; CHECK: [[META8]] = !{[[META9:![0-9]+]]} +; CHECK: [[META9]] = distinct !{[[META9]], [[META10:![0-9]+]]} +; CHECK: [[META10]] = distinct !{[[META10]], i1 true} ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; TABLE: {{.*}} >From ca4f6e14a5c406acdee218a65537fd1218632a11 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak <[email protected]> Date: Tue, 29 Sep 2026 04:56:29 +0000 Subject: [PATCH 2/2] Test fixups --- .../AMDGPU/AMDGPULowerModuleLDSPass.cpp | 8 ++-- .../AMDGPU/lower-kernel-and-module-lds.ll | 18 +++---- llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll | 14 +++--- .../AMDGPU/lower-lds-struct-aa-memcpy.ll | 34 +++++++------- .../AMDGPU/lower-lds-struct-aa-merge.ll | 47 +++++++++++-------- .../CodeGen/AMDGPU/lower-lds-struct-aa.ll | 33 ++++++------- .../CodeGen/AMDGPU/lower-lds-with-noalias.ll | 16 +++---- ...e-lds-precise-allocate-to-module-struct.ll | 46 ++++++++++++++---- ...lower-module-lds-single-var-unambiguous.ll | 14 +++--- .../AMDGPU/lower-module-lds-via-hybrid.ll | 24 +++++----- .../AMDGPU/lower-module-lds-via-table.ll | 14 +++--- 11 files changed, 148 insertions(+), 120 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp index 5d09f1327c6a6a..a62622eed51d27 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp @@ -1465,10 +1465,10 @@ class AMDGPULowerModuleLDS { for (User *U : Ptr->users()) { if (auto *I = dyn_cast<Instruction>(U)) { if (AliasScope && I->mayReadOrWriteMemory()) { - // An instruction that touches several of these variables, lake a - // mpmcpy, lands in the scopes of all - // of them and so stays noalias with the fields it doesn't touch. - // Concatenating also keeps the scopes from other domains. + // An instruction that touches several of these variables, like a + // memcpy, lands in the scopes of all of them and so stays noalias + // with the fields it doesn't touch. Concatenating also keeps the + // scopes from other domains. MDNode *AS = MDNode::concatenate( I->getMetadata(LLVMContext::MD_alias_scope), AliasScope); I->setMetadata(LLVMContext::MD_alias_scope, AS); diff --git a/llvm/test/CodeGen/AMDGPU/lower-kernel-and-module-lds.ll b/llvm/test/CodeGen/AMDGPU/lower-kernel-and-module-lds.ll index dede77c2b6850c..b31010c4d97266 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-kernel-and-module-lds.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-kernel-and-module-lds.ll @@ -23,10 +23,10 @@ ;. define amdgpu_kernel void @k0() #0 { ; CHECK-LABEL: @k0() #0 -; CHECK-NEXT: store i8 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 22), align 2, !alias.scope !1, !noalias !4 -; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 20), align 4, !alias.scope !8, !noalias !9 -; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 16), align 16, !alias.scope !10, !noalias !11 -; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, align 16, !alias.scope !12, !noalias !13 +; CHECK-NEXT: store i8 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 22), align 2, !alias.scope !1 +; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 20), align 4, !alias.scope !4 +; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 16), align 16, !alias.scope !6 +; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, align 16, !alias.scope !8 ; CHECK-NEXT: ret void store i8 1, ptr addrspace(3) @lds.size.1.align.1, align 1 @@ -41,9 +41,9 @@ define amdgpu_kernel void @k0() #0 { define amdgpu_kernel void @k1() #0 { ; CHECK-LABEL: @k1() #1 -; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 20), align 4, !alias.scope !14, !noalias !17 -; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 16), align 16, !alias.scope !20, !noalias !21 -; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, align 16, !alias.scope !22, !noalias !23 +; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 20), align 4, !alias.scope !10 +; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 16), align 16, !alias.scope !13 +; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, align 16, !alias.scope !15 ; CHECK-NEXT: ret void ; store i8 2, ptr addrspace(3) @lds.size.2.align.2, align 2 @@ -83,8 +83,8 @@ define amdgpu_kernel void @calls_f0() { define void @f0() { ; CHECK-LABEL: define void @f0() -; CHECK-NEXT: store i8 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 8), align 8, !noalias !24 -; CHECK-NEXT: store i8 8, ptr addrspace(3) @llvm.amdgcn.module.lds, align 8, !noalias !29 +; CHECK-NEXT: store i8 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 8), align 8, !alias.scope !17 +; CHECK-NEXT: store i8 8, ptr addrspace(3) @llvm.amdgcn.module.lds, align 8, !alias.scope !22 ; CHECK-NEXT: ret void store i8 1, ptr addrspace(3) @lds.size.1.align.1, align 1 diff --git a/llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll b/llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll index d52982e7ebf526..51bc245db70b19 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll @@ -16,10 +16,10 @@ ;. define amdgpu_kernel void @k0() { ; CHECK-LABEL: @k0( -; CHECK-NEXT: store i8 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 22), align 2, !alias.scope !1, !noalias !4 -; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 20), align 4, !alias.scope !8, !noalias !9 -; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 16), align 16, !alias.scope !10, !noalias !11 -; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, align 16, !alias.scope !12, !noalias !13 +; CHECK-NEXT: store i8 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 22), align 2, !alias.scope !1 +; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 20), align 4, !alias.scope !4 +; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, i32 16), align 16, !alias.scope !6 +; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k0.lds, align 16, !alias.scope !8 ; CHECK-NEXT: ret void store i8 1, ptr addrspace(3) @lds.size.1.align.1, align 1 @@ -34,9 +34,9 @@ define amdgpu_kernel void @k0() { define amdgpu_kernel void @k1() { ; CHECK-LABEL: @k1( -; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 20), align 4, !alias.scope !14, !noalias !17 -; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 16), align 16, !alias.scope !20, !noalias !21 -; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, align 16, !alias.scope !22, !noalias !23 +; CHECK-NEXT: store i8 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 20), align 4, !alias.scope !10 +; CHECK-NEXT: store i8 4, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, i32 16), align 16, !alias.scope !13 +; CHECK-NEXT: store i8 16, ptr addrspace(3) @llvm.amdgcn.kernel.k1.lds, align 16, !alias.scope !15 ; CHECK-NEXT: ret void ; store i8 2, ptr addrspace(3) @lds.size.2.align.2, align 2 diff --git a/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-memcpy.ll b/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-memcpy.ll index 4e3e90aee02d4a..827d6f5a6a4e44 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-memcpy.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-memcpy.ll @@ -1,4 +1,4 @@ -; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5 ; RUN: llc -mtriple=amdgpu9.00 -O3 --amdgpu-lower-module-lds-strategy=module < %s | FileCheck -check-prefix=GCN %s ; RUN: opt -S -mtriple=amdgpu-- -amdgpu-lower-module-lds --amdgpu-lower-module-lds-strategy=module < %s | FileCheck %s ; RUN: opt -S -mtriple=amdgpu-- -passes=amdgpu-lower-module-lds --amdgpu-lower-module-lds-strategy=module < %s | FileCheck %s @@ -14,7 +14,7 @@ $_f2 = comdat any @_f2 = linkonce_odr hidden local_unnamed_addr addrspace(3) global %vec_type poison, comdat, align 1 ;. -; CHECK: @[[LLVM_AMDGCN_KERNEL_TEST_LDS:[a-zA-Z0-9_$"\\.-]+]] = internal addrspace(3) global [[LLVM_AMDGCN_KERNEL_TEST_LDS_T:%.*]] poison, align 4, !absolute_symbol !0 +; CHECK: @llvm.amdgcn.kernel.test.lds = internal addrspace(3) global %llvm.amdgcn.kernel.test.lds.t poison, align 4, !absolute_symbol [[META0:![0-9]+]] ;. define protected amdgpu_kernel void @test(ptr addrspace(1) nocapture %ptr.coerce) local_unnamed_addr #0 { ; GCN-LABEL: test: @@ -34,19 +34,20 @@ define protected amdgpu_kernel void @test(ptr addrspace(1) nocapture %ptr.coerce ; GCN-NEXT: s_endpgm ; CHECK-LABEL: define protected amdgpu_kernel void @test( ; CHECK-SAME: ptr addrspace(1) captures(none) [[PTR_COERCE:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: store i8 3, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, align 4, !alias.scope !1, !noalias !4 -; CHECK-NEXT: tail call void @llvm.memcpy.p3.p3.i64(ptr addrspace(3) noundef align 1 dereferenceable(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), ptr addrspace(3) noundef align 1 dereferenceable(3) @llvm.amdgcn.kernel.test.lds, i64 3, i1 false), !alias.scope !6, !noalias !7 -; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), align 4, !alias.scope !4, !noalias !1 +; CHECK-NEXT: [[ENTRY:.*:]] +; CHECK-NEXT: store i8 3, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, align 4, !alias.scope [[META1:![0-9]+]] +; CHECK-NEXT: tail call void @llvm.memcpy.p3.p3.i64(ptr addrspace(3) noundef align 1 dereferenceable(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), ptr addrspace(3) noundef align 1 dereferenceable(3) @llvm.amdgcn.kernel.test.lds, i64 3, i1 false), !alias.scope [[META4:![0-9]+]] +; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), align 4, !alias.scope [[META6:![0-9]+]] ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8 [[TMP0]], 3 -; CHECK-NEXT: store i8 2, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, align 4, !alias.scope !1, !noalias !4 -; CHECK-NEXT: tail call void @llvm.memcpy.p3.p3.i64(ptr addrspace(3) noundef align 1 dereferenceable(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), ptr addrspace(3) noundef align 1 dereferenceable(3) @llvm.amdgcn.kernel.test.lds, i64 3, i1 false), !alias.scope !6, !noalias !7 -; CHECK-NEXT: [[TMP1:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), align 4, !alias.scope !4, !noalias !1 +; CHECK-NEXT: store i8 2, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, align 4, !alias.scope [[META1]] +; CHECK-NEXT: tail call void @llvm.memcpy.p3.p3.i64(ptr addrspace(3) noundef align 1 dereferenceable(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), ptr addrspace(3) noundef align 1 dereferenceable(3) @llvm.amdgcn.kernel.test.lds, i64 3, i1 false), !alias.scope [[META4]] +; CHECK-NEXT: [[TMP1:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.test.lds, i32 4), align 4, !alias.scope [[META6]] ; CHECK-NEXT: [[CMP_I_I19:%.*]] = icmp eq i8 [[TMP1]], 2 ; CHECK-NEXT: [[TMP2:%.*]] = and i1 [[CMP_I_I19]], [[CMP_I_I]] ; CHECK-NEXT: [[FROMBOOL8:%.*]] = zext i1 [[TMP2]] to i8 ; CHECK-NEXT: store i8 [[FROMBOOL8]], ptr addrspace(1) [[PTR_COERCE]], align 1 ; CHECK-NEXT: ret void +; entry: store i8 3, ptr addrspace(3) @_f1, align 1 tail call void @llvm.memcpy.p3.p3.i64(ptr addrspace(3) noundef align 1 dereferenceable(3) @_f2, ptr addrspace(3) noundef align 1 dereferenceable(3) @_f1, i64 3, i1 false) @@ -68,12 +69,11 @@ declare void @llvm.memcpy.p3.p3.i64(ptr addrspace(3) noalias nocapture writeonly ; CHECK: attributes #[[ATTR0]] = { "amdgpu-lds-size"="7" } ; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } ;. -; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 1} -; CHECK: [[META1:![0-9]+]] = !{!2} -; CHECK: [[META2:![0-9]+]] = distinct !{!2, !3} -; CHECK: [[META3:![0-9]+]] = distinct !{!3, i1 false} -; CHECK: [[META4:![0-9]+]] = !{!5} -; CHECK: [[META5:![0-9]+]] = distinct !{!5, !3} -; CHECK: [[META6:![0-9]+]] = !{!5, !2} -; CHECK: [[META7:![0-9]+]] = !{} +; CHECK: [[META0]] = !{i32 0, i32 1} +; CHECK: [[META1]] = !{[[META2:![0-9]+]]} +; CHECK: [[META2]] = distinct !{[[META2]], [[META3:![0-9]+]]} +; CHECK: [[META3]] = distinct !{[[META3]], i1 true} +; CHECK: [[META4]] = !{[[META2]], [[META5:![0-9]+]]} +; CHECK: [[META5]] = distinct !{[[META5]], [[META3]]} +; CHECK: [[META6]] = !{[[META5]]} ;. diff --git a/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-merge.ll b/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-merge.ll index 01e4b176063a46..8b220a6f776f7b 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-merge.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-merge.ll @@ -1,20 +1,23 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 3 ; RUN: opt -S -mtriple=amdgpu-- -amdgpu-lower-module-lds --amdgpu-lower-module-lds-strategy=module < %s | FileCheck %s ; RUN: opt -S -mtriple=amdgpu-- -passes=amdgpu-lower-module-lds --amdgpu-lower-module-lds-strategy=module < %s | FileCheck %s @a = internal unnamed_addr addrspace(3) global [64 x i32] poison, align 4 @b = internal unnamed_addr addrspace(3) global [64 x i32] poison, align 4 +;. +; CHECK: @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds = internal addrspace(3) global %llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds.t poison, align 16, !absolute_symbol [[META0:![0-9]+]] +;. define amdgpu_kernel void @no_clobber_ds_load_stores_x2_preexisting_aa(ptr addrspace(1) %arg, i32 %i) { ; CHECK-LABEL: define amdgpu_kernel void @no_clobber_ds_load_stores_x2_preexisting_aa( ; CHECK-SAME: ptr addrspace(1) [[ARG:%.*]], i32 [[I:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: bb: -; CHECK-NEXT: store i32 1, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds, align 16, !tbaa [[TBAA1:![0-9]+]], !noalias [[META6:![0-9]+]] +; CHECK-NEXT: store i32 1, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds, align 16, !tbaa [[TBAA1:![0-9]+]], !alias.scope [[META6:![0-9]+]], !noalias [[META11:![0-9]+]] ; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds, i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_A:%.*]] = load i32, ptr addrspace(3) [[GEP_A]], align 4, !tbaa [[TBAA1]], !noalias [[META6]] -; CHECK-NEXT: store i32 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds, i32 256), align 16, !tbaa [[TBAA1]], !noalias [[META11:![0-9]+]] +; CHECK-NEXT: [[VAL_A:%.*]] = load i32, ptr addrspace(3) [[GEP_A]], align 4, !tbaa [[TBAA1]], !alias.scope [[META6]], !noalias [[META11]] +; CHECK-NEXT: store i32 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds, i32 256), align 16, !tbaa [[TBAA1]], !alias.scope [[META13:![0-9]+]], !noalias [[META15:![0-9]+]] ; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2_preexisting_aa.lds, i32 256), i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_B:%.*]] = load i32, ptr addrspace(3) [[GEP_B]], align 4, !tbaa [[TBAA1]], !noalias [[META11]] +; CHECK-NEXT: [[VAL_B:%.*]] = load i32, ptr addrspace(3) [[GEP_B]], align 4, !tbaa [[TBAA1]], !alias.scope [[META13]], !noalias [[META15]] ; CHECK-NEXT: [[VAL:%.*]] = add i32 [[VAL_A]], [[VAL_B]] ; CHECK-NEXT: store i32 [[VAL]], ptr addrspace(1) [[ARG]], align 4 ; CHECK-NEXT: ret void @@ -42,17 +45,23 @@ bb: !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C++ TBAA"} -; CHECK:!0 = !{i32 0, i32 1} -; CHECK:!1 = !{!2, !3, i64 0} -; CHECK:!2 = !{!"no_clobber_ds_load_stores_x2_preexisting_aa", !3, i64 0} -; CHECK:!3 = !{!"int", !4, i64 0} -; CHECK:!4 = !{!"omnipotent char", !5, i64 0} -; CHECK:!5 = !{!"Simple C++ TBAA"} -; CHECK:!6 = !{!7, !9} -; CHECK:!7 = distinct !{!7, !8} -; CHECK:!8 = distinct !{!8, i1 false} -; CHECK:!9 = distinct !{!9, !10} -; CHECK:!10 = distinct !{!10, i1 false} -; CHECK:!11 = !{!12, !13} -; CHECK:!12 = distinct !{!12, !8} -; CHECK:!13 = distinct !{!13, !10} +;. +; CHECK: attributes #[[ATTR0]] = { "amdgpu-lds-size"="512" } +;. +; CHECK: [[META0]] = !{i32 0, i32 1} +; CHECK: [[TBAA1]] = !{[[META2:![0-9]+]], [[META3:![0-9]+]], i64 0} +; CHECK: [[META2]] = !{!"no_clobber_ds_load_stores_x2_preexisting_aa", [[META3]], i64 0} +; CHECK: [[META3]] = !{!"int", [[META4:![0-9]+]], i64 0} +; CHECK: [[META4]] = !{!"omnipotent char", [[META5:![0-9]+]], i64 0} +; CHECK: [[META5]] = !{!"Simple C++ TBAA"} +; CHECK: [[META6]] = !{[[META7:![0-9]+]], [[META9:![0-9]+]]} +; CHECK: [[META7]] = distinct !{[[META7]], [[META8:![0-9]+]]} +; CHECK: [[META8]] = distinct !{[[META8]], i1 false} +; CHECK: [[META9]] = distinct !{[[META9]], [[META10:![0-9]+]]} +; CHECK: [[META10]] = distinct !{[[META10]], i1 true} +; CHECK: [[META11]] = !{[[META12:![0-9]+]]} +; CHECK: [[META12]] = distinct !{[[META12]], [[META8]]} +; CHECK: [[META13]] = !{[[META12]], [[META14:![0-9]+]]} +; CHECK: [[META14]] = distinct !{[[META14]], [[META10]]} +; CHECK: [[META15]] = !{[[META7]]} +;. diff --git a/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa.ll b/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa.ll index 5cb7816c9e3902..b9e7d2eb9ec954 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa.ll @@ -14,12 +14,12 @@ define amdgpu_kernel void @no_clobber_ds_load_stores_x2(ptr addrspace(1) %arg, i ; CHECK-LABEL: define amdgpu_kernel void @no_clobber_ds_load_stores_x2( ; CHECK-SAME: ptr addrspace(1) [[ARG:%.*]], i32 [[I:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: bb: -; CHECK-NEXT: store i32 1, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2.lds, align 16, !alias.scope !1, !noalias !4 +; CHECK-NEXT: store i32 1, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2.lds, align 16, !alias.scope !1 ; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2.lds, i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_A:%.*]] = load i32, ptr addrspace(3) [[GEP_A]], align 4, !alias.scope !1, !noalias !4 -; CHECK-NEXT: store i32 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2.lds, i32 256), align 16, !alias.scope !4, !noalias !1 +; CHECK-NEXT: [[VAL_A:%.*]] = load i32, ptr addrspace(3) [[GEP_A]], align 4, !alias.scope !1 +; CHECK-NEXT: store i32 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2.lds, i32 256), align 16, !alias.scope !4 ; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x2.lds, i32 256), i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_B:%.*]] = load i32, ptr addrspace(3) [[GEP_B]], align 4, !alias.scope !4, !noalias !1 +; CHECK-NEXT: [[VAL_B:%.*]] = load i32, ptr addrspace(3) [[GEP_B]], align 4, !alias.scope !4 ; CHECK-NEXT: [[VAL:%.*]] = add i32 [[VAL_A]], [[VAL_B]] ; CHECK-NEXT: store i32 [[VAL]], ptr addrspace(1) [[ARG]], align 4 ; CHECK-NEXT: ret void @@ -58,15 +58,15 @@ define amdgpu_kernel void @no_clobber_ds_load_stores_x3(ptr addrspace(1) %arg, i ; CHECK-LABEL: define amdgpu_kernel void @no_clobber_ds_load_stores_x3( ; CHECK-SAME: ptr addrspace(1) [[ARG:%.*]], i32 [[I:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: bb: -; CHECK-NEXT: store i32 1, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, align 16, !alias.scope !6, !noalias !9 +; CHECK-NEXT: store i32 1, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, align 16, !alias.scope !6 ; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_A:%.*]] = load i32, ptr addrspace(3) [[GEP_A]], align 4, !alias.scope !6, !noalias !9 -; CHECK-NEXT: store i32 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 256), align 16, !alias.scope !12, !noalias !13 +; CHECK-NEXT: [[VAL_A:%.*]] = load i32, ptr addrspace(3) [[GEP_A]], align 4, !alias.scope !6 +; CHECK-NEXT: store i32 2, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 256), align 16, !alias.scope !9 ; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 256), i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_B:%.*]] = load i32, ptr addrspace(3) [[GEP_B]], align 4, !alias.scope !12, !noalias !13 -; CHECK-NEXT: store i32 3, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 512), align 16, !alias.scope !14, !noalias !15 +; CHECK-NEXT: [[VAL_B:%.*]] = load i32, ptr addrspace(3) [[GEP_B]], align 4, !alias.scope !9 +; CHECK-NEXT: store i32 3, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 512), align 16, !alias.scope !11 ; CHECK-NEXT: [[GEP_C:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.no_clobber_ds_load_stores_x3.lds, i32 512), i32 0, i32 [[I]] -; CHECK-NEXT: [[VAL_C:%.*]] = load i32, ptr addrspace(3) [[GEP_C]], align 4, !alias.scope !14, !noalias !15 +; CHECK-NEXT: [[VAL_C:%.*]] = load i32, ptr addrspace(3) [[GEP_C]], align 4, !alias.scope !11 ; CHECK-NEXT: [[VAL_1:%.*]] = add i32 [[VAL_A]], [[VAL_B]] ; CHECK-NEXT: [[VAL:%.*]] = add i32 [[VAL_1]], [[VAL_C]] ; CHECK-NEXT: store i32 [[VAL]], ptr addrspace(1) [[ARG]], align 4 @@ -113,16 +113,13 @@ bb: ; CHECK: !0 = !{i32 0, i32 1} ; CHECK: !1 = !{!2} ; CHECK: !2 = distinct !{!2, !3} -; CHECK: !3 = distinct !{!3, i1 false} +; CHECK: !3 = distinct !{!3, i1 true} ; CHECK: !4 = !{!5} ; CHECK: !5 = distinct !{!5, !3} ; CHECK: !6 = !{!7} ; CHECK: !7 = distinct !{!7, !8} -; CHECK: !8 = distinct !{!8, i1 false} -; CHECK: !9 = !{!10, !11} +; CHECK: !8 = distinct !{!8, i1 true} +; CHECK: !9 = !{!10} ; CHECK: !10 = distinct !{!10, !8} -; CHECK: !11 = distinct !{!11, !8} -; CHECK: !12 = !{!10} -; CHECK: !13 = !{!7, !11} -; CHECK: !14 = !{!11} -; CHECK: !15 = !{!7, !10} +; CHECK: !11 = !{!12} +; CHECK: !12 = distinct !{!12, !8} diff --git a/llvm/test/CodeGen/AMDGPU/lower-lds-with-noalias.ll b/llvm/test/CodeGen/AMDGPU/lower-lds-with-noalias.ll index cde7b63fd2e15e..c4dc67ed1f91aa 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-lds-with-noalias.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-lds-with-noalias.ll @@ -34,8 +34,8 @@ define amdgpu_kernel void @ds_load_stores_aainfo(ptr addrspace(1) %arg, i32 %i) ; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) @llvm.amdgcn.kernel.ds_load_stores_aainfo.lds, i32 0, i32 [[I]] ; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds [64 x i32], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.ds_load_stores_aainfo.lds, i32 256), i32 0, i32 [[I]] ; CHECK-NEXT: [[VAL_A:%.*]] = load i64, ptr addrspace(3) [[GEP_A]], align 4, !tbaa [[TBAA1:![0-9]+]], !alias.scope [[META4:![0-9]+]], !noalias [[META7:![0-9]+]] -; CHECK-NEXT: [[VAL_B:%.*]] = load i64, ptr addrspace(3) [[GEP_B]], align 4, !tbaa [[TBAA1]], !alias.scope [[META12:![0-9]+]], !noalias [[META13:![0-9]+]] -; CHECK-NEXT: store i64 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.ds_load_stores_aainfo.lds, i32 512), align 16, !tbaa [[TBAA1]], !alias.scope [[META14:![0-9]+]], !noalias [[META15:![0-9]+]] +; CHECK-NEXT: [[VAL_B:%.*]] = load i64, ptr addrspace(3) [[GEP_B]], align 4, !tbaa [[TBAA1]], !alias.scope [[META10:![0-9]+]], !noalias [[META7]] +; CHECK-NEXT: store i64 1, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.ds_load_stores_aainfo.lds, i32 512), align 16, !tbaa [[TBAA1]], !alias.scope [[META12:![0-9]+]], !noalias [[META7]] ; CHECK-NEXT: [[VAL:%.*]] = add i64 [[VAL_A]], [[VAL_B]] ; CHECK-NEXT: store i64 [[VAL]], ptr addrspace(1) [[ARG]], align 4 ; CHECK-NEXT: tail call void @llvm.amdgcn.sched.group.barrier(i32 256, i32 1, i32 0) @@ -74,14 +74,12 @@ bb: ; CHECK: [[META3]] = distinct !{[[META3]]} ; CHECK: [[META4]] = !{[[META5:![0-9]+]]} ; CHECK: [[META5]] = distinct !{[[META5]], [[META6:![0-9]+]]} -; CHECK: [[META6]] = distinct !{[[META6]], i1 false} -; CHECK: [[META7]] = !{[[META8:![0-9]+]], [[META10:![0-9]+]], [[META11:![0-9]+]]} +; CHECK: [[META6]] = distinct !{[[META6]], i1 true} +; CHECK: [[META7]] = !{[[META8:![0-9]+]]} ; CHECK: [[META8]] = distinct !{[[META8]], [[META9:![0-9]+]]} ; CHECK: [[META9]] = distinct !{[[META9]], i1 false} -; CHECK: [[META10]] = distinct !{[[META10]], [[META6]]} +; CHECK: [[META10]] = !{[[META11:![0-9]+]]} ; CHECK: [[META11]] = distinct !{[[META11]], [[META6]]} -; CHECK: [[META12]] = !{[[META10]]} -; CHECK: [[META13]] = !{[[META8]], [[META5]], [[META11]]} -; CHECK: [[META14]] = !{[[META11]]} -; CHECK: [[META15]] = !{[[META8]], [[META5]], [[META10]]} +; CHECK: [[META12]] = !{[[META13:![0-9]+]]} +; CHECK: [[META13]] = distinct !{[[META13]], [[META6]]} ;. diff --git a/llvm/test/CodeGen/AMDGPU/lower-module-lds-precise-allocate-to-module-struct.ll b/llvm/test/CodeGen/AMDGPU/lower-module-lds-precise-allocate-to-module-struct.ll index 634de70dfe6d6b..ad5984cb34f0cd 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-module-lds-precise-allocate-to-module-struct.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-module-lds-precise-allocate-to-module-struct.ll @@ -25,15 +25,16 @@ ; CHECK: @llvm.amdgcn.kernel.kern_one.lds = internal addrspace(3) global %llvm.amdgcn.kernel.kern_one.lds.t poison, align 4, !absolute_symbol [[META1:![0-9]+]] ; CHECK: @llvm.amdgcn.kernel.kern_two.lds = internal addrspace(3) global %llvm.amdgcn.kernel.kern_two.lds.t poison, align 4, !absolute_symbol [[META1]] ; CHECK: @llvm.amdgcn.kernel.kern_block_direct_allocation.lds = internal addrspace(3) global %llvm.amdgcn.kernel.kern_block_direct_allocation.lds.t poison, align 4, !absolute_symbol [[META1]] +; CHECK: @llvm.amdgcn.lds.offset.table = internal addrspace(4) constant [3 x [2 x ptr addrspace(3)]] {{\[\[}}2 x ptr addrspace(3)] [ptr addrspace(3) @llvm.amdgcn.kernel.kern_block_direct_allocation.lds, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.kern_block_direct_allocation.lds, i32 4)], [2 x ptr addrspace(3)] [ptr addrspace(3) @llvm.amdgcn.kernel.kern_one.lds, ptr addrspace(3) poison], [2 x ptr addrspace(3)] [ptr addrspace(3) poison, ptr addrspace(3) @llvm.amdgcn.kernel.kern_two.lds]] ;. define void @func_one() { ; CHECK-LABEL: define {{[^@]+}}@func_one() { ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.amdgcn.lds.kernel.id() -; CHECK-NEXT: [[VAL0:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !noalias [[META2:![0-9]+]] +; CHECK-NEXT: [[VAL0:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META2:![0-9]+]] ; CHECK-NEXT: [[ONE:%.*]] = getelementptr inbounds [3 x [2 x ptr addrspace(3)]], ptr addrspace(4) @llvm.amdgcn.lds.offset.table, i32 0, i32 [[TMP1]], i32 0 ; CHECK-NEXT: [[TMP2:%.*]] = load ptr addrspace(3), ptr addrspace(4) [[ONE]], align 4 ; CHECK-NEXT: store i32 [[VAL0]], ptr addrspace(3) [[TMP2]], align 4 -; CHECK-NEXT: store i16 10, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !noalias [[META11:![0-9]+]] +; CHECK-NEXT: store i16 10, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META11:![0-9]+]] ; CHECK-NEXT: ret void ; %val0 = load i32, ptr addrspace(3) @both @@ -47,7 +48,7 @@ define amdgpu_kernel void @kern_one() { ; CHECK-SAME: () #[[ATTR0:[0-9]+]] !llvm.amdgcn.lds.kernel.id [[META16:![0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.kern_one.lds) ] -; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ], !noalias [[META17:![0-9]+]] +; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ], !alias.scope [[META17:![0-9]+]] ; CHECK-NEXT: call void @func_one() ; CHECK-NEXT: ret void ; @@ -59,11 +60,11 @@ entry: define void @func_two() { ; CHECK-LABEL: define {{[^@]+}}@func_two() { ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.amdgcn.lds.kernel.id() -; CHECK-NEXT: [[VAL0:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !noalias [[META2]] +; CHECK-NEXT: [[VAL0:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META2]] ; CHECK-NEXT: [[TWO:%.*]] = getelementptr inbounds [3 x [2 x ptr addrspace(3)]], ptr addrspace(4) @llvm.amdgcn.lds.offset.table, i32 0, i32 [[TMP1]], i32 1 ; CHECK-NEXT: [[TMP2:%.*]] = load ptr addrspace(3), ptr addrspace(4) [[TWO]], align 4 ; CHECK-NEXT: store i32 [[VAL0]], ptr addrspace(3) [[TMP2]], align 4 -; CHECK-NEXT: store i16 20, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !noalias [[META11]] +; CHECK-NEXT: store i16 20, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META11]] ; CHECK-NEXT: ret void ; %val0 = load i32, ptr addrspace(3) @both @@ -77,7 +78,7 @@ define amdgpu_kernel void @kern_two() { ; CHECK-SAME: () #[[ATTR0]] !llvm.amdgcn.lds.kernel.id [[META18:![0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.kern_two.lds) ] -; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ], !alias.scope [[META19:![0-9]+]], !noalias [[META20:![0-9]+]] +; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ], !alias.scope [[META19:![0-9]+]] ; CHECK-NEXT: call void @func_two() ; CHECK-NEXT: ret void ; @@ -101,8 +102,8 @@ define void @func_block_direct_allocation() { ; CHECK-NEXT: [[TMP3:%.*]] = load ptr addrspace(3), ptr addrspace(4) [[TWO]], align 4 ; CHECK-NEXT: [[VAL2:%.*]] = load i32, ptr addrspace(3) [[TMP3]], align 4 ; CHECK-NEXT: [[SUM:%.*]] = add i32 [[VAL1]], [[VAL2]] -; CHECK-NEXT: store i32 [[SUM]], ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !noalias [[META2]] -; CHECK-NEXT: store i16 30, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !noalias [[META11]] +; CHECK-NEXT: store i32 [[SUM]], ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META2]] +; CHECK-NEXT: store i16 30, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META11]] ; CHECK-NEXT: ret void ; %val1 = load i32, ptr addrspace(3) @one @@ -115,8 +116,8 @@ define void @func_block_direct_allocation() { define amdgpu_kernel void @kern_block_direct_allocation() { ; CHECK-LABEL: define {{[^@]+}}@kern_block_direct_allocation -; CHECK-SAME: () #[[ATTR1:[0-9]+]] !llvm.amdgcn.lds.kernel.id [[META21:![0-9]+]] { -; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.kern_block_direct_allocation.lds) ], !alias.scope [[META22:![0-9]+]], !noalias [[META25:![0-9]+]] +; CHECK-SAME: () #[[ATTR1:[0-9]+]] !llvm.amdgcn.lds.kernel.id [[META20:![0-9]+]] { +; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.kern_block_direct_allocation.lds) ], !alias.scope [[META21:![0-9]+]] ; CHECK-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ] ; CHECK-NEXT: call void @func_block_direct_allocation() ; CHECK-NEXT: call void @func_one() @@ -134,3 +135,28 @@ define amdgpu_kernel void @kern_block_direct_allocation() { ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(none) } ; CHECK: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } ;. +; CHECK: [[META0]] = !{i32 0, i32 1} +; CHECK: [[META1]] = !{i32 8, i32 9} +; CHECK: [[META2]] = !{[[META3:![0-9]+]], [[META5:![0-9]+]], [[META7:![0-9]+]], [[META9:![0-9]+]]} +; CHECK: [[META3]] = distinct !{[[META3]], [[META4:![0-9]+]]} +; CHECK: [[META4]] = distinct !{[[META4]], i1 true} +; CHECK: [[META5]] = distinct !{[[META5]], [[META6:![0-9]+]]} +; CHECK: [[META6]] = distinct !{[[META6]], i1 true} +; CHECK: [[META7]] = distinct !{[[META7]], [[META8:![0-9]+]]} +; CHECK: [[META8]] = distinct !{[[META8]], i1 true} +; CHECK: [[META9]] = distinct !{[[META9]], [[META10:![0-9]+]]} +; CHECK: [[META10]] = distinct !{[[META10]], i1 true} +; CHECK: [[META11]] = !{[[META12:![0-9]+]], [[META13:![0-9]+]], [[META14:![0-9]+]], [[META15:![0-9]+]]} +; CHECK: [[META12]] = distinct !{[[META12]], [[META4]]} +; CHECK: [[META13]] = distinct !{[[META13]], [[META6]]} +; CHECK: [[META14]] = distinct !{[[META14]], [[META8]]} +; CHECK: [[META15]] = distinct !{[[META15]], [[META10]]} +; CHECK: [[META16]] = !{i32 1} +; CHECK: [[META17]] = !{[[META7]], [[META9]]} +; CHECK: [[META18]] = !{i32 2} +; CHECK: [[META19]] = !{[[META9]]} +; CHECK: [[META20]] = !{i32 0} +; CHECK: [[META21]] = !{[[META22:![0-9]+]]} +; CHECK: [[META22]] = distinct !{[[META22]], [[META23:![0-9]+]]} +; CHECK: [[META23]] = distinct !{[[META23]], i1 true} +;. diff --git a/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-unambiguous.ll b/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-unambiguous.ll index 164fd6b95fc271..05206c570dc21c 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-unambiguous.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-module-lds-single-var-unambiguous.ll @@ -28,9 +28,9 @@ define amdgpu_kernel void @k0() { @f0.lds = addrspace(3) global i16 poison define void @f0() { ; MODULE-LABEL: @f0( -; MODULE-NEXT: [[LD:%.*]] = load i16, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META1:![0-9]+]], !noalias [[META4:![0-9]+]] +; MODULE-NEXT: [[LD:%.*]] = load i16, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META1:![0-9]+]] ; MODULE-NEXT: [[MUL:%.*]] = mul i16 [[LD]], 3 -; MODULE-NEXT: store i16 [[MUL]], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META1]], !noalias [[META4]] +; MODULE-NEXT: store i16 [[MUL]], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.module.lds, i32 4), align 4, !alias.scope [[META1]] ; MODULE-NEXT: ret void ; ; TABLE-LABEL: @f0( @@ -58,7 +58,7 @@ define void @f0() { define amdgpu_kernel void @k_f0() { ; MODULE-LABEL: @k_f0( -; MODULE-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ], !alias.scope [[META10:![0-9]+]], !noalias [[META1]] +; MODULE-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ], !alias.scope [[META8:![0-9]+]] ; MODULE-NEXT: call void @f0() ; MODULE-NEXT: ret void ; @@ -81,9 +81,9 @@ define amdgpu_kernel void @k_f0() { @both.lds = addrspace(3) global i32 poison define void @f_both() { ; MODULE-LABEL: @f_both( -; MODULE-NEXT: [[LD:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META10]], !noalias [[META11:![0-9]+]] +; MODULE-NEXT: [[LD:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META10:![0-9]+]] ; MODULE-NEXT: [[MUL:%.*]] = mul i32 [[LD]], 4 -; MODULE-NEXT: store i32 [[MUL]], ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META10]], !noalias [[META11]] +; MODULE-NEXT: store i32 [[MUL]], ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META10]] ; MODULE-NEXT: ret void ; ; TABLE-LABEL: @f_both( @@ -112,9 +112,9 @@ define void @f_both() { define amdgpu_kernel void @k0_both() { ; MODULE-LABEL: @k0_both( ; MODULE-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ] -; MODULE-NEXT: [[LD:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META10]], !noalias [[META1]] +; MODULE-NEXT: [[LD:%.*]] = load i32, ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META8]] ; MODULE-NEXT: [[MUL:%.*]] = mul i32 [[LD]], 5 -; MODULE-NEXT: store i32 [[MUL]], ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META10]], !noalias [[META1]] +; MODULE-NEXT: store i32 [[MUL]], ptr addrspace(3) @llvm.amdgcn.module.lds, align 4, !alias.scope [[META8]] ; MODULE-NEXT: call void @f_both() ; MODULE-NEXT: ret void ; diff --git a/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll b/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll index b0cce1a84fef21..2924b20f902144 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll @@ -193,7 +193,7 @@ define amdgpu_kernel void @k01() { define amdgpu_kernel void @k23() { ; OPT-LABEL: @k23( -; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k23.lds) ], !alias.scope [[META5:![0-9]+]], !noalias [[META8:![0-9]+]] +; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k23.lds) ], !alias.scope [[META5:![0-9]+]] ; OPT-NEXT: call void @f2() ; OPT-NEXT: call void @f3() ; OPT-NEXT: ret void @@ -243,12 +243,12 @@ define amdgpu_kernel void @k23() { ; Access and allocate three variables define amdgpu_kernel void @k123() { ; OPT-LABEL: @k123( -; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds) ], !alias.scope [[META11:![0-9]+]], !noalias [[META14:![0-9]+]] +; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds) ], !alias.scope [[META9:![0-9]+]] ; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.module.lds) ] ; OPT-NEXT: call void @f1() -; OPT-NEXT: [[LD:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 8), align 8, !alias.scope [[META14]], !noalias [[META11]] +; OPT-NEXT: [[LD:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 8), align 8, !alias.scope [[META12:![0-9]+]] ; OPT-NEXT: [[MUL:%.*]] = mul i8 [[LD]], 8 -; OPT-NEXT: store i8 [[MUL]], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 8), align 8, !alias.scope [[META14]], !noalias [[META11]] +; OPT-NEXT: store i8 [[MUL]], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 8), align 8, !alias.scope [[META12]] ; OPT-NEXT: call void @f2() ; OPT-NEXT: ret void ; @@ -313,15 +313,13 @@ define amdgpu_kernel void @k123() { ; OPT: !4 = !{i32 1} ; OPT: !5 = !{!6} ; OPT: !6 = distinct !{!6, !7} -; OPT: !7 = distinct !{!7, i1 false} -; OPT: !8 = !{!9} -; OPT: !9 = distinct !{!9, !7} -; OPT: !10 = !{i32 0} -; OPT: !11 = !{!12} -; OPT: !12 = distinct !{!12, !13} -; OPT: !13 = distinct !{!13, i1 false} -; OPT: !14 = !{!15} -; OPT: !15 = distinct !{!15, !13} +; OPT: !7 = distinct !{!7, i1 true} +; OPT: !8 = !{i32 0} +; OPT: !9 = !{!10} +; OPT: !10 = distinct !{!10, !11} +; OPT: !11 = distinct !{!11, i1 true} +; OPT: !12 = !{!13} +; OPT: !13 = distinct !{!13, !11} attributes #0 = { "amdgpu-lds-size"="8" } attributes #1 = { "amdgpu-lds-size"="16" } diff --git a/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-table.ll b/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-table.ll index 6c6b8fdea2b5ee..ce106e4185cc75 100644 --- a/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-table.ll +++ b/llvm/test/CodeGen/AMDGPU/lower-module-lds-via-table.ll @@ -210,7 +210,7 @@ define amdgpu_kernel void @kernel_no_table() { define amdgpu_kernel void @k01() { ; OPT-LABEL: define amdgpu_kernel void @k01( ; OPT-SAME: ) #[[ATTR0]] {{.*}}.amdgcn.lds.kernel.id [[META2:![0-9]+]] { -; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k01.lds) ], !alias.scope [[META3:![0-9]+]], !noalias [[META6:![0-9]+]] +; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k01.lds) ], !alias.scope [[META3:![0-9]+]] ; OPT-NEXT: call void @f0() ; OPT-NEXT: call void @f1() ; OPT-NEXT: ret void @@ -260,8 +260,8 @@ define amdgpu_kernel void @k01() { define amdgpu_kernel void @k23() { ; OPT-LABEL: define amdgpu_kernel void @k23( -; OPT-SAME: ) #[[ATTR1:[0-9]+]] {{.*}}.amdgcn.lds.kernel.id [[META8:![0-9]+]] { -; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k23.lds) ], !alias.scope [[META9:![0-9]+]], !noalias [[META12:![0-9]+]] +; OPT-SAME: ) #[[ATTR1:[0-9]+]] {{.*}}.amdgcn.lds.kernel.id [[META6:![0-9]+]] { +; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k23.lds) ], !alias.scope [[META7:![0-9]+]] ; OPT-NEXT: call void @f2() ; OPT-NEXT: call void @f3() ; OPT-NEXT: ret void @@ -311,12 +311,12 @@ define amdgpu_kernel void @k23() { ; Access and allocate three variables define amdgpu_kernel void @k123() { ; OPT-LABEL: define amdgpu_kernel void @k123( -; OPT-SAME: ) #[[ATTR1]] {{.*}}.amdgcn.lds.kernel.id [[META14:![0-9]+]] { -; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds) ], !alias.scope [[META15:![0-9]+]], !noalias [[META18:![0-9]+]] +; OPT-SAME: ) #[[ATTR1]] {{.*}}.amdgcn.lds.kernel.id [[META10:![0-9]+]] { +; OPT-NEXT: call void @llvm.donothing() [ "ExplicitUse"(ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds) ], !alias.scope [[META11:![0-9]+]] ; OPT-NEXT: call void @f1() -; OPT-NEXT: [[LD:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 2), align 2, !alias.scope [[META21:![0-9]+]], !noalias [[META22:![0-9]+]] +; OPT-NEXT: [[LD:%.*]] = load i8, ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 2), align 2, !alias.scope [[META14:![0-9]+]] ; OPT-NEXT: [[MUL:%.*]] = mul i8 [[LD]], 8 -; OPT-NEXT: store i8 [[MUL]], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 2), align 2, !alias.scope [[META21]], !noalias [[META22]] +; OPT-NEXT: store i8 [[MUL]], ptr addrspace(3) getelementptr inbounds (i8, ptr addrspace(3) @llvm.amdgcn.kernel.k123.lds, i32 2), align 2, !alias.scope [[META14]] ; OPT-NEXT: call void @f2() ; OPT-NEXT: ret void ; _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
