15 #define DEBUG_TYPE "hexagon-shuffle"
29 cl::desc(
"Disable Hexagon instruction shuffling"));
31 void HexagonMCShuffler::init(
MCInst &MCB) {
33 MCInst const *Extender =
nullptr;
51 void HexagonMCShuffler::init(
MCInst &MCB,
MCInst const *AddMI,
52 bool bInsertAtFront) {
54 if (bInsertAtFront && AddMI)
57 MCInst const *Extender =
nullptr;
69 if (!bInsertAtFront && AddMI)
83 MCInst const *MI =
I->getDesc();
84 MCInst const *Extender =
I->getExtender();
116 DEBUG(
dbgs() <<
"Skipping empty bundle");
119 DEBUG(
dbgs() <<
"Skipping stand-alone insn");
126 unsigned shuffleError = MCS.
getError();
127 switch (shuffleError) {
165 DEBUG(
dbgs() <<
"Skipping empty bundle");
168 DEBUG(
dbgs() <<
"Skipping stand-alone insn");
172 bool doneShuffling =
false;
173 unsigned shuffleError;
174 while (possibleDuplexes.
size() > 0 && (!doneShuffling)) {
180 if (MCS.
size() == 1) {
183 doneShuffling =
true;
194 if (doneShuffling ==
false) {
215 if (fixupCount >= 2) {
227 unsigned shuffleError = MCS.
getError();
228 switch (shuffleError) {
unsigned getError() const
bool isBundle(MCInst const &MCI)
No free slots for store insns.
bool isImmext(MCInst const &MCI)
bool reshuffleTo(MCInst &MCB)
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
#define HEXAGON_PACKET_SIZE
void replaceDuplex(MCContext &Context, MCInst &MCB, DuplexCandidate Candidate)
Context object for machine code objects.
Instances of this class represent a single low-level machine instruction.
initializer< Ty > init(const Ty &Val)
MCSubtargetInfo const & STI
Interface to description of machine instruction set.
iterator_range< MCInst::const_iterator > bundleInstructions(MCInst const &MCI)
void append(MCInst const *ID, MCInst const *Extender, unsigned S, bool X=false)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool HexagonMCShuffle(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &)
No free slots for branch insns.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
No free slots for load insns.
static MCOperand createInst(const MCInst *Val)
MCSubtargetInfo - Generic base class for all target subtargets.
MCInstrDesc const & getDesc(MCInstrInfo const &MCII, MCInst const &MCI)
size_t bundleSize(MCInst const &MCI)
static cl::opt< bool > DisableShuffle("disable-hexagon-shuffle", cl::Hidden, cl::init(false), cl::desc("Disable Hexagon instruction shuffling"))
unsigned getUnits(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the slots used by the insn.
void addOperand(const MCOperand &Op)
static MCOperand createImm(int64_t Val)
No free slots for other insns.
const MCOperand & getOperand(unsigned i) const