[llvm] [CycleInfo] Move cycle accessors to GenericCycleInfo. NFC (PR #209990)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 09:53:04 PDT 2026


================
@@ -249,9 +182,44 @@ template <typename ContextT> class GenericCycleInfo {
     return Number < BlockMap.size() ? BlockMap[Number] : nullptr;
   }
 
+  BlockT *getHeader(const CycleT &C) const { return C.Entries[0]; }
+  bool isReducible(const CycleT &C) const { return C.Entries.size() == 1; }
+  CycleT *getParentCycle(const CycleT &C) const { return C.ParentCycle; }
+  unsigned getDepth(const CycleT &C) const { return C.Depth; }
+  size_t getNumBlocks(const CycleT &C) const { return C.IdxEnd - C.IdxBegin; }
+
+  const SmallVectorImpl<BlockT *> &getEntries(const CycleT &C) const {
----------------
MaskRay wrote:

Done

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


More information about the llvm-commits mailing list