[PATCH] D86630: [ArgumentPromotion]: Copy function annotation after promoting arguments
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 09:07:03 PDT 2020
fhahn 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);
----------------
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.
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