1 //===- SCCP.cpp - Sparse Conditional Constant Propagation -------*- 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 /// \file
10 // This file implements sparse conditional constant propagation and merging:
11 //
12 // Specifically, this:
13 //   * Assumes values are constant unless proven otherwise
14 //   * Assumes BasicBlocks are dead unless proven otherwise
15 //   * Proves values to be constant, and replaces them with constants
16 //   * Proves conditional branches to be unconditional
17 //
18 ///
19 //===----------------------------------------------------------------------===//
20 
21 #ifndef LLVM_TRANSFORMS_SCALAR_SCCP_H
22 #define LLVM_TRANSFORMS_SCALAR_SCCP_H
23 
24 #include "llvm/IR/Function.h"
25 #include "llvm/IR/PassManager.h"
26 
27 namespace llvm {
28 
29 /// This pass performs function-level constant propagation and merging.
30 class SCCPPass : public PassInfoMixin<SCCPPass> {
31 public:
32   PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
33 };
34 }
35 
36 #endif // LLVM_TRANSFORMS_SCALAR_SCCP_H
37