LLVM  14.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 
19 #include "llvm/ADT/SmallVector.h"
20 
21 namespace llvm {
22 
23 class MCContext;
24 class MCInst;
25 class MCInstrInfo;
26 class MCSubtargetInfo;
27 
28 // Insn bundle shuffler.
30 public:
32  MCSubtargetInfo const &STI, MCInst &MCB)
33  : HexagonShuffler(Context, Fatal, MCII, STI) {
34  init(MCB);
35  }
36 
38  MCSubtargetInfo const &STI, MCInst &MCB,
39  MCInst const &AddMI, bool InsertAtFront)
40  : HexagonShuffler(Context, Fatal, MCII, STI) {
41  init(MCB, AddMI, InsertAtFront);
42  }
43 
44  // Copy reordered bundle to another.
45  void copyTo(MCInst &MCB);
46 
47  // Reorder and copy result to another.
48  bool reshuffleTo(MCInst &MCB);
49 
50 private:
51  void init(MCInst &MCB);
52  void init(MCInst &MCB, MCInst const &AddMI, bool InsertAtFront);
53 };
54 
55 // Invocation of the shuffler.
56 bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII,
57  MCSubtargetInfo const &STI, MCInst &MCB);
58 bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
59  MCSubtargetInfo const &STI, MCInst &MCB,
60  MCInst const &AddMI, int fixupCount);
61 bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
62  MCSubtargetInfo const &STI, MCInst &MCB,
63  SmallVector<DuplexCandidate, 8> possibleDuplexes);
64 
65 } // end namespace llvm
66 
67 #endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
llvm::HexagonShuffler::MCII
const MCInstrInfo & MCII
Definition: HexagonShuffler.h:174
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
llvm::HexagonMCShuffler::HexagonMCShuffler
HexagonMCShuffler(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
Definition: HexagonMCShuffler.h:31
HexagonShuffler.h
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::HexagonMCShuffler
Definition: HexagonMCShuffler.h:29
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
HexagonMCInstrInfo.h
llvm::HexagonShuffler
Definition: HexagonShuffler.h:142
llvm::HexagonShuffler::Context
MCContext & Context
Definition: HexagonShuffler.h:172
llvm::HexagonMCShuffle
bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
Definition: HexagonMCShuffler.cpp:104
llvm::HexagonShuffler::STI
const MCSubtargetInfo & STI
Definition: HexagonShuffler.h:175
llvm::HexagonMCShuffler::reshuffleTo
bool reshuffleTo(MCInst &MCB)
Definition: HexagonMCShuffler.cpp:94
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::HexagonMCShuffler::HexagonMCShuffler
HexagonMCShuffler(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB, MCInst const &AddMI, bool InsertAtFront)
Definition: HexagonMCShuffler.h:37
SmallVector.h
llvm::HexagonMCShuffler::copyTo
void copyTo(MCInst &MCB)
Definition: HexagonMCShuffler.cpp:79
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75