[NFC][MLGO] Make logging more robust
authorMircea Trofin <mtrofin@google.com>
Thu, 5 Aug 2021 19:29:27 +0000 (12:29 -0700)
committerMircea Trofin <mtrofin@google.com>
Fri, 6 Aug 2021 11:44:52 +0000 (04:44 -0700)
commitae1a2a09e41ee7464e785e8925f360f256d0eaca
tree5ebce59b186365a6e16735324ac22b031ec89303
parent6385abd0c4490e0516cb31c0b86c0fbcc052f815
[NFC][MLGO] Make logging more robust

1) add some self-diagnosis (when asserts are enabled) to check that all
features have the same nr of entries

2) avoid storing pointers to mutable fields because the proto API
contract doesn't actually guarantee those stay fixed even if no further
mutation of the object occurs.

Differential Revision: https://reviews.llvm.org/D107594
llvm/include/llvm/Analysis/Utils/TFUtils.h
llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
llvm/lib/Analysis/TFUtils.cpp
llvm/unittests/Analysis/TFUtilsTest.cpp