[llvm] [AMDGPU][LTO] Introduce AMDGPUCloneModuleLDS (PR #89683)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 23:46:13 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 28d85e2d9e9f3b62554ad8446095aac275022c3c 032f3d9f0a3576b428e648f794d32db66f8778e8 -- llvm/lib/Target/AMDGPU/AMDGPUCloneModuleLDS.cpp llvm/lib/Target/AMDGPU/AMDGPU.h llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCloneModuleLDS.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCloneModuleLDS.cpp
index 9205e62a9a..3b9003c6b5 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCloneModuleLDS.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCloneModuleLDS.cpp
@@ -77,8 +77,7 @@ PreservedAnalyses AMDGPUCloneModuleLDSPass::run(Module &M,
DenseMap<GlobalVariable *, Function *> GVToFnMap;
for (auto &GV : M.globals()) {
if (GVToFnMap.contains(&GV) ||
- GV.getAddressSpace() != AMDGPUAS::LOCAL_ADDRESS ||
- !GV.hasInitializer())
+ GV.getAddressSpace() != AMDGPUAS::LOCAL_ADDRESS || !GV.hasInitializer())
continue;
auto *OldF = getFunctionDefiningGV(GV);
@@ -113,7 +112,7 @@ PreservedAnalyses AMDGPUCloneModuleLDSPass::run(Module &M,
NewGV->setComdat(GV.getComdat());
LLVM_DEBUG(dbgs() << "Inserting LDS clone with name " << NewGV->getName()
<< '\n');
-
+
// Clone function
ValueToValueMapTy VMap;
VMap[&GV] = NewGV;
@@ -122,7 +121,6 @@ PreservedAnalyses AMDGPUCloneModuleLDSPass::run(Module &M,
LLVM_DEBUG(dbgs() << "Inserting function clone with name "
<< NewF->getName() << '\n');
-
// Create a new CallInst to call the cloned function
for (auto *Inst : InstsCallingOldF) {
Instruction *I = Inst->clone();
``````````
</details>
https://github.com/llvm/llvm-project/pull/89683
More information about the llvm-commits
mailing list