[PATCH] D83776: [AMDGPU] Don't use emitFunctionEntryLabel() from the base AsmPrinter

Ronak Chauhan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 07:43:11 PDT 2020


rochauha created this revision.
rochauha added reviewers: scott.linder, t-tye.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.

AMDGPUAsmPrinter::emitFunctionEntryLabel() relies on the base implementation to actually emit the function entry label.
AMDGPU kernel symbols have global binding. The base implementation tends to add another local symbol in such a case, which is unwanted.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83776

Files:
  llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp


Index: llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -258,7 +258,8 @@
 void AMDGPUAsmPrinter::emitFunctionEntryLabel() {
   if (IsaInfo::hasCodeObjectV3(getGlobalSTI()) &&
       TM.getTargetTriple().getOS() == Triple::AMDHSA) {
-    AsmPrinter::emitFunctionEntryLabel();
+    MCSymbol *Sym = getSymbol(&MF->getFunction());
+    OutStreamer->emitLabel(Sym);
     return;
   }
 
@@ -277,7 +278,8 @@
     HexLines.push_back("");
   }
 
-  AsmPrinter::emitFunctionEntryLabel();
+  MCSymbol *Sym = getSymbol(&MF->getFunction());
+  OutStreamer->emitLabel(Sym);
 }
 
 void AMDGPUAsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83776.277830.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200714/ad05154a/attachment.bin>


More information about the llvm-commits mailing list