llvm.org GIT mirror llvm / e0d5233
[Packetizer] Add AliasAnalysis as a parameter to the packetizer This will make the depedence graph more accurate if an alias analysis is provided. If nullptr is specified in its place, the behavior will remain as it is currently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255540 91177308-0d34-0410-b5e6-96231b3b80d8 Krzysztof Parzyszek 4 years ago
4 changed file(s) with 18 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
127127 protected:
128128 MachineFunction &MF;
129129 const TargetInstrInfo *TII;
130 AliasAnalysis *AA;
130131
131132 // The VLIW Scheduler.
132133 DefaultVLIWScheduler *VLIWScheduler;
140141 std::map MIToSUnit;
141142
142143 public:
143 VLIWPacketizerList(MachineFunction &MF, MachineLoopInfo &MLI);
144 // The AliasAnalysis parameter can be nullptr.
145 VLIWPacketizerList(MachineFunction &MF, MachineLoopInfo &MLI,
146 AliasAnalysis *AA);
144147
145148 virtual ~VLIWPacketizerList();
146149
148148 // DefaultVLIWScheduler - This class extends ScheduleDAGInstrs and overrides
149149 // Schedule method to build the dependence graph.
150150 class DefaultVLIWScheduler : public ScheduleDAGInstrs {
151 private:
152 AliasAnalysis *AA;
151153 public:
152 DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI);
154 DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI,
155 AliasAnalysis *AA);
153156 // Schedule - Actual scheduling work.
154157 void schedule() override;
155158 };
156159 }
157160
158161 DefaultVLIWScheduler::DefaultVLIWScheduler(MachineFunction &MF,
159 MachineLoopInfo &MLI)
160 : ScheduleDAGInstrs(MF, &MLI) {
162 MachineLoopInfo &MLI,
163 AliasAnalysis *AA)
164 : ScheduleDAGInstrs(MF, &MLI), AA(AA) {
161165 CanHandleTerminators = true;
162166 }
163167
164168 void DefaultVLIWScheduler::schedule() {
165169 // Build the scheduling graph.
166 buildSchedGraph(nullptr);
170 buildSchedGraph(AA);
167171 }
168172
169173 // VLIWPacketizerList Ctor
170174 VLIWPacketizerList::VLIWPacketizerList(MachineFunction &MF,
171 MachineLoopInfo &MLI)
172 : MF(MF) {
175 MachineLoopInfo &MLI, AliasAnalysis *AA)
176 : MF(MF), AA(AA) {
173177 TII = MF.getSubtarget().getInstrInfo();
174178 ResourceTracker = TII->CreateTargetScheduleState(MF.getSubtarget());
175 VLIWScheduler = new DefaultVLIWScheduler(MF, MLI);
179 VLIWScheduler = new DefaultVLIWScheduler(MF, MLI, AA);
176180 }
177181
178182 // VLIWPacketizerList Dtor
148148 public:
149149 // Ctor.
150150 R600PacketizerList(MachineFunction &MF, MachineLoopInfo &MLI)
151 : VLIWPacketizerList(MF, MLI), TII(static_cast(
151 : VLIWPacketizerList(MF, MLI, nullptr),
152 TII(static_cast(
152153 MF.getSubtarget().getInstrInfo())),
153154 TRI(TII->getRegisterInfo()) {
154155 VLIW5 = !MF.getSubtarget().hasCaymanISA();
185185 HexagonPacketizerList::HexagonPacketizerList(
186186 MachineFunction &MF, MachineLoopInfo &MLI,
187187 const MachineBranchProbabilityInfo *MBPI)
188 : VLIWPacketizerList(MF, MLI) {
188 : VLIWPacketizerList(MF, MLI, nullptr) {
189189 this->MBPI = MBPI;
190190 }
191191