12 #define DEBUG_TYPE "gather-packetize" 23 cl::desc(
"Generate gather packets before packetization"));
40 return "Hexagon Gather Packetize Code";
49 if (MO.isReg() && MO.isDef() && MO.isImplicit() &&
50 (MO.getReg() == Hexagon::VTMP)) {
61 bool HexagonGatherPacketize::runOnMachineFunction(
MachineFunction &Fn) {
65 bool HasV65 =
ST.hasV65Ops();
66 bool UseHVX =
ST.useHVXOps();
67 if (!(HasV65 & UseHVX))
70 for (
auto &MBB : Fn) {
73 for (MII = MBB.begin(), MIE = MBB.end(); MII != MIE; ++MII) {
78 MBB.splice(std::next(DefMII), &MBB, MII);
80 std::next(MII).getInstrIterator());
89 assert(!VtmpDef &&
"VTMP producer and consumer not in same block");
100 "Hexagon gather packetize Code",
false,
false)
103 return new HexagonGatherPacketize();
static bool isReg(const MCInst &MI, unsigned OpNo)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Compute iterated dominance frontiers using a linear time algorithm.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
iterator_range< mop_iterator > operands()
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
instr_iterator getInstrIterator() const
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
initializer< Ty > init(const Ty &Val)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
INITIALIZE_PASS(HexagonGatherPacketize, "hexagon-gather-packetize", "Hexagon gather packetize Code", false, false) FunctionPass *llvm
FunctionPass class - This class is used to implement most global optimizations.
MachineOperand class - Representation of each machine instruction operand.
FunctionPass * createHexagonGatherPacketize()
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
Representation of each machine instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
cl::opt< bool > EnableGatherPacketize("hexagon-enable-gather-packetize", cl::Hidden, cl::init(true), cl::desc("Generate gather packets before packetization"))
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
void initializeHexagonGatherPacketizePass(PassRegistry &)
const MachineOperand & getOperand(unsigned i) const
void finalizeBundle(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
finalizeBundle - Finalize a machine instruction bundle which includes a sequence of instructions star...