LCOV - code coverage report
Current view: top level - include/llvm/Transforms/InstCombine - InstCombine.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 8 8 100.0 %
Date: 2017-09-14 15:23:50 Functions: 2 3 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- InstCombine.h - InstCombine pass -------------------------*- 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             : /// This file provides the primary interface to the instcombine pass. This pass
      12             : /// is suitable for use in the new pass manager. For a pass that works with the
      13             : /// legacy pass manager, please look for \c createInstructionCombiningPass() in
      14             : /// Scalar.h.
      15             : ///
      16             : //===----------------------------------------------------------------------===//
      17             : 
      18             : #ifndef LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINE_H
      19             : #define LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINE_H
      20             : 
      21             : #include "llvm/IR/Function.h"
      22             : #include "llvm/IR/PassManager.h"
      23             : #include "llvm/Transforms/InstCombine/InstCombineWorklist.h"
      24             : 
      25             : namespace llvm {
      26             : 
      27        2215 : class InstCombinePass : public PassInfoMixin<InstCombinePass> {
      28             :   InstCombineWorklist Worklist;
      29             :   bool ExpensiveCombines;
      30             : 
      31             : public:
      32         318 :   static StringRef name() { return "InstCombinePass"; }
      33             : 
      34             :   explicit InstCombinePass(bool ExpensiveCombines = true)
      35         886 :       : ExpensiveCombines(ExpensiveCombines) {}
      36             : 
      37             :   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
      38             : };
      39             : 
      40             : /// \brief The legacy pass manager's instcombine pass.
      41             : ///
      42             : /// This is a basic whole-function wrapper around the instcombine utility. It
      43             : /// will try to combine all instructions in the function.
      44       18066 : class InstructionCombiningPass : public FunctionPass {
      45             :   InstCombineWorklist Worklist;
      46             :   const bool ExpensiveCombines;
      47             : 
      48             : public:
      49             :   static char ID; // Pass identification, replacement for typeid
      50             : 
      51        9033 :   InstructionCombiningPass(bool ExpensiveCombines = true)
      52       27099 :       : FunctionPass(ID), ExpensiveCombines(ExpensiveCombines) {
      53        9033 :     initializeInstructionCombiningPassPass(*PassRegistry::getPassRegistry());
      54        9033 :   }
      55             : 
      56             :   void getAnalysisUsage(AnalysisUsage &AU) const override;
      57             :   bool runOnFunction(Function &F) override;
      58             : };
      59             : }
      60             : 
      61             : #endif

Generated by: LCOV version 1.13