[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / CodeGen / GlobalISel / Combiner.h
blobefe8bdf93664ad1882109456f411f0577a5f796e
1 //== ----- llvm/CodeGen/GlobalISel/Combiner.h -------------------*- C++ -*-== //
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// This contains common code to drive combines. Combiner Passes will need to
10 /// setup a CombinerInfo and call combineMachineFunction.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_GLOBALISEL_COMBINER_H
15 #define LLVM_CODEGEN_GLOBALISEL_COMBINER_H
17 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
18 #include "llvm/CodeGen/MachineFunctionPass.h"
20 namespace llvm {
21 class MachineRegisterInfo;
22 class CombinerInfo;
23 class GISelCSEInfo;
24 class TargetPassConfig;
25 class MachineFunction;
27 class Combiner {
28 public:
29 Combiner(CombinerInfo &CombinerInfo, const TargetPassConfig *TPC);
31 /// If CSEInfo is not null, then the Combiner will setup observer for
32 /// CSEInfo and instantiate a CSEMIRBuilder. Pass nullptr if CSE is not
33 /// needed.
34 bool combineMachineInstrs(MachineFunction &MF, GISelCSEInfo *CSEInfo);
36 protected:
37 CombinerInfo &CInfo;
39 MachineRegisterInfo *MRI = nullptr;
40 const TargetPassConfig *TPC;
41 std::unique_ptr<MachineIRBuilder> Builder;
44 } // End namespace llvm.
46 #endif // LLVM_CODEGEN_GLOBALISEL_GICOMBINER_H