[DebugInfo][InstrRef] Short-circuit unnecessary preferred location map construction

Reviewed By: cota

Differential Revision: https://reviews.llvm.org/D117162
This commit is contained in:
Eugene Zhulenev 2022-01-13 02:19:44 -08:00
parent fc7a9f36a9
commit 764e52f0d4
1 changed files with 5 additions and 0 deletions

View File

@ -283,6 +283,11 @@ public:
LocIdx Idx = Location.Idx;
ValueIDNum &VNum = MLocs[Idx.asU64()];
VarLocs.push_back(VNum);
// Short-circuit unnecessary preferred location update.
if (VLocs.empty())
continue;
auto it = ValueToLoc.find(VNum);
// In order of preference, pick:
// * Callee saved registers,