[llvm] [memprof] Reduce schema for Version2 (PR #89876)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 09:26:24 PDT 2024


kazutakahirata wrote:

> It also occurs to me that we should do something on the profile use side in the compiler to detect which fields were in the profile, and give an error if we try to use other fields. I have a bit of concern that if someone tries to experiment with compiler changes on the use side that make use of additional fields and forgets about this change that they will get 0s for other fields and it silently won't behave as expected. E.g. maybe in llvm/include/llvm/ProfileData/MemProf.h possibly save the Schema used in deserialize, and assert in the get* functions if a field is used that wasn't in that set?

I understand your concern.  Yes, `get*` functions seem to be the way to go.  Let me think about the details.

https://github.com/llvm/llvm-project/pull/89876


More information about the llvm-commits mailing list