diff options
| author | Rahul Joshi <rjoshi@nvidia.com> | 2024-10-11 05:26:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-11 05:26:03 -0700 |
| commit | fa789dffb1e12c2aece0187aeacc48dfb1768340 (patch) | |
| tree | cebfdc0d8b0111115cbefeb8d2927fe8c2cfbdfb /llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp | |
| parent | 900ea21ffb38ba5b783b20f394c43c6c89d58086 (diff) | |
[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)
Rename the function to reflect its correct behavior and to be consistent
with `Module::getOrInsertFunction`. This is also in preparation of
adding a new `Intrinsic::getDeclaration` that will have behavior similar
to `Module::getFunction` (i.e, just lookup, no creation).
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp index 51a5b7702c00..ff5eb8149010 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp @@ -285,8 +285,8 @@ class AMDGPULowerModuleLDS { BasicBlock *Entry = &Func->getEntryBlock(); IRBuilder<> Builder(Entry, Entry->getFirstNonPHIIt()); - Function *Decl = - Intrinsic::getDeclaration(Func->getParent(), Intrinsic::donothing, {}); + Function *Decl = Intrinsic::getOrInsertDeclaration( + Func->getParent(), Intrinsic::donothing, {}); Value *UseInstance[1] = { Builder.CreateConstInBoundsGEP1_32(SGV->getValueType(), SGV, 0)}; @@ -529,8 +529,8 @@ public: // block to spare deduplicating it later. auto [It, Inserted] = tableKernelIndexCache.try_emplace(F); if (Inserted) { - Function *Decl = - Intrinsic::getDeclaration(&M, Intrinsic::amdgcn_lds_kernel_id, {}); + Function *Decl = Intrinsic::getOrInsertDeclaration( + &M, Intrinsic::amdgcn_lds_kernel_id, {}); auto InsertAt = F->getEntryBlock().getFirstNonPHIOrDbgOrAlloca(); IRBuilder<> Builder(&*InsertAt); |
