blob: 36a33deb4a642a6338fdee468191f1eca7f0737f [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//== ----- llvm/CodeGen/GlobalISel/Combiner.h --------------------- == //
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/// This contains common code to drive combines. Combiner Passes will need to
11/// setup a CombinerInfo and call combineMachineFunction.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CODEGEN_GLOBALISEL_COMBINER_H
16#define LLVM_CODEGEN_GLOBALISEL_COMBINER_H
17
18#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
19#include "llvm/CodeGen/MachineFunctionPass.h"
20
21namespace llvm {
22class MachineRegisterInfo;
23class CombinerInfo;
24class TargetPassConfig;
25class MachineFunction;
26
27class Combiner {
28public:
29 Combiner(CombinerInfo &CombinerInfo, const TargetPassConfig *TPC);
30
31 bool combineMachineInstrs(MachineFunction &MF);
32
33protected:
34 CombinerInfo &CInfo;
35
36 MachineRegisterInfo *MRI = nullptr;
37 const TargetPassConfig *TPC;
38 MachineIRBuilder Builder;
39};
40
41} // End namespace llvm.
42
43#endif // LLVM_CODEGEN_GLOBALISEL_GICOMBINER_H