diff options
author | Kazu Hirata <kazu@google.com> | 2024-06-13 11:08:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 11:08:17 -0700 |
commit | 4b493e31b2c5d72d993f0e914adb711f3ce4ba05 (patch) | |
tree | 648ec14d72a1907330b4b0360d0d95b8a560b035 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | |
parent | 2414a90730d87c20d9ff8d7951ed24e3328124ed (diff) | |
download | llvm-4b493e31b2c5d72d993f0e914adb711f3ce4ba05.zip llvm-4b493e31b2c5d72d993f0e914adb711f3ce4ba05.tar.gz llvm-4b493e31b2c5d72d993f0e914adb711f3ce4ba05.tar.bz2 |
[ProfileData] Add getValueArrayForSite (#95335)
Without this patch, a typical traversal over the value data looks
like:
uint32_t NV = Func.getNumValueDataForSite(VK, S);
std::unique_ptr<InstrProfValueData[]> VD = Func.getValueForSite(VK, S);
for (uint32_t V = 0; V < NV; V++)
Do something with VD[V].Value and/or VD[V].Count;
This patch adds getValueArrayForSite, which returns
ArrayRef<InstrProfValueData>, so we can do:
for (const auto &V : Func.getValueArrayForSite(VK, S))
Do something with V.Value and/or V.Count;
I'm planning to migrate the existing uses of getValueForSite to
getValueArrayForSite in follow-up patches and remove getValueForSite
and getNumValueDataForSite.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions