[all-commits] [llvm/llvm-project] e49c5e: [CodeGen] Fine-grained LIS updates on remat and de...

Lucas Ramirez via All-commits all-commits at lists.llvm.org
Tue Jun 9 07:27:27 PDT 2026


  Branch: refs/heads/users/lucas-rami/rematerializer-finegrain-lis-update
  Home:   https://github.com/llvm/llvm-project
  Commit: e49c5e173bae99f30256f6bff5c4a1ba98d9efa0
      https://github.com/llvm/llvm-project/commit/e49c5e173bae99f30256f6bff5c4a1ba98d9efa0
  Author: Lucas Ramirez <lucas.rami at proton.me>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/Rematerializer.h
    M llvm/lib/CodeGen/Rematerializer.cpp
    M llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats.mir
    M llvm/unittests/CodeGen/RematerializerTest.cpp

  Log Message:
  -----------
  [CodeGen] Fine-grained LIS updates on remat and dead-def handling

This replaces the rematerializer's manual bulk LIS update paradigm in
favor of an automated fine-grained one that

1. performs LIS updates as rematerializations happen and
2. handles the removal of dead-definitions properly (this replaces the
   prior partial handling of live interval splitting).

The new approach should be less error-prone (clients do not have to
periodically update the LIS, which is now up-to-date at all times from
the clients's perspective) and faster in general (live intervals aren't
fully re-created every time a def or use of a register changes).

Handling dead-definitions (through a `LiveRangeEditor`) adds some
complexity to the rematerializer since unrematerializable MIs can now
also be deleted. This is exposed to listeners through a new event.
Furthermore, rematerializable registers can now become "permanently
dead" if all their users were unrematerializable MIs that became dead as
a result of other rematerializations.

The combination of these two improvements makes handling live-interval
splitting unnecessary. Rematerializable registers have a single-def by
construction so cannot ever have multiple disconnected components. On
the other hand, if we remove dead definitions as they appear,
unreamaterializable registers's live interval cannot become made up of
multiple disconnected components purely as a result of
rematerializations. It is the rematerializer's client responsibility to
ensure that the LIS is in a valid state before the rematerializer
analyses the function.



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