This is an archive of the discontinued LLVM Phabricator instance.

[LSR] Early exit for RateFormula when it is already losing. NFC
ClosedPublic

Authored by eopXD on May 16 2022, 1:29 AM.

Details

Summary

This patch does not effect any behavior of the current code.

The codebase implicitly implies that Cost::RateFormula is only called
when the Cost is not in losing status, or else there may be possible
to trigger the assertion of Cost::isValid.

The intention here is to prevent mis-use where future development
allow Cost that is already loser to call Cost::RateFormula - Early
exit when Cost is already losing.

Diff Detail

Event Timeline

eopXD created this revision.May 16 2022, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 1:29 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
eopXD requested review of this revision.May 16 2022, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 1:29 AM
eopXD added a reviewer: Restricted Project.May 19 2022, 11:35 PM

Can you already trigger the isValid with the current code or is intended for you future changes? If the former, is it possible to add a test case? If the latter, could you highlight that in the summery (maybe even add "NFC" in the title)?

eopXD added a comment.May 27 2022, 3:03 PM

Can you already trigger the isValid with the current code or is intended for you future changes? If the former, is it possible to add a test case? If the latter, could you highlight that in the summery (maybe even add "NFC" in the title)?

The current code does not trigger isValid. Yes, this patch should be an NFC.

eopXD retitled this revision from [LSR] Early exit for RateFormula when it is already losing to [LSR][NFC] Early exit for RateFormula when it is already losing.May 27 2022, 3:07 PM
eopXD edited the summary of this revision. (Show Details)
eopXD retitled this revision from [LSR][NFC] Early exit for RateFormula when it is already losing to [LSR] Early exit for RateFormula when it is already losing. NFC.May 27 2022, 3:19 PM
eopXD added a comment.Jun 1 2022, 8:03 AM

Gentle ping, thank you.

Meinersbur accepted this revision.Jun 1 2022, 10:53 AM

LGTM. Thanks you.

This revision is now accepted and ready to land.Jun 1 2022, 10:53 AM
eopXD updated this revision to Diff 433644.Jun 1 2022, 9:00 PM
eopXD edited the summary of this revision. (Show Details)

Update to main.

This revision was landed with ongoing or failed builds.Jun 1 2022, 9:02 PM
This revision was automatically updated to reflect the committed changes.