LLVM  8.0.0svn
InstSimplifyPass.h
Go to the documentation of this file.
1 //===- InstSimplifyPass.h ---------------------------------------*- 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 ///
11 /// Defines passes for running instruction simplification across chunks of IR.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_TRANSFORMS_UTILS_INSTSIMPLIFYPASS_H
16 #define LLVM_TRANSFORMS_UTILS_INSTSIMPLIFYPASS_H
17 
18 #include "llvm/IR/PassManager.h"
19 
20 namespace llvm {
21 
22 class FunctionPass;
23 
24 /// Run instruction simplification across each instruction in the function.
25 ///
26 /// Instruction simplification has useful constraints in some contexts:
27 /// - It will never introduce *new* instructions.
28 /// - There is no need to iterate to a fixed point.
29 ///
30 /// Many passes use instruction simplification as a library facility, but it may
31 /// also be useful (in tests and other contexts) to have access to this very
32 /// restricted transform at a pass granularity. However, for a much more
33 /// powerful and comprehensive peephole optimization engine, see the
34 /// `instcombine` pass instead.
35 class InstSimplifyPass : public PassInfoMixin<InstSimplifyPass> {
36 public:
38 };
39 
40 /// Create a legacy pass that does instruction simplification on each
41 /// instruction in a function.
43 
44 } // end namespace llvm
45 
46 #endif // LLVM_TRANSFORMS_UTILS_INSTSIMPLIFYPASS_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run instruction simplification across each instruction in the function.
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
FunctionPass * createInstSimplifyLegacyPass()
Create a legacy pass that does instruction simplification on each instruction in a function...
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:285
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.