Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Code refactoring for the repo pruning pass. #113

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

MaggieYingYi
Copy link

This is a spin-off pull request from #109 .

@paulhuggett
Copy link

We could really use an explanation of what's being proposed (what it being changed and why). I know that this information exists elsewhere, but it would be kind to future code archaeologists to include it here.

@MaggieYingYi
Copy link
Author

MaggieYingYi commented Aug 6, 2020

We could really use an explanation of what's being proposed (what it being changed and why). I know that this information exists elsewhere, but it would be kind to future code archaeologists to include it here.

This commit is a code refactoring for the repo pruning pass. In the master branch, two kinds of pruning exist in the pass: the repository level and the module level.

  1. Repository level pruning. If the global object is compiled before and exists in the repository, it will be pruned. The repository-level pruning removes code and data that are unchanged since a previous compile.
  2. Module level pruning. If the global object is not already present in the repository but is in the same compilation unit (module) as another global object has the same digest, it will be pruned as well. The module-level pruning is just an early optimization to reduce the amount of stuff going through the remaining parts of the compiler.

However, they are handled in a single function. This commit is just a code factoring to make two kinds of pruning more obvious and noticeable.

llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
@MaggieYingYi MaggieYingYi force-pushed the RepoPruningCodeRefactoring branch from 998e592 to 99f6251 Compare August 12, 2020 16:01
Copy link

@paulhuggett paulhuggett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes much more sense now. Relatively minor comments.

llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
llvm/lib/Transforms/IPO/RepoPruning.cpp Outdated Show resolved Hide resolved
@MaggieYingYi MaggieYingYi force-pushed the RepoPruningCodeRefactoring branch from 99f6251 to 6db1b31 Compare August 18, 2020 15:11
@MaggieYingYi
Copy link
Author

@paulhuggett , Are you happy with the change?

@MaggieYingYi MaggieYingYi force-pushed the RepoPruningCodeRefactoring branch from 747bd9b to d678e09 Compare August 26, 2020 20:27
Copy link

@FlameTop FlameTop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaggieYingYi MaggieYingYi force-pushed the RepoPruningCodeRefactoring branch from d678e09 to af5c423 Compare August 27, 2020 13:52
@MaggieYingYi MaggieYingYi merged commit af5c423 into master Aug 27, 2020
@MaggieYingYi MaggieYingYi deleted the RepoPruningCodeRefactoring branch August 27, 2020 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants