[PATCH] D58539: [NVPTX] Fixed param symbol name lowering in unnamed funcs. Fixes PR40817

Jascha Wetzel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 22 02:07:13 PST 2019


jascha created this revision.
jascha added reviewers: jholewinski, jlebar, tra.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

NVPTXTargetLowering::getParamSymbol used MachineFunction::getName
instead of the mangled symbol name. For unnamed functions (e.g. like
IPO/MergeFunction may create them) this produced an operand name that is
inconsistent with other parts of this module that emit parameter names.


Repository:
  rL LLVM

https://reviews.llvm.org/D58539

Files:
  lib/Target/NVPTX/NVPTXISelLowering.cpp


Index: lib/Target/NVPTX/NVPTXISelLowering.cpp
===================================================================
--- lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -2325,7 +2325,10 @@
   std::string ParamSym;
   raw_string_ostream ParamStr(ParamSym);
 
-  ParamStr << DAG.getMachineFunction().getName() << "_param_" << idx;
+  auto& TM = getTargetMachine();
+  auto F = &DAG.getMachineFunction().getFunction();
+  TM.getSymbol(F)->print(ParamStr, TM.getMCAsmInfo());
+  ParamStr << "_param_" << idx;
   ParamStr.flush();
 
   std::string *SavedStr =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58539.187910.patch
Type: text/x-patch
Size: 589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190222/263a7e8a/attachment-0001.bin>


More information about the llvm-commits mailing list