LLVM 22.0.0git
InstructionSelector.h
Go to the documentation of this file.
1//===- llvm/CodeGen/GlobalISel/InstructionSelector.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/// \file This file declares the API for the instruction selector.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
14#define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
15
18
19namespace llvm {
20class GISelObserverWrapper;
21
23public:
25
26 /// Select the (possibly generic) instruction \p I to only use target-specific
27 /// opcodes. It is OK to insert multiple instructions, but they cannot be
28 /// generic pre-isel instructions.
29 ///
30 /// \returns whether selection succeeded.
31 /// \pre I.getParent() && I.getParent()->getParent()
32 /// \post
33 /// if returns true:
34 /// for I in all mutated/inserted instructions:
35 /// !isPreISelGenericOpcode(I.getOpcode())
36 virtual bool select(MachineInstr &I) = 0;
37
38 // FIXME: Eliminate dependency on TargetPassConfig for NewPM transition
39 const TargetPassConfig *TPC = nullptr;
40
42
43 /// Note: InstructionSelect does not track changed instructions.
44 /// changingInstr() and changedInstr() will never be called on these
45 /// observers.
46 GISelObserverWrapper *AllObservers = nullptr;
47};
48} // namespace llvm
49
50#endif
#define LLVM_ABI
Definition: Compiler.h:213
#define I(x, y, z)
Definition: MD5.cpp:58
Provides the logic to execute GlobalISel match tables, which are used by the instruction selector and...
Simple wrapper observer that takes several observers, and calls each one for each event.
virtual bool select(MachineInstr &I)=0
Select the (possibly generic) instruction I to only use target-specific opcodes.
Representation of each machine instruction.
Definition: MachineInstr.h:72
Target-Independent Code Generator Pass Configuration Options.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
#define MORE()
Definition: regcomp.c:246