[llvm] [Support] Use block numbers for DomTree construction (PR #101706)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 07:37:36 PDT 2024


================
@@ -73,7 +73,11 @@ struct SemiNCAInfo {
   // Number to node mapping is 1-based. Initialize the mapping to start with
   // a dummy element.
   SmallVector<NodePtr, 64> NumToNode = {nullptr};
-  DenseMap<NodePtr, InfoRec> NodeToInfo;
+  // If blocks have numbers (e.g., BasicBlock, MachineBasicBlock), store node
+  // infos in a vector.
+  SmallVector<InfoRec, 64> NodeInfos;
+  // For blocks without numbers, store InfoRec in a map.
+  DenseMap<NodePtr, InfoRec> NodeInfoMap;
----------------
aengelke wrote:

Good idea! I use conditional_t now to toggle the type of NodeInfos itself between a map and a vector.

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


More information about the llvm-commits mailing list