15 #define DEBUG_TYPE "hexagon-shuffle"
29 cl::desc(
"Disable Hexagon instruction shuffling"));
31 void HexagonMCShuffler::init(
MCInst &MCB) {
33 MCInst const *Extender =
nullptr;
52 void HexagonMCShuffler::init(
MCInst &MCB,
MCInst const &AddMI,
53 bool bInsertAtFront) {
57 MCInst const *Extender =
nullptr;
83 MCInst const &MI =
I->getDesc();
84 MCInst const *Extender =
I->getExtender();
117 DEBUG(
dbgs() <<
"Skipping empty bundle");
120 DEBUG(
dbgs() <<
"Skipping stand-alone insn");
142 DEBUG(
dbgs() <<
"Skipping empty bundle");
145 DEBUG(
dbgs() <<
"Skipping stand-alone insn");
149 bool doneShuffling =
false;
150 while (possibleDuplexes.
size() > 0 && (!doneShuffling)) {
156 if (MCS.
size() == 1) {
168 if (doneShuffling ==
false) {
180 MCInst const &AddMI,
int fixupCount) {
190 if (fixupCount >= 2) {
212 if (bhasDuplex && bundleSize >= maxBundleSize)
void replaceDuplex(MCContext &Context, MCInst &MCI, DuplexCandidate Candidate)
void append(MCInst const &ID, MCInst const *Extender, unsigned S)
bool isBundle(MCInst const &MCI)
bool isImmext(MCInst const &MCI)
bool reshuffleTo(MCInst &MCB)
#define HEXAGON_PACKET_SIZE
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &MCI)
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.
bool hasDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
HexagonPacket::iterator iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD T pop_back_val()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &)
unsigned getOpcode() const
static MCOperand createInst(const MCInst *Val)
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
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"))
bool hasImmExt(MCInst const &MCI)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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)
const MCOperand & getOperand(unsigned i) const