This is an archive of the discontinued LLVM Phabricator instance.

[RegisterCoalescer] Use LiveRangeEdit to handle rematerialization
ClosedPublic

Authored by Carrot on Sep 9 2022, 1:07 PM.

Details

Summary

This patch uses the API provided by LiveRangeEdit to handle rematerialization. It will make future maintenance and improvement more easier.

No functional change.

Diff Detail

Event Timeline

Carrot created this revision.Sep 9 2022, 1:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 1:07 PM
Carrot requested review of this revision.Sep 9 2022, 1:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 1:07 PM
rampitec added inline comments.Sep 9 2022, 1:37 PM
llvm/lib/CodeGen/RegisterCoalescer.cpp
1307

isAsCheapAsAMove is a very cheap check, better to leave it here and bail early rather then defer it until you call canRematerializeAt.

Carrot updated this revision to Diff 459198.Sep 9 2022, 2:08 PM
Carrot marked an inline comment as done.

LGTM, but let others review it too.

lkail added a subscriber: lkail.Sep 9 2022, 11:25 PM
arsenm added inline comments.Sep 12 2022, 5:57 AM
llvm/lib/CodeGen/LiveRangeEdit.cpp
197

Shouldn't this return getRegSlot like the fallthrough case?

Carrot updated this revision to Diff 459549.Sep 12 2022, 1:38 PM
Carrot marked an inline comment as done.
arsenm accepted this revision.Sep 13 2022, 8:46 AM

LGTM

This revision is now accepted and ready to land.Sep 13 2022, 8:46 AM
This revision was landed with ongoing or failed builds.Sep 21 2022, 10:55 AM
This revision was automatically updated to reflect the committed changes.