LLVM  6.0.0svn
HexagonMCShuffler.h
Go to the documentation of this file.
1 //===- HexagonMCShuffler.h --------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This declares the shuffling of insns inside a bundle according to the
11 // packet formation rules of the Hexagon ISA.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
16 #define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
17 
20 #include "llvm/ADT/SmallVector.h"
21 
22 namespace llvm {
23 
24 class MCContext;
25 class MCInst;
26 class MCInstrInfo;
27 class MCSubtargetInfo;
28 
29 // Insn bundle shuffler.
31 public:
33  MCSubtargetInfo const &STI, MCInst &MCB)
34  : HexagonShuffler(Context, Fatal, MCII, STI) {
35  init(MCB);
36  }
37 
39  MCSubtargetInfo const &STI, MCInst &MCB,
40  MCInst const &AddMI, bool InsertAtFront)
41  : HexagonShuffler(Context, Fatal, MCII, STI) {
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.
57 bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII,
58  MCSubtargetInfo const &STI, MCInst &MCB);
59 bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
60  MCSubtargetInfo const &STI, MCInst &MCB,
61  MCInst const &AddMI, int fixupCount);
62 bool HexagonMCShuffle(MCContext &Context, MCInstrInfo const &MCII,
63  MCSubtargetInfo const &STI, MCInst &MCB,
64  SmallVector<DuplexCandidate, 8> possibleDuplexes);
65 
66 } // end namespace llvm
67 
68 #endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCSHUFFLER_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool reshuffleTo(MCInst &MCB)
Context object for machine code objects.
Definition: MCContext.h:59
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:159
MCSubtargetInfo const & STI
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
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:864
MCSubtargetInfo - 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)