-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GlobalOpt] Simplify CleanupConstantGlobalUsers()
This bases the CleanupConstantGlobalUsers() implementation around the ConstantFoldLoadFromConst() API. The general approach is that we discover all users while looking through casts, and then constant fold loads and drop stores and memintrinsics. This avoids special cases and limitations in the previous implementation, which is also incompatible with opaque pointers. The result is a bit more powerful than before, because we now use more general load folding logic which can for example look through pointer bitcasts between different sizes. This is where the test changes come from, as we now fold more loads and can thus remove more globals. Differential Revision: https://reviews.llvm.org/D114889
- Loading branch information
Showing
4 changed files
with
56 additions
and
87 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