[PATCH] D88433: [IRMover] Fix up "CG Profile" MDNode after RAUW

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 12:51:10 PDT 2020


tejohnson added a comment.

In D88433#2347753 <https://reviews.llvm.org/D88433#2347753>, @ychen wrote:

> In D88433#2347480 <https://reviews.llvm.org/D88433#2347480>, @tejohnson wrote:
>
>> It seems a bit odd to have/need a custom fixup for one type of MDNode here. Can visitModuleFlagCGProfileEntry be fixed to handle the bitcast?
>
> It is indeed a bit odd but that's close to where the artifact is produced. Debug metadata nodes involving globals/functions could potentially have this issue too (either their verification doesn't enforce similar logic as CGProfile node does or they just don't care I'm not sure).
>
> Fixing visitModuleFlagCGProfileEntry works too although it addresses the consumer rather than the producer, which logically also seems odd. If this is the preferred method to address the issue, I have no strong opinion against it.

Barring other issues from the way the metadata nodes were constructed, I guess I would prefer the change to the Verifier. It seems a bit odd to be fixing up this one metadata type here. It would be interesting to know how or why this is not an issue for the debug metadata nodes, but the fix doesn't need to wait on that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88433



More information about the llvm-commits mailing list