[DebugInfo][InstrRef][NFC] Cache some PHI resolutions
authorJeremy Morse <jeremy.morse@sony.com>
Wed, 2 Feb 2022 12:12:32 +0000 (12:12 +0000)
committerJeremy Morse <jeremy.morse@sony.com>
Wed, 2 Feb 2022 12:21:28 +0000 (12:21 +0000)
commitd556eb7e27c25ae20befb0811bc8a3423241431d
treeccbf0007a500a872a008c03b8742e73a5db1daf6
parent81d3144ebf856c835cd6b1443ed76be423184995
[DebugInfo][InstrRef][NFC] Cache some PHI resolutions

Install a cache of DBG_INSTR_REF -> ValueIDNum resolutions, for scenarios
where the value has to be reconstructed from several DBG_PHIs. Whenever
this happens, it's because branch folding + tail duplication has messed
with the SSA form of the program, and we have to solve a mini SSA problem
to find the variable value. This is always called twice, so it makes sense
to cache the value.

This gives a ~0.5% geomean compile-time-performance improvement on CTMark.

Differential Revision: https://reviews.llvm.org/D118455
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h