LLVM 23.0.0git
GCNVOPDUtils.h
Go to the documentation of this file.
1//===- GCNVOPDUtils.h - GCN VOPD Utils ------------------------===//
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 contains the AMDGPU DAG scheduling
10/// mutation to pair VOPD instructions back to back. It also contains
11// subroutines useful in the creation of VOPD instructions
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_AMDGPU_VOPDUTILS_H
16#define LLVM_LIB_TARGET_AMDGPU_VOPDUTILS_H
17
19#include <optional>
20
21namespace llvm {
22
23class MachineInstr;
24class SIInstrInfo;
25
27 const MachineInstr &FirstMI,
28 const MachineInstr &SecondMI, bool IsVOPD3,
29 bool AllowSameVGPR);
30
31/// Describes a matched VOPD pair: which instruction is the X component and
32/// which is the Y component, and whether this is a VOPD3 encoding.
38
39/// Check whether FirstMI and SecondMI can be
40/// combined into a VOPD instruction. Returns the match info (X/Y assignment
41/// and encoding variant) on success, or std::nullopt if they cannot be paired.
42std::optional<VOPDMatchInfo> tryMatchVOPDPair(const SIInstrInfo &TII,
43 MachineInstr &FirstMI,
44 MachineInstr &SecondMI);
45
46std::unique_ptr<ScheduleDAGMutation> createVOPDPairingMutation();
47
48} // namespace llvm
49
50#endif // LLVM_LIB_TARGET_AMDGPU_VOPDUTILS_H
const HexagonInstrInfo * TII
Representation of each machine instruction.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< ScheduleDAGMutation > createVOPDPairingMutation()
bool checkVOPDRegConstraints(const SIInstrInfo &TII, const MachineInstr &FirstMI, const MachineInstr &SecondMI, bool IsVOPD3, bool AllowSameVGPR)
std::optional< VOPDMatchInfo > tryMatchVOPDPair(const SIInstrInfo &TII, MachineInstr &FirstMI, MachineInstr &SecondMI)
Check whether FirstMI and SecondMI can be combined into a VOPD instruction.
Describes a matched VOPD pair: which instruction is the X component and which is the Y component,...
MachineInstr * MIX
MachineInstr * MIY