LLVM  10.0.0svn
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
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool reshuffleTo(MCInst &MCB)
Context object for machine code objects.
Definition: MCContext.h:65
bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:158
MCSubtargetInfo const & STI
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:23
HexagonMCShuffler(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
MCInstrInfo const & MCII
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:837
Generic base class for all target subtargets.
HexagonMCShuffler(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB, MCInst const &AddMI, bool InsertAtFront)