1 //===- ArgumentPromotion.h - Promote by-reference arguments -----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_TRANSFORMS_IPO_ARGUMENTPROMOTION_H
11 #define LLVM_TRANSFORMS_IPO_ARGUMENTPROMOTION_H
12 
13 #include "llvm/Analysis/CGSCCPassManager.h"
14 #include "llvm/Analysis/LazyCallGraph.h"
15 #include "llvm/IR/PassManager.h"
16 
17 namespace llvm {
18 
19 /// Argument promotion pass.
20 ///
21 /// This pass walks the functions in each SCC and for each one tries to
22 /// transform it and all of its callers to replace indirect arguments with
23 /// direct (by-value) arguments.
24 class ArgumentPromotionPass : public PassInfoMixin<ArgumentPromotionPass> {
25 public:
26   PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
27                         LazyCallGraph &CG, CGSCCUpdateResult &UR);
28 };
29 
30 } // end namespace llvm
31 
32 #endif // LLVM_TRANSFORMS_IPO_ARGUMENTPROMOTION_H
33