[all-commits] [llvm/llvm-project] 4695cd: [CycleInfo] Store cycles in a flat preorder array....

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jul 16 01:17:47 PDT 2026


  Branch: refs/heads/users/MaskRay/spr/cycleinfo-store-cycles-in-a-flat-preorder-array-nfc
  Home:   https://github.com/llvm/llvm-project
  Commit: 4695cd39d05cab2d541a8590e0075f31e3ee6d5d
      https://github.com/llvm/llvm-project/commit/4695cd39d05cab2d541a8590e0075f31e3ee6d5d
  Author: Fangrui Song <i at maskray.me>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M llvm/include/llvm/ADT/GenericCycleImpl.h
    M llvm/include/llvm/ADT/GenericCycleInfo.h
    M llvm/lib/Transforms/Utils/FixIrreducible.cpp

  Log Message:
  -----------
  [CycleInfo] Store cycles in a flat preorder array. NFC

Store cycles by value in one array in cycle-forest preorder, each cycle
immediately followed by its descendants, instead of heap-allocating each
cycle and holding its children in a std::vector<std::unique_ptr<>>.
Child and top-level iteration become pointer arithmetic that skips a
subtree via a new NumDescendants count, and sizeof(GenericCycle) drops
from 72 to 48. GenericCycleInfoCompute builds the forest with temporary
nodes, then flatten() moves it into the array.

GenericCycle still exposes raw pointers into this array. The eventual
goal is to replace them with an opaque handle, so all access goes
through GenericCycleInfo and the storage stays an implementation detail.

Aided by Fable 5

Pull Request: https://github.com/llvm/llvm-project/pull/209981



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list