[PATCH] D14677: [LegacyPassManager] Reduce memory usage for AnalysisUsage
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 13 20:49:06 PST 2015
chandlerc added a comment.
This is a really nice improvement. Minor adjustment below is my only real suggestion.
================
Comment at: lib/IR/LegacyPassManager.cpp:582-587
@@ +581,8 @@
+ // of dependencies.
+ AnalysisUsage AU;
+ P->getAnalysisUsage(AU);
+
+ auto *Node = [&]() {
+ FoldingSetNodeID ID;
+ AUFoldingSetNode::Profile(ID, AU);
+ void *IP = nullptr;
----------------
Since we build this completely each time, the folding set machinery isn't really hepling much. Maybe just provide a hash_value overload and use a SmallSet? Should be able to either delegate to the vector's hash_value or use hash_combine_range.
(This isn't because they're that much simpler, I'd just rather move everything away from folding sets where reasonable.)
================
Comment at: lib/IR/LegacyPassManager.cpp:594
@@ +593,3 @@
+ return Temp;
+ }();
+
----------------
As sympathetic as I am to using multiple returns like this in an immediately called lamda, I find it quite confusing. Especially with the auto type on the variable.
Fortunately, I think with a set, the code to do this without a lambda shouldn't be onerous at all.
http://reviews.llvm.org/D14677
More information about the llvm-commits
mailing list