This is an archive of the discontinued LLVM Phabricator instance.

[LocalStackSlotAllocation] Minor simplifications. NFC
ClosedPublic

Authored by craig.topper on Jan 6 2023, 11:42 AM.

Details

Summary

Instead of maintaining a separate valid flag for BaseReg, Use
BaseReg.isValid(). I think this is left over from an older
implementation that maintained a vector of base registers.

The other change is not do a speculative assignment to BaseOffset
that needs to be reverted. Only commit it after we do the check.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 6 2023, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 11:42 AM
craig.topper requested review of this revision.Jan 6 2023, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 11:42 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm accepted this revision.Jan 9 2023, 4:58 AM
arsenm added inline comments.
llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
388

Conversion to bool also works, you don't need an explicit isValid

This revision is now accepted and ready to land.Jan 9 2023, 4:58 AM
craig.topper added inline comments.Jan 9 2023, 8:48 AM
llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
388

I think it’s going through operator unsigned which I thought we wanted to remove from Register someday.

arsenm added inline comments.Jan 9 2023, 8:50 AM
llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
388

Yes, but at that point it could have operator bool

This revision was landed with ongoing or failed builds.Jan 9 2023, 9:50 AM
This revision was automatically updated to reflect the committed changes.