LLVM  15.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  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 
51 private:
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.
58 bool HexagonMCShuffle(MCContext &Context, bool ReportErrors,
59  MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
60  MCInst &MCB);
61 bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
62  MCSubtargetInfo const &STI, MCInst &MCB,
63  MCInst const &AddMI, int fixupCount);
64 bool 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
llvm::HexagonShuffler::MCII
const MCInstrInfo & MCII
Definition: HexagonShuffler.h:164
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:74
llvm::HexagonMCShuffler::HexagonMCShuffler
HexagonMCShuffler(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB, MCInst const &AddMI, bool InsertAtFront)
Definition: HexagonMCShuffler.h:38
HexagonShuffler.h
llvm::HexagonMCShuffle
bool HexagonMCShuffle(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
Definition: HexagonMCShuffler.cpp:103
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:132
llvm::HexagonShuffler::Context
MCContext & Context
Definition: HexagonShuffler.h:162
llvm::HexagonMCShuffler::HexagonMCShuffler
HexagonMCShuffler(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
Definition: HexagonMCShuffler.h:31
llvm::HexagonShuffler::STI
const MCSubtargetInfo & STI
Definition: HexagonShuffler.h:165
llvm::HexagonMCShuffler::reshuffleTo
bool reshuffleTo(MCInst &MCB)
Definition: HexagonMCShuffler.cpp:93
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
llvm::HexagonShuffler::ReportErrors
bool ReportErrors
Definition: HexagonShuffler.h:167
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:76