-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TailDuplication] Add option to enable tail duplication of fallthrough BBs #727
Conversation
|
…uplication of fallthrough BBs Signed-off-by: Vladimir Radosavljevic <[email protected]>
…h BBs During TailDuplication pass, fallthrough BBs are not duplicated. This is fine for most cases, but there are cases where we want to duplicate fallthrough BBs as well (e.g. EvmEmulator). This patch adds the `tail-dup-fallthrough-bbs` option to enable tail duplication of fallthrough BBs. PR: #727. Signed-off-by: Vladimir Radosavljevic <[email protected]>
481bb85
to
53efc24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it improved numbers on EvmEmulator. Could we provide clearer guidance on when this option is beneficial?
There are cases where we want to duplicate fallthrough BBs as well (e.g. EvmEmulator)
This explanation is vague. Additionally, the test case removes an empty BB (which ideally shouldn’t appear post-optimization), it doesn’t provide guidance - though it works fine as a test.
Could this be upstreamed?
…h BBs During the TailDuplication pass, fallthrough BBs are not duplicated. This is generally acceptable, but in scenarios where a loop contains a large switch case and the latch BB is a fallthrough, duplicating the latch BB can eliminate jump instructions in its predecessors. This patch introduces the `tail-dup-fallthrough-bbs` option to enable the duplication of fallthrough BBs. PR: #727. Signed-off-by: Vladimir Radosavljevic <[email protected]>
53efc24
to
2b28888
Compare
Yes, you can see the numbers here (please use edit button to check the numbers before this).
I have changed the explanation, so PTAL.
To provide guidance through the test case, we would need to create a test which contains a loop with a switch case and a latch BB that is a fallthrough, and I don't think it is worth it, since current test is testing the option we introduced.
I tried to enable this by default, but the numbers are not clear win. This option is to cover an edge case that is not common, so we wouldn't have anything to convince the community that this should be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
No description provided.