1 //== ----- llvm/CodeGen/GlobalISel/Combiner.h --------------------- == //
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// This contains common code to drive combines. Combiner Passes will need to
11 /// setup a CombinerInfo and call combineMachineFunction.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_GLOBALISEL_COMBINER_H
16 #define LLVM_CODEGEN_GLOBALISEL_COMBINER_H
18 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
19 #include "llvm/CodeGen/MachineFunctionPass.h"
22 class MachineRegisterInfo;
25 class TargetPassConfig;
26 class MachineFunction;
30 Combiner(CombinerInfo &CombinerInfo, const TargetPassConfig *TPC);
32 /// If CSEInfo is not null, then the Combiner will setup observer for
33 /// CSEInfo and instantiate a CSEMIRBuilder. Pass nullptr if CSE is not
35 bool combineMachineInstrs(MachineFunction &MF, GISelCSEInfo *CSEInfo);
40 MachineRegisterInfo *MRI = nullptr;
41 const TargetPassConfig *TPC;
42 std::unique_ptr<MachineIRBuilder> Builder;
45 } // End namespace llvm.
47 #endif // LLVM_CODEGEN_GLOBALISEL_GICOMBINER_H