[all-commits] [llvm/llvm-project] ea5f74: [CodeGen] Move rollback capabilities outside of th...
Lucas Ramirez via All-commits
all-commits at lists.llvm.org
Tue Mar 24 06:59:45 PDT 2026
Branch: refs/heads/users/lucas-rami/rematerializer-rollback-listener
Home: https://github.com/llvm/llvm-project
Commit: ea5f742d2d4cfd3ec6223268be9c83ce7fccdd5f
https://github.com/llvm/llvm-project/commit/ea5f742d2d4cfd3ec6223268be9c83ce7fccdd5f
Author: Lucas Ramirez <lucas.rami at proton.me>
Date: 2026-03-24 (Tue, 24 Mar 2026)
Changed paths:
M llvm/include/llvm/CodeGen/Rematerializer.h
M llvm/lib/CodeGen/Rematerializer.cpp
M llvm/unittests/CodeGen/RematerializerTest.cpp
Log Message:
-----------
[CodeGen] Move rollback capabilities outside of the rematerializer
The rematerializer implements support for rolling back
rematerializations by modifying MIs that should normally be deleted in
an attempt to make them "transparent" to other analyses. This involves:
1. setting their opcode to DBG_VALUE and
2. setting their read register operands to the sentinel register.
This approach has several drawbacks.
1. It forces the rematerializer to support tracking these "dead MIs".
2. It is not actually clear whether this mechanism will interact well
with all other analyses. This is an issue since the intent of the
rematerializer is to be usable in as many contexts as possible.
3. In practice, it has shown itself to be relatively error-prone.
This commit removes rollback support from the rematerializer and moves
those capabilties to a rematerializer listener than can be instantiated
on-demand and implements the same functionnality on top of standard
rematerializer operations. The rematerializer now actually deletes MIs
that are no longer useful after rematerializations, and has support for
re-creating them on-demand without requiring additional tracking on its
part.
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