-
Notifications
You must be signed in to change notification settings - Fork 13.5k
ValueTracking: Do not look at users of constants for ephemeral values #134618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arsenm
merged 2 commits into
main
from
users/arsenm/valuetracking/do-not-look-at-constant-users-ephemeral-values
Apr 9, 2025
Merged
ValueTracking: Do not look at users of constants for ephemeral values #134618
arsenm
merged 2 commits into
main
from
users/arsenm/valuetracking/do-not-look-at-constant-users-ephemeral-values
Apr 9, 2025
Conversation
This file contains hidden or 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 stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-llvm-analysis Author: Matt Arsenault (arsenm) ChangesThese can only be instructions Full diff: https://github.com/llvm/llvm-project/pull/134618.diff 1 Files Affected:
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 3b0249f91d6d7..111515e685d61 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -472,8 +472,13 @@ static bool isEphemeralValueOf(const Instruction *I, const Value *E) {
!cast<Instruction>(V)->mayHaveSideEffects() &&
!cast<Instruction>(V)->isTerminator())) {
EphValues.insert(V);
- if (const User *U = dyn_cast<User>(V))
- append_range(WorkSet, U->operands());
+
+ if (const User *U = dyn_cast<User>(V)) {
+ for (const Use &U : U->operands()) {
+ if (!isa<Constant>(U))
+ WorkSet.push_back(U.get());
+ }
+ }
}
}
}
|
dtcxzyw
reviewed
Apr 7, 2025
These can only be instructions
fbc607f
to
b4bde69
Compare
dtcxzyw
approved these changes
Apr 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
AllinLeeYL
pushed a commit
to AllinLeeYL/llvm-project
that referenced
this pull request
Apr 10, 2025
var-const
pushed a commit
to ldionne/llvm-project
that referenced
this pull request
Apr 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These can only be instructions