LLVM 20.0.0git
HexagonMCShuffler.h
Go to the documentation of this file.
1//===- HexagonMCShuffler.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 declares the shuffling of insns inside a bundle according to the
10// packet formation rules of the Hexagon ISA.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
15#define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
16
20
21namespace llvm {
22
23class MCContext;
24class MCInst;
25class MCInstrInfo;
26class MCSubtargetInfo;
27
28// Insn bundle shuffler.
30public:
32 MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
33 MCInst &MCB)
35 init(MCB);
36 }
37
39 MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
40 MCInst &MCB, MCInst const &AddMI, bool InsertAtFront)
42 init(MCB, AddMI, InsertAtFront);
43 }
44
45 // Copy reordered bundle to another.
46 void copyTo(MCInst &MCB);
47
48 // Reorder and copy result to another.
49 bool reshuffleTo(MCInst &MCB);
50
51private:
52 void init(MCInst &MCB);
53 void init(MCInst &MCB, MCInst const &AddMI, bool InsertAtFront);
54};
55
56// Invocation of the shuffler. Returns true if the shuffle succeeded. If
57// true, MCB will contain the newly-shuffled packet.
58bool HexagonMCShuffle(MCContext &Context, bool ReportErrors,
59 MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
60 MCInst &MCB);
61bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
62 MCSubtargetInfo const &STI, MCInst &MCB,
63 MCInst const &AddMI, int fixupCount);
64bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
65 MCSubtargetInfo const &STI, MCInst &MCB,
66 SmallVector<DuplexCandidate, 8> possibleDuplexes);
67
68} // end namespace llvm
69
70#endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
This file defines the SmallVector class.
HexagonMCShuffler(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB, MCInst const &AddMI, bool InsertAtFront)
bool reshuffleTo(MCInst &MCB)
HexagonMCShuffler(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
MCSubtargetInfo const & STI
MCInstrInfo const & MCII
Context object for machine code objects.
Definition: MCContext.h:83
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:185
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
Generic base class for all target subtargets.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool HexagonMCShuffle(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)