9#define DEBUG_TYPE "merge-hmx-activate-weight"
43 <<
"expected activate and weight pair";
67 if (
MI.isDebugInstr() || &
MI == &Moved)
70 if (
MI.isCall() ||
MI.isInlineAsm() ||
MI.isBarrier() ||
71 MI.isTerminator() ||
MI.hasUnmodeledSideEffects() ||
72 MI.hasOrderedMemoryRef() ||
MI.mayStore()) {
78 if (!MO.isReg() || !MO.getReg())
81 if (
MI.modifiesRegister(R,
TRI) ||
82 (MO.isDef() &&
MI.readsRegister(R,
TRI))) {
84 <<
" prevents moving " << Moved <<
" past " <<
MI);
105 F.getContext().diagnose(WeightActivate);
113 bool IsActivate = HII->isHMXActivateInstr(
MI);
114 if (!IsActivate && !HII->isHMXWeightInstr(
MI))
120 if (IsActivate == HII->isHMXActivateInstr(*Pending)) {
133 if (Between != Second) {
134 MBB.splice(Second, &
MBB, Pending);
166 return "Hexagon Merge Activate Weight Instructions After Machine Scheduler";
194 return "Hexagon Merge Activate Weight Instructions Before Packetizer";
210 "hexagon-merge-activate-weight",
211 "Hexagon merge activate weight after machine scheduler",
215 "Hexagon merge activate weight after machine scheduler",
219 "Hexagon merge activate weight before packetizer",
false,
false)
Register const TargetRegisterInfo * TRI
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
const Function & getFunction() const
DiagnosticInfoResourceLimit(const Function &Fn, const Twine &ResourceName LLVM_LIFETIME_BOUND, uint64_t ResourceSize, uint64_t ResourceLimit, DiagnosticSeverity Severity=DS_Warning, DiagnosticKind Kind=DK_ResourceLimit)
The function that is concerned by this stack size diagnostic.
static bool classof(const DiagnosticInfo *DI)
void print(DiagnosticPrinter &DP) const override
DiagnosticInfoWeightActivate(const Function &Fn, unsigned S, DiagnosticSeverity Severity=DS_Warning)
This is the base abstract class for diagnostic reporting in the backend.
Interface for custom diagnostic printing.
FunctionPass class - This class is used to implement most global optimizations.
HexagonMergeActivateWeight2()
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
HexagonMergeActivateWeight()
LLVM_ABI void handleMove(MachineInstr &MI, bool UpdateFlags=false)
Call this method to notify LiveIntervals that instruction MI has been moved within a basic block.
MachineInstrBundleIterator< const MachineInstr > const_iterator
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass(char &ID)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
Wrapper class representing virtual and physical registers.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Represent a constant reference to a string, i.e.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createHexagonMergeActivateWeight()
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
static bool runActivateWeight(MachineFunction &MF, LiveIntervals *LIS)
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
FunctionPass * createHexagonMergeActivateWeight2()
char & HexagonMergeActivateWeightID
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void initializeHexagonMergeActivateWeight2Pass(PassRegistry &)
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
static bool canMoveAcross(const MachineInstr &Moved, MachineBasicBlock::const_iterator Begin, MachineBasicBlock::const_iterator End, const TargetRegisterInfo *TRI)
@ End
Run the machine verifier once, at the end of the pipeline.
void initializeHexagonMergeActivateWeightPass(PassRegistry &)
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.