25#define DEBUG_TYPE "hexagon-shuffle"
31 cl::desc(
"Disable Hexagon instruction shuffling"));
33void HexagonMCShuffler::init(
MCInst &MCB) {
35 MCInst const *Extender =
nullptr;
55void HexagonMCShuffler::init(
MCInst &MCB,
MCInst const &AddMI,
56 bool bInsertAtFront) {
60 MCInst const *Extender =
nullptr;
84 for (
auto &
I : *
this) {
86 MCInst const *Extender =
I.getExtender();
152 bool doneShuffling =
false;
153 while (possibleDuplexes.
size() > 0 && (!doneShuffling)) {
159 if (MCS.
size() == 1) {
171 if (!doneShuffling) {
176 return doneShuffling;
181 MCInst const &AddMI,
int fixupCount) {
191 if (fixupCount >= 2) {
213 if (bhasDuplex && bundleSize >= maxBundleSize)
static cl::opt< bool > DisableShuffle("disable-hexagon-shuffle", cl::Hidden, cl::init(false), cl::desc("Disable Hexagon instruction shuffling"))
#define HEXAGON_PACKET_SIZE
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool reshuffleTo(MCInst &MCB)
MCSubtargetInfo const & STI
void append(MCInst const &ID, MCInst const *Extender, unsigned S)
Context object for machine code objects.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
const MCOperand & getOperand(unsigned i) const
bool isPseudo() const
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction.
Interface to description of machine instruction set.
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
static MCOperand createImm(int64_t Val)
static MCOperand createInst(const MCInst *Val)
Generic base class for all target subtargets.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
size_t bundleSize(MCInst const &MCI)
MCInstrDesc const & getDesc(MCInstrInfo const &MCII, MCInst const &MCI)
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &MCI)
bool isBundle(MCInst const &MCI)
bool hasDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned getUnits(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the slots used by the insn.
bool isImmext(MCInst const &MCI)
bool hasImmExt(MCInst const &MCI)
void replaceDuplex(MCContext &Context, MCInst &MCI, DuplexCandidate Candidate)
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
bool HexagonMCShuffle(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.