[PATCH] D74985: [LiveDebugValues] Encode a location in VarLoc IDs, NFC [2/3]

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 12:17:54 PST 2020


vsk created this revision.
vsk added reviewers: aprantl, jmorse, NikolaPrica, djtodoro.
vsk added a project: debug-info.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This is part 2 of a 3-part series to address a compile-time explosion
issue in LiveDebugValues.

---

Each VarLoc has a unique ID: this ID is used to look up a VarLoc in the
VarLocMap, and to virtually insert a VarLoc into a VarLocSet. Instead of
inserting the VarLoc /itself/ into the VarLocSet, we insert just the ID,
because this can be represented efficiently with a SparseBitVector.

This change introduces LocIndex, a layer of abstraction on top of VarLoc
IDs. Prior to this change, an ID was just an index into a vector. With
this change, an ID encodes both an index /and/ a register location. The
type-checker ensures that conversions to and from LocIndex are correct.

For the moment the register location is always 0 (undef). We have plenty
of bits left over to encode physregs, stack slots, and other locations
in the future.

Loosely depends on: https://reviews.llvm.org/D74984


https://reviews.llvm.org/D74985

Files:
  llvm/lib/CodeGen/LiveDebugValues.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74985.245957.patch
Type: text/x-patch
Size: 17131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200221/fe3e25d7/attachment.bin>


More information about the llvm-commits mailing list