Mercurial > hg > CbC > CbC_llvm
comparison include/llvm/Transforms/Scalar/SCCP.h @ 148:63bd29f05246
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 19:46:37 +0900 |
parents | c2174574ed3a |
children |
comparison
equal
deleted
inserted
replaced
146:3fc4d5c3e21e | 148:63bd29f05246 |
---|---|
1 //===- SCCP.cpp - Sparse Conditional Constant Propagation -------*- C++ -*-===// | 1 //===- SCCP.cpp - Sparse Conditional Constant Propagation -------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 // | 4 // See https://llvm.org/LICENSE.txt for license information. |
5 // This file is distributed under the University of Illinois Open Source | 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 // License. See LICENSE.TXT for details. | |
7 // | 6 // |
8 //===----------------------------------------------------------------------===// | 7 //===----------------------------------------------------------------------===// |
9 // | 8 // |
10 // \file | 9 // \file |
11 // This file implements sparse conditional constant propagation and merging: | 10 // This file implements sparse conditional constant propagation and merging: |
19 //===----------------------------------------------------------------------===// | 18 //===----------------------------------------------------------------------===// |
20 | 19 |
21 #ifndef LLVM_TRANSFORMS_SCALAR_SCCP_H | 20 #ifndef LLVM_TRANSFORMS_SCALAR_SCCP_H |
22 #define LLVM_TRANSFORMS_SCALAR_SCCP_H | 21 #define LLVM_TRANSFORMS_SCALAR_SCCP_H |
23 | 22 |
23 #include "llvm/ADT/STLExtras.h" | |
24 #include "llvm/Analysis/TargetLibraryInfo.h" | |
25 #include "llvm/IR/DataLayout.h" | |
26 #include "llvm/IR/Function.h" | |
27 #include "llvm/IR/Module.h" | |
24 #include "llvm/IR/PassManager.h" | 28 #include "llvm/IR/PassManager.h" |
29 #include "llvm/Transforms/Utils/PredicateInfo.h" | |
25 | 30 |
26 namespace llvm { | 31 namespace llvm { |
27 | 32 |
28 class Function; | 33 class PostDominatorTree; |
29 | 34 |
30 /// This pass performs function-level constant propagation and merging. | 35 /// This pass performs function-level constant propagation and merging. |
31 class SCCPPass : public PassInfoMixin<SCCPPass> { | 36 class SCCPPass : public PassInfoMixin<SCCPPass> { |
32 public: | 37 public: |
33 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); | 38 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); |
34 }; | 39 }; |
35 | 40 |
41 /// Helper struct for bundling up the analysis results per function for IPSCCP. | |
42 struct AnalysisResultsForFn { | |
43 std::unique_ptr<PredicateInfo> PredInfo; | |
44 DominatorTree *DT; | |
45 PostDominatorTree *PDT; | |
46 }; | |
47 | |
48 bool runIPSCCP(Module &M, const DataLayout &DL, const TargetLibraryInfo *TLI, | |
49 function_ref<AnalysisResultsForFn(Function &)> getAnalysis); | |
36 } // end namespace llvm | 50 } // end namespace llvm |
37 | 51 |
38 #endif // LLVM_TRANSFORMS_SCALAR_SCCP_H | 52 #endif // LLVM_TRANSFORMS_SCALAR_SCCP_H |