Index: include/llvm/CodeGen/MachineScheduler.h =================================================================== --- include/llvm/CodeGen/MachineScheduler.h +++ include/llvm/CodeGen/MachineScheduler.h @@ -302,6 +302,10 @@ return SchedImpl->doMBBSchedRegionsTopDown(); } + // Returns AliasAnalysis instance for use in Hazard Recognizer. + // The returned AliasAnalysis may be nullptr. + AliasAnalysis* getAA() const { return AA; } + // Returns LiveIntervals instance for use in DAG mutators and such. LiveIntervals *getLIS() const { return LIS; } Index: include/llvm/CodeGen/ScheduleDAGInstrs.h =================================================================== --- include/llvm/CodeGen/ScheduleDAGInstrs.h +++ include/llvm/CodeGen/ScheduleDAGInstrs.h @@ -182,6 +182,10 @@ SUnit *BarrierChain = nullptr; public: + // Returns AliasAnalysis instance for use in Hazard Recognizer. + // The returned AliasAnalysis may be nullptr. + virtual AliasAnalysis* getAA() const { return AAForDep; } + /// A list of SUnits, used in Value2SUsMap, during DAG construction. /// Note: to gain speed it might be worth investigating an optimized /// implementation of this data structure, such as a singly linked list Index: lib/CodeGen/PostRASchedulerList.cpp =================================================================== --- lib/CodeGen/PostRASchedulerList.cpp +++ lib/CodeGen/PostRASchedulerList.cpp @@ -184,6 +184,9 @@ /// void finishBlock() override; + // Returns AliasAnalysis instance for use in Hazard Recognizer. + AliasAnalysis* getAA() const { return AA; } + private: /// Apply each ScheduleDAGMutation step in order. void postprocessDAG();