1 //===- ArgumentPromotion.h - Promote by-reference arguments -----*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TRANSFORMS_IPO_ARGUMENTPROMOTION_H
10 #define LLVM_TRANSFORMS_IPO_ARGUMENTPROMOTION_H
12 #include "llvm/Analysis/CGSCCPassManager.h"
13 #include "llvm/Analysis/LazyCallGraph.h"
14 #include "llvm/IR/PassManager.h"
18 /// Argument promotion pass.
20 /// This pass walks the functions in each SCC and for each one tries to
21 /// transform it and all of its callers to replace indirect arguments with
22 /// direct (by-value) arguments.
23 class ArgumentPromotionPass
: public PassInfoMixin
<ArgumentPromotionPass
> {
27 ArgumentPromotionPass(unsigned MaxElements
= 3u) : MaxElements(MaxElements
) {}
29 PreservedAnalyses
run(LazyCallGraph::SCC
&C
, CGSCCAnalysisManager
&AM
,
30 LazyCallGraph
&CG
, CGSCCUpdateResult
&UR
);
33 } // end namespace llvm
35 #endif // LLVM_TRANSFORMS_IPO_ARGUMENTPROMOTION_H