forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CaptureTracking] Do not capture compares of same object
Compares of the same object do not leak any bits. This patch introduces getUnderlyingObjectLookThrough. It looks at the output of getUnderlyingObject. If it is a PHI, it looks at all the incoming underlying objects. If all those objects are the same, or the original PHI, we determine that there is a new underlying object. This is similar to getUnderlyingObjects, but provides a more efficient way to find a single underlying object. This is an attempt at solving huge compile time regressions in https://reviews.llvm.org/D152082. First, we only look through a single PHI, not nested PHIs. Second, we only use one callsite. There are likely other callsites that could take advantage of this over the vanilla getUnderlyingObjects. We need to be careful about compile times. Adding this to BasicAA::aliasCheck increases compile times by 3% on local builds. This was inspired by the issues in rust-lang/rust#111603. rustc used to generate pointers comparisons that this patch can identify as non capturing. The code emission was changed in rustc to avoid this behavior, but this patch can help with other cases of pointer inductions.
- Loading branch information
Showing
5 changed files
with
42 additions
and
13 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