LLVM 19.0.0git
CombinerInfo.h
Go to the documentation of this file.
1//===- llvm/CodeGen/GlobalISel/CombinerInfo.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/// \file
9/// Option class for Targets to specify which operations are combined how and
10/// when.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_GLOBALISEL_COMBINERINFO_H
15#define LLVM_CODEGEN_GLOBALISEL_COMBINERINFO_H
16
17#include <cassert>
18namespace llvm {
19
20class LegalizerInfo;
21
22// Contains information relevant to enabling/disabling various combines for a
23// pass.
25 CombinerInfo(bool AllowIllegalOps, bool ShouldLegalizeIllegal,
26 const LegalizerInfo *LInfo, bool OptEnabled, bool OptSize,
27 bool MinSize)
28 : IllegalOpsAllowed(AllowIllegalOps),
29 LegalizeIllegalOps(ShouldLegalizeIllegal), LInfo(LInfo),
30 EnableOpt(OptEnabled), EnableOptSize(OptSize), EnableMinSize(MinSize) {
31 assert(((AllowIllegalOps || !LegalizeIllegalOps) || LInfo) &&
32 "Expecting legalizerInfo when illegalops not allowed");
33 }
34 virtual ~CombinerInfo() = default;
35 /// If \p IllegalOpsAllowed is false, the CombinerHelper will make use of
36 /// the legalizerInfo to check for legality before each transformation.
37 bool IllegalOpsAllowed; // TODO: Make use of this.
38
39 /// If \p LegalizeIllegalOps is true, the Combiner will also legalize the
40 /// illegal ops that are created.
41 bool LegalizeIllegalOps; // TODO: Make use of this.
43
44 /// Whether optimizations should be enabled. This is to distinguish between
45 /// uses of the combiner unconditionally and only when optimizations are
46 /// specifically enabled/
48 /// Whether we're optimizing for size.
50 /// Whether we're optimizing for minsize (-Oz).
52};
53} // namespace llvm
54
55#endif
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool EnableMinSize
Whether we're optimizing for minsize (-Oz).
Definition: CombinerInfo.h:51
CombinerInfo(bool AllowIllegalOps, bool ShouldLegalizeIllegal, const LegalizerInfo *LInfo, bool OptEnabled, bool OptSize, bool MinSize)
Definition: CombinerInfo.h:25
const LegalizerInfo * LInfo
Definition: CombinerInfo.h:42
bool LegalizeIllegalOps
If LegalizeIllegalOps is true, the Combiner will also legalize the illegal ops that are created.
Definition: CombinerInfo.h:41
bool IllegalOpsAllowed
If IllegalOpsAllowed is false, the CombinerHelper will make use of the legalizerInfo to check for leg...
Definition: CombinerInfo.h:37
virtual ~CombinerInfo()=default
bool EnableOptSize
Whether we're optimizing for size.
Definition: CombinerInfo.h:49
bool EnableOpt
Whether optimizations should be enabled.
Definition: CombinerInfo.h:47