LLVM  6.0.0svn
MacroFusion.h
Go to the documentation of this file.
1 //===- MacroFusion.h - Macro Fusion -----------------------------*- 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 /// \file This file contains the definition of the DAG scheduling mutation to
11 /// pair instructions back to back.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_MACROFUSION_H
16 #define LLVM_CODEGEN_MACROFUSION_H
17 
18 #include <functional>
19 #include <memory>
20 
21 namespace llvm {
22 
23 class MachineInstr;
24 class ScheduleDAGMutation;
25 class TargetInstrInfo;
26 class TargetSubtargetInfo;
27 
28 /// \brief Check if the instr pair, FirstMI and SecondMI, should be fused
29 /// together. Given SecondMI, when FirstMI is unspecified, then check if
30 /// SecondMI may be part of a fused pair at all.
31 using ShouldSchedulePredTy = std::function<bool(const TargetInstrInfo &TII,
32  const TargetSubtargetInfo &TSI,
33  const MachineInstr *FirstMI,
34  const MachineInstr &SecondMI)>;
35 
36 /// \brief Create a DAG scheduling mutation to pair instructions back to back
37 /// for instructions that benefit according to the target-specific
38 /// shouldScheduleAdjacent predicate function.
39 std::unique_ptr<ScheduleDAGMutation>
41 
42 /// \brief Create a DAG scheduling mutation to pair branch instructions with one
43 /// of their predecessors back to back for instructions that benefit according
44 /// to the target-specific shouldScheduleAdjacent predicate function.
45 std::unique_ptr<ScheduleDAGMutation>
47 
48 } // end namespace llvm
49 
50 #endif // LLVM_CODEGEN_MACROFUSION_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
const HexagonInstrInfo * TII
std::unique_ptr< ScheduleDAGMutation > createMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent)
Create a DAG scheduling mutation to pair instructions back to back for instructions that benefit acco...
std::function< bool(const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI)> ShouldSchedulePredTy
Check if the instr pair, FirstMI and SecondMI, should be fused together.
Definition: MacroFusion.h:34
static bool shouldScheduleAdjacent(const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI)
Check if the instr pair, FirstMI and SecondMI, should be fused together.
std::unique_ptr< ScheduleDAGMutation > createBranchMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent)
Create a DAG scheduling mutation to pair branch instructions with one of their predecessors back to b...
Representation of each machine instruction.
Definition: MachineInstr.h:59
print Print MemDeps of function