[llvm] r322025 - ArgPromotion: Allow setting MaxElements in the new-style pass
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 13:13:35 PST 2018
Author: bogner
Date: Mon Jan 8 13:13:35 2018
New Revision: 322025
URL: http://llvm.org/viewvc/llvm-project?rev=322025&view=rev
Log:
ArgPromotion: Allow setting MaxElements in the new-style pass
Modified:
llvm/trunk/include/llvm/Transforms/IPO/ArgumentPromotion.h
llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
Modified: llvm/trunk/include/llvm/Transforms/IPO/ArgumentPromotion.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/ArgumentPromotion.h?rev=322025&r1=322024&r2=322025&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/ArgumentPromotion.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/ArgumentPromotion.h Mon Jan 8 13:13:35 2018
@@ -22,7 +22,11 @@ namespace llvm {
/// transform it and all of its callers to replace indirect arguments with
/// direct (by-value) arguments.
class ArgumentPromotionPass : public PassInfoMixin<ArgumentPromotionPass> {
+ unsigned MaxElements;
+
public:
+ ArgumentPromotionPass(unsigned MaxElements = 3u) : MaxElements(MaxElements) {}
+
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
LazyCallGraph &CG, CGSCCUpdateResult &UR);
};
Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=322025&r1=322024&r2=322025&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Mon Jan 8 13:13:35 2018
@@ -963,7 +963,7 @@ PreservedAnalyses ArgumentPromotionPass:
return FAM.getResult<AAManager>(F);
};
- Function *NewF = promoteArguments(&OldF, AARGetter, 3u, None);
+ Function *NewF = promoteArguments(&OldF, AARGetter, MaxElements, None);
if (!NewF)
continue;
LocalChange = true;
More information about the llvm-commits
mailing list