[PATCH] D86630: [ArgumentPromotion]: Copy function annotation after promoting arguments

Ettore Tiotto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 09:29:57 PDT 2020


etiotto marked an inline comment as done.
etiotto added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:221
   // Patch the pointer to LLVM function in debug info descriptor.
   NF->setSubprogram(F->getSubprogram());
   F->setSubprogram(nullptr);
----------------
fhahn wrote:
> That should not be necessary anymore now that we copy all the metadata?
> 
>  One thing we need to keep in mind is that the original function may not be deleted and there are some kinds of metadata that need to be unique per function (.e.g `!dbg`), hence the `F->setSubprogram(nullptr)` below. With the change, it might be good to add a comment why we need to remove the `!dbg` metadata from the original function. But I am not aware of any other metadata nodes that have a similar constraint.
Good point. I'll drop this line and add the comment you suggested.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86630/new/

https://reviews.llvm.org/D86630



More information about the llvm-commits mailing list