[llvm] [VPlan] Track VPValue names in VPlan. (PR #81411)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 09:00:58 PDT 2024


================
@@ -443,21 +444,32 @@ class VPDef {
 class VPlan;
 class VPBasicBlock;
 
-/// This class can be used to assign consecutive numbers to all VPValues in a
-/// VPlan and allows querying the numbering for printing, similar to the
-/// ModuleSlotTracker for IR values.
+/// This class can be used to assign consecutive numbers to VPValues in a
+/// VPlan without underlying values and deduplicated names to VPValues with
+/// underlying values. Allows querying the numbering and deduplicated names for
+/// printing, similar to the ModuleSlotTracker for IR values.
 class VPSlotTracker {
+  /// Keep track of de-duplicated names assigned to VPValues with underlying IR
+  /// values
+  DenseMap<const VPValue *, std::string> AssignedNames;
+  /// Keep track of the next number to use to deduplicate the base name.
+  StringMap<unsigned> NameUseCount;
+
   DenseMap<const VPValue *, unsigned> Slots;
----------------
fhahn wrote:

The slots map has been removed in the latest version.

https://github.com/llvm/llvm-project/pull/81411


More information about the llvm-commits mailing list