-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More exact usage of merging model for method deduping
Summary: Previously, DexLimitsChecker crashed due to mref usage exceeding dex limits, both after the mergeability-aware InterDexReshufflePass (MAReshuffle) and the IntraDexClassMergingPass (IDCM). It is expected that the limit is exceeded after MAReshuffle because it accounts for the mref deduping that will happen in the subsequent IDCM. The limit was exceeded after the IDCM because our approximation of mref deduping was inaccurate. During the process of debugging to identify the gap between our approximation in MAReshuffle and what actually happened in IDCM, we realized that the following contributed to at least 90% of the gap, closing which could bring down the maximum number of mrefs exceeding limit per dex from ~2100 to ~150: - MAReshuffle does not account for the `excluded_types` used by IDCM - MAReshuffle assumes that all ctors of mergeables belonging to the same merger in the same dex can be collapsed into a single new ctor. In practice, this is not the case as we also need to group ctors by protos. To close the gap, we are going to proceed with the following changes: 1) Directly use the info about dedupable vmethods and intf_methods in merging_model and not consider dmethods for deduping. The former would make the model more accurate, and the latter would make the model more conservative so that the last ~150 mrefs exceeding dex limit is taken care of. 2) Make MAReshuffle a service that is called by IDCM, instead of its own pass. This way, the merging model configs shared by IDCM and MAReshuffle that are established in IDCM can easily be used by MAReshuffle, including but not limited to `exclude_types`. This diff makes necessary changes for 1. Reviewed By: beicy Differential Revision: D56850663 fbshipit-source-id: f47ac73614763985ecd453e3ba36abf61e6951ce
- Loading branch information
1 parent
5ce3b2a
commit c126ee1
Showing
5 changed files
with
77 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters