LLVM  7.0.0
CombinerInfo.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/GlobalISel/CombinerInfo.h ------*- 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 /// Interface for Targets to specify which operations are combined how and when.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_GLOBALISEL_COMBINER_INFO_H
15 #define LLVM_CODEGEN_GLOBALISEL_COMBINER_INFO_H
16 
17 #include <cassert>
18 namespace llvm {
19 
20 class LegalizerInfo;
21 class MachineInstr;
22 class MachineIRBuilder;
23 class MachineRegisterInfo;
24 // Contains information relevant to enabling/disabling various combines for a
25 // pass.
26 class CombinerInfo {
27 public:
28  CombinerInfo(bool AllowIllegalOps, bool ShouldLegalizeIllegal,
30  : IllegalOpsAllowed(AllowIllegalOps),
31  LegalizeIllegalOps(ShouldLegalizeIllegal), LInfo(LInfo) {
32  assert(((AllowIllegalOps || !LegalizeIllegalOps) || LInfo) &&
33  "Expecting legalizerInfo when illegalops not allowed");
34  }
35  virtual ~CombinerInfo() = default;
36  /// If \p IllegalOpsAllowed is false, the CombinerHelper will make use of
37  /// the legalizerInfo to check for legality before each transformation.
38  bool IllegalOpsAllowed; // TODO: Make use of this.
39 
40  /// If \p LegalizeIllegalOps is true, the Combiner will also legalize the
41  /// illegal ops that are created.
42  bool LegalizeIllegalOps; // TODO: Make use of this.
44  virtual bool combine(MachineInstr &MI, MachineIRBuilder &B) const = 0;
45 };
46 } // namespace llvm
47 
48 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
virtual ~CombinerInfo()=default
const LegalizerInfo * LInfo
Definition: CombinerInfo.h:43
CombinerInfo(bool AllowIllegalOps, bool ShouldLegalizeIllegal, LegalizerInfo *LInfo)
Definition: CombinerInfo.h:28
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool IllegalOpsAllowed
If IllegalOpsAllowed is false, the CombinerHelper will make use of the legalizerInfo to check for leg...
Definition: CombinerInfo.h:38
bool LegalizeIllegalOps
If LegalizeIllegalOps is true, the Combiner will also legalize the illegal ops that are created...
Definition: CombinerInfo.h:42
Representation of each machine instruction.
Definition: MachineInstr.h:60
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual bool combine(MachineInstr &MI, MachineIRBuilder &B) const =0
IRTranslator LLVM IR MI