This is an archive of the discontinued LLVM Phabricator instance.

[RegAllocFast] Clean-up. Remove redundant operations. NFC.
ClosedPublic

Authored by skatkov on Sep 2 2021, 11:21 PM.

Diff Detail

Event Timeline

skatkov created this revision.Sep 2 2021, 11:21 PM
skatkov requested review of this revision.Sep 2 2021, 11:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2021, 11:21 PM
Herald added a subscriber: wdng. · View Herald Transcript
skatkov retitled this revision from [RegAllocFast] Clean-up. Removbe redundant operations. NFC. to [RegAllocFast] Clean-up. Remove redundant operations. NFC..Sep 2 2021, 11:21 PM
skatkov added inline comments.Sep 2 2021, 11:24 PM
llvm/lib/CodeGen/RegAllocFast.cpp
1305

EarlyClobber's sub regs will be handled here, so no need to do the same while we are processing EarlyClobbers at the end.

1354

We checked the condition here.

skatkov updated this revision to Diff 370490.Sep 3 2021, 12:10 AM
reames resigned from this revision.Nov 30 2021, 9:55 AM
arsenm added inline comments.Jun 27 2022, 5:54 AM
llvm/lib/CodeGen/RegAllocFast.cpp
1207

This now may require new reallocation for each call

1357

This part LGTM

1409

This part LGTM

Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 5:54 AM

Reverse ping

MatzeB accepted this revision.Sep 28 2022, 2:56 PM

LGTM, though maybe re-consider the kill flag change unless you have a reason to add one...

llvm/lib/CodeGen/RegAllocFast.cpp
1357

We don't track liveness for reserved register (they're considered to be always alive). So I don't see what the point of adding a kill flag here is. I would expect it to not matter one way or another and not having a kill flag being less noise...

This revision is now accepted and ready to land.Sep 28 2022, 2:56 PM
MatzeB added inline comments.Sep 28 2022, 2:58 PM
MatzeB added inline comments.Sep 28 2022, 3:00 PM
llvm/lib/CodeGen/RegAllocFast.cpp
1207

I would expect more than 8 def operands to be very rare so I wouldn't really worry about reallocations... That said I also don't know why moving the SmallVector around helps anything...

MatzeB added inline comments.Sep 28 2022, 3:17 PM
llvm/lib/CodeGen/RegAllocFast.cpp
1357

And I just noticed the other comment, saying that we will never reach this point in the file for reserved regs. Makes sense!

I'll try to look at it later this or may be earlier next week. I'm a bit detached from this topic and need some time to refresh.

skatkov added inline comments.Oct 4 2022, 8:57 PM
llvm/lib/CodeGen/RegAllocFast.cpp
1207

I agree, this is bad change. Originally I planned to add a support of statepoint instruction in the mode when it may have a lot of tied defs, And indeed this may require reallocation, so it is better to return this back.

skatkov updated this revision to Diff 465268.Oct 4 2022, 9:00 PM

Update before landing

arsenm accepted this revision.Oct 4 2022, 9:02 PM
This revision was landed with ongoing or failed builds.Oct 4 2022, 9:39 PM
This revision was automatically updated to reflect the committed changes.