-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[SCCPSolver] Make getMRVFunctionsTracked return a reference (NFC) #140851
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
[SCCPSolver] Make getMRVFunctionsTracked return a reference (NFC) #140851
Conversation
This patch makes getMRVFunctionsTracked return a reference. runIPSCCP, the sole user of getMRVFunctionsTracked, just needs a read-access to the map. The missing "&" is most likely an oversight as two "sibling" functions getTrackedRetVals and getTrackedGlobals return maps by const reference.
|
@llvm/pr-subscribers-function-specialization Author: Kazu Hirata (kazutakahirata) ChangesThis patch makes getMRVFunctionsTracked return a reference. The missing "&" is most likely an oversight as two "sibling" functions Full diff: https://github.com/llvm/llvm-project/pull/140851.diff 2 Files Affected:
diff --git a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
index 696f39ca984d1..f8966f5b7472f 100644
--- a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
+++ b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
@@ -147,7 +147,7 @@ class SCCPSolver {
/// getMRVFunctionsTracked - Get the set of functions which return multiple
/// values tracked by the pass.
- const SmallPtrSet<Function *, 16> getMRVFunctionsTracked();
+ const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked();
/// markOverdefined - Mark the specified value overdefined. This
/// works with both scalars and structs.
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
index c64254140cf22..8a89bf654540c 100644
--- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp
+++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
@@ -848,7 +848,7 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
return TrackedGlobals;
}
- const SmallPtrSet<Function *, 16> getMRVFunctionsTracked() {
+ const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked() {
return MRVFunctionsTracked;
}
@@ -2231,7 +2231,7 @@ SCCPSolver::getTrackedGlobals() {
return Visitor->getTrackedGlobals();
}
-const SmallPtrSet<Function *, 16> SCCPSolver::getMRVFunctionsTracked() {
+const SmallPtrSet<Function *, 16> &SCCPSolver::getMRVFunctionsTracked() {
return Visitor->getMRVFunctionsTracked();
}
|
|
@llvm/pr-subscribers-llvm-transforms Author: Kazu Hirata (kazutakahirata) ChangesThis patch makes getMRVFunctionsTracked return a reference. The missing "&" is most likely an oversight as two "sibling" functions Full diff: https://github.com/llvm/llvm-project/pull/140851.diff 2 Files Affected:
diff --git a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
index 696f39ca984d1..f8966f5b7472f 100644
--- a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
+++ b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
@@ -147,7 +147,7 @@ class SCCPSolver {
/// getMRVFunctionsTracked - Get the set of functions which return multiple
/// values tracked by the pass.
- const SmallPtrSet<Function *, 16> getMRVFunctionsTracked();
+ const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked();
/// markOverdefined - Mark the specified value overdefined. This
/// works with both scalars and structs.
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
index c64254140cf22..8a89bf654540c 100644
--- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp
+++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
@@ -848,7 +848,7 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
return TrackedGlobals;
}
- const SmallPtrSet<Function *, 16> getMRVFunctionsTracked() {
+ const SmallPtrSet<Function *, 16> &getMRVFunctionsTracked() {
return MRVFunctionsTracked;
}
@@ -2231,7 +2231,7 @@ SCCPSolver::getTrackedGlobals() {
return Visitor->getTrackedGlobals();
}
-const SmallPtrSet<Function *, 16> SCCPSolver::getMRVFunctionsTracked() {
+const SmallPtrSet<Function *, 16> &SCCPSolver::getMRVFunctionsTracked() {
return Visitor->getMRVFunctionsTracked();
}
|
fhahn
left a comment
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. thanks
This patch makes getMRVFunctionsTracked return a reference.
runIPSCCP, the sole user of getMRVFunctionsTracked, just needs a
read-access to the map.
The missing "&" is most likely an oversight as two "sibling" functions
getTrackedRetVals and getTrackedGlobals return maps by const
reference.