Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have created this draft to collect some opinions about the idea of allowing devirtualization without the need to
lto
or forcing any kind of visibility.I think applying speculative devirtualization could not need
lto
because it will be safe to be done to each single module without caring if there are other modules/lib that may do inheritance or caring about the visibility.So, I suggest that if
lto
is enabled, the original logic will apply. Ifnolto
, the speculative devirtualizaation will apply (maybe without the other features like virtual constant prop).The idea could be done by either refactoring the current WPD pass and make it able to run with/out
lto
, or creating a new pass.-Side note- there are some code snippets that are commented, I just mean that they maybe not needed for the case of
nolto
, but generally if the idea got accepted, that code will be refactored to work only withlto
.This work could be useful for cases that don't need
lto
.I think there are some open issues related to devirtualization, and they don't need
lto
, this solution could be useful for them.Also I tested it on SPEC, highest performance was around 2-3% and worst regression was not more than 1.5%.
Could you put your feedback please ?