[PATCH] D53243: [DeadArgElim][ArgumentPromotion] Preserve MD_Associated metadata when re-creating function

Aaron Hill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 13 00:43:56 PDT 2018


Aaron1011 created this revision.
Aaron1011 added reviewers: lattner, chandlerc.
Herald added a subscriber: llvm-commits.

Currently, DeadArgElim and ArgumentPromotion fail to preserve MD_Associated metadata pointing at the old function when a replacement function is created.
Since the replacement function is intended to be 'the same' as the old one (except for the changed arguments), any globals with MD_Associated metadata pointing to the old function should have it pointed at the new function.

I've added two helper functions to ModuleUtils which perform the metadata updating. It should be very easy to insert the proper calls to these functions into any other passes found to require the same logic.


Repository:
  rL LLVM

https://reviews.llvm.org/D53243

Files:
  include/llvm/Transforms/IPO/ArgumentPromotion.h
  include/llvm/Transforms/IPO/DeadArgumentElimination.h
  include/llvm/Transforms/Utils/ModuleUtils.h
  lib/Transforms/IPO/ArgumentPromotion.cpp
  lib/Transforms/IPO/DeadArgumentElimination.cpp
  lib/Transforms/Utils/ModuleUtils.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53243.169548.patch
Type: text/x-patch
Size: 8728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181013/09910b9b/attachment.bin>


More information about the llvm-commits mailing list