-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[DSE] Simpily if condition (NFC) #137777
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
[DSE] Simpily if condition (NFC) #137777
Conversation
@llvm/pr-subscribers-llvm-transforms Author: None (NewSigma) ChangesNote that the key-value pair has already been initialized, so assignment is not necessary. Full diff: https://github.com/llvm/llvm-project/pull/137777.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 0521df8b818cf..ce210fc26a871 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -1210,13 +1210,11 @@ struct DSEState {
bool isInvisibleToCallerAfterRet(const Value *V) {
if (isa<AllocaInst>(V))
return true;
+
auto I = InvisibleToCallerAfterRet.insert({V, false});
if (I.second) {
- if (!isInvisibleToCallerOnUnwind(V)) {
- I.first->second = false;
- } else if (isNoAliasCall(V)) {
+ if (isInvisibleToCallerOnUnwind(V) && isNoAliasCall(V))
I.first->second = !PointerMayBeCaptured(V, /*ReturnCaptures=*/true);
- }
}
return I.first->second;
}
|
@@ -1210,13 +1210,11 @@ struct DSEState { | |||
bool isInvisibleToCallerAfterRet(const Value *V) { | |||
if (isa<AllocaInst>(V)) | |||
return true; | |||
|
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.
unrelated change?
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.
Break a line for better readability. Feel free to tell me if it should not appear in this patch.
Thanks to fhahn and nikic for the code review. Could you please help merge it if everything looks good? |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/17723 Here is the relevant piece of the build log for the reference
|
Note that the key-value pair has already been initialized, so assignment is not necessary.
Note that the key-value pair has already been initialized, so assignment is not necessary.
Note that the key-value pair has already been initialized, so assignment is not necessary.
Note that the key-value pair has already been initialized, so assignment is not necessary.
Note that the key-value pair has already been initialized, so assignment is not necessary.