[llvm] [CycleInfo] Reference cycles by preorder index, not pointer. NFC (PR #210271)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 02:16:59 PDT 2026


================
@@ -123,8 +131,12 @@ template <typename ContextT> class GenericCycleInfo {
   ContextT Context;
   unsigned BlockNumberEpoch;
 
-  /// Map basic block numbers to their inner-most containing cycle.
-  SmallVector<CycleT *> BlockMap;
+  /// Map each basic block number to the preorder index of its inner-most
+  /// containing cycle, or NoCycle if none. During construction this
+  /// transiently holds creation-order indices into
+  /// GenericCycleInfoCompute::AllCycles, which flatten() remaps to preorder
+  /// indices.
+  SmallVector<unsigned> BlockMap;
----------------
aengelke wrote:

CycleRef?

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


More information about the llvm-commits mailing list