[all-commits] [llvm/llvm-project] e1fb24: [CodeGen] Size live ranges in real instructions

Petar Jovanovic via All-commits all-commits at lists.llvm.org
Wed Sep 16 14:16:05 PDT 2026


  Branch: refs/heads/users/petar-jovanovic/greedy-size-in-real-instrs
  Home:   https://github.com/llvm/llvm-project
  Commit: e1fb24a9b975a24fec7736e9433f3957b23d6ab3
      https://github.com/llvm/llvm-project/commit/e1fb24a9b975a24fec7736e9433f3957b23d6ab3
  Author: Petar Jovanovic <petar.jovanovic at amd.com>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/SlotIndexes.h
    M llvm/lib/CodeGen/RegAllocGreedy.cpp
    M llvm/lib/CodeGen/SlotIndexes.cpp
    M llvm/unittests/CodeGen/CMakeLists.txt
    A llvm/unittests/CodeGen/SlotIndexesTest.cpp

  Log Message:
  -----------
  [CodeGen] Size live ranges in real instructions

Slot indexes keep counting instructions that earlier passes erased,
because erasing one only clears the pointer in its index list entry.
The leftovers are not spread evenly, so they inflate some live ranges
more than others and reorder greedy's priority queue, spilling heavily
on register-starved functions.

Add SlotIndexes::getRealInstrSpan(), counting only entries that still
have an instruction, and use it for the size getPriority ranks by.
Off by default behind -greedy-size-in-real-instrs.



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