Paul Heidekrüger via llvm-dev
2021-Dec-16 16:49 UTC
[llvm-dev] '!annotation' type metadata and compiler optimisations
Hi all, I was looking for a mechanism for tracking instructions through compiler optimisations, i.e. annotate before optimisations and check again after optimisations. Am I correct in understanding that '!annotation' type metadata is, by design, guaranteed to be left untouched by compiler optimisations if its corresponding instruction doesn't get optimised away? Many thanks, Paul
Florian Hahn via llvm-dev
2021-Dec-17 22:41 UTC
[llvm-dev] '!annotation' type metadata and compiler optimisations
> On 17 Dec 2021, at 21:31, Paul Heidekrüger via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi all, > > I was looking for a mechanism for tracking instructions through compiler > optimisations, i.e. annotate before optimisations and check again after > optimisations. > > Am I correct in understanding that '!annotation' type metadata is, by design, > guaranteed to be left untouched by compiler optimisations if its corresponding > instruction doesn't get optimised away?You should be able to use !annotation metadata for this use case. But preserving !annotation is done one a best effort basis, like for all other metadata kinds. So depending on your use case you might have to track down and update passes that remove it unnecessarily. Cheers Florian> Many thanks, > Paul > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev