[all-commits] [llvm/llvm-project] cd4007: [RegisterPressure] NFC: Clean up RP handling for i...
Jeffrey Byrnes via All-commits
all-commits at lists.llvm.org
Tue Oct 1 08:10:21 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cd40070bfc77ab2641e69d3e749206ee5c5bbb42
https://github.com/llvm/llvm-project/commit/cd40070bfc77ab2641e69d3e749206ee5c5bbb42
Author: Jeffrey Byrnes <jeffrey.byrnes at amd.com>
Date: 2024-10-01 (Tue, 01 Oct 2024)
Changed paths:
M llvm/lib/CodeGen/RegisterPressure.cpp
Log Message:
-----------
[RegisterPressure] NFC: Clean up RP handling for instructions with overlapping Def/Use (#109875)
The current RP handling for uses of an MI that overlap with defs is
confusing and unnecessary. Moreover, the lane masks do not accurately
model the liveness behavior of the subregs. This cleans things up a bit
and more accurately models subreg lane liveness by sinking the use
handling into subsent Uses loop.
The effect of this PR is to replace
A. `increaseRegPressure(Reg, LiveAfter, ~LiveAfter & LiveBefore)`
with
B. `increaseRegPressure(Reg, LiveAfter, LiveBefore)`
Note that A (Defs loop) and B (Uses loop) have different definitions of
LiveBefore
A. `LiveBefore = (LiveAfter & ~DefLanes) | UseLanes`
and
B. `LiveBefore = LiveAfter | UseLanes`
Also note, `increaseRegPressure` will exit if `PrevMask` (`LiveAfter`
for both A/B) has any active lanes, thus these calls will only have an
effect if `LiveAfter` is 0.
A. NewMask = ~LiveAfter & ((LiveAfter & ~DefLanes) | UseLanes) => (1 &
UseLanes) => UseLanes = (0 | UseLanes) => (LiveAfter | UseLanes) =
NewMask B.
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