[PATCH] D105590: [amdgpu] Remove the GlobalDCE pass prior to the internalization pass.
    Michael Liao via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jul  7 22:39:12 PDT 2021
    
    
  
hliao updated this revision to Diff 357135.
hliao added a comment.
Rebase
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105590/new/
https://reviews.llvm.org/D105590
Files:
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Index: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -431,6 +431,7 @@
   if (const Function *F = dyn_cast<Function>(&GV))
     return F->isDeclaration() || AMDGPU::isEntryFunctionCC(F->getCallingConv());
 
+  GV.removeDeadConstantUsers();
   return !GV.use_empty();
 }
 
@@ -595,9 +596,6 @@
         PM.addPass(AMDGPUPrintfRuntimeBindingPass());
 
         if (InternalizeSymbols) {
-          // Global variables may have dead uses which need to be removed.
-          // Otherwise these useless global variables will not get internalized.
-          PM.addPass(GlobalDCEPass());
           PM.addPass(InternalizePass(mustPreserveGV));
         }
         PM.addPass(AMDGPUPropagateAttributesLatePass(*this));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105590.357135.patch
Type: text/x-patch
Size: 885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210708/bf6db9aa/attachment.bin>
    
    
More information about the llvm-commits
mailing list