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

Lucas Ramirez via All-commits all-commits at lists.llvm.org
Tue Jul 14 04:07:55 PDT 2026


  Branch: refs/heads/users/lucas-rami/rematerializer-finegrain-lis-update
  Home:   https://github.com/llvm/llvm-project
  Commit: 3def39f9b4530455bfd3b1a46bfbe04c215c7b95
      https://github.com/llvm/llvm-project/commit/3def39f9b4530455bfd3b1a46bfbe04c215c7b95
  Author: Lucas Ramirez <lucas.rami at proton.me>
  Date:   2026-07-14 (Tue, 14 Jul 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.


  Commit: c60808827479ea95c51e80558b5c475d861fb2d6
      https://github.com/llvm/llvm-project/commit/c60808827479ea95c51e80558b5c475d861fb2d6
  Author: Lucas Ramirez <lucas.rami at proton.me>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/lib/CodeGen/Rematerializer.cpp

  Log Message:
  -----------
  Move includes to .cpp


  Commit: b565dba32848127aaf0fbf930f6452f348af469f
      https://github.com/llvm/llvm-project/commit/b565dba32848127aaf0fbf930f6452f348af469f
  Author: Lucas Ramirez <lucas.rami at proton.me>
  Date:   2026-07-14 (Tue, 14 Jul 2026)

  Changed paths:
    M llvm/lib/CodeGen/Rematerializer.cpp

  Log Message:
  -----------
  Remove llvm:: prefixes and try fix includes as well


Compare: https://github.com/llvm/llvm-project/compare/d81ce6d75d74...b565dba32848

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