OLD | NEW |
1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- C++ -*-===// | 1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 /// instructions from the Cfg, to speed up later passes over the instructions. | 195 /// instructions from the Cfg, to speed up later passes over the instructions. |
196 void renumberInstructions(); | 196 void renumberInstructions(); |
197 void placePhiLoads(); | 197 void placePhiLoads(); |
198 void placePhiStores(); | 198 void placePhiStores(); |
199 void deletePhis(); | 199 void deletePhis(); |
200 void advancedPhiLowering(); | 200 void advancedPhiLowering(); |
201 void reorderNodes(); | 201 void reorderNodes(); |
202 void shuffleNodes(); | 202 void shuffleNodes(); |
203 void localCSE(); | 203 void localCSE(); |
204 void shortCircuitJumps(); | 204 void shortCircuitJumps(); |
| 205 void loopInvariantCodeMotion(); |
205 | 206 |
206 /// Scan allocas to determine whether we need to use a frame pointer. | 207 /// Scan allocas to determine whether we need to use a frame pointer. |
207 /// If SortAndCombine == true, merge all the fixed-size allocas in the | 208 /// If SortAndCombine == true, merge all the fixed-size allocas in the |
208 /// entry block and emit stack or frame pointer-relative addressing. | 209 /// entry block and emit stack or frame pointer-relative addressing. |
209 void processAllocas(bool SortAndCombine); | 210 void processAllocas(bool SortAndCombine); |
210 void doAddressOpt(); | 211 void doAddressOpt(); |
211 /// Find clusters of insertelement/extractelement instructions that can be | 212 /// Find clusters of insertelement/extractelement instructions that can be |
212 /// replaced by a shufflevector instruction. | 213 /// replaced by a shufflevector instruction. |
213 void materializeVectorShuffles(); | 214 void materializeVectorShuffles(); |
214 void doArgLowering(); | 215 void doArgLowering(); |
215 void doNopInsertion(); | 216 void doNopInsertion(); |
216 void genCode(); | 217 void genCode(); |
217 void genFrame(); | 218 void genFrame(); |
218 void computeLoopNestDepth(); | 219 void generateLoopInfo(); |
219 void livenessLightweight(); | 220 void livenessLightweight(); |
220 void liveness(LivenessMode Mode); | 221 void liveness(LivenessMode Mode); |
221 bool validateLiveness() const; | 222 bool validateLiveness() const; |
222 void contractEmptyNodes(); | 223 void contractEmptyNodes(); |
223 void doBranchOpt(); | 224 void doBranchOpt(); |
224 void markNodesForSandboxing(); | 225 void markNodesForSandboxing(); |
225 | 226 |
226 /// \name Manage the CurrentNode field. | 227 /// \name Manage the CurrentNode field. |
227 /// CurrentNode is used for validating the Variable::DefNode field during | 228 /// CurrentNode is used for validating the Variable::DefNode field during |
228 /// dumping/emitting. | 229 /// dumping/emitting. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // of the uniqueness requirement, and assumptions in lit tests. | 324 // of the uniqueness requirement, and assumptions in lit tests. |
324 std::unique_ptr<StringPool> NodeStrings; | 325 std::unique_ptr<StringPool> NodeStrings; |
325 std::unique_ptr<StringPool> VarStrings; | 326 std::unique_ptr<StringPool> VarStrings; |
326 std::unique_ptr<Liveness> Live; | 327 std::unique_ptr<Liveness> Live; |
327 std::unique_ptr<TargetLowering> Target; | 328 std::unique_ptr<TargetLowering> Target; |
328 std::unique_ptr<VariablesMetadata> VMetadata; | 329 std::unique_ptr<VariablesMetadata> VMetadata; |
329 std::unique_ptr<Assembler> TargetAssembler; | 330 std::unique_ptr<Assembler> TargetAssembler; |
330 /// Globals required by this CFG. Mostly used for the profiler's globals. | 331 /// Globals required by this CFG. Mostly used for the profiler's globals. |
331 std::unique_ptr<VariableDeclarationList> GlobalInits; | 332 std::unique_ptr<VariableDeclarationList> GlobalInits; |
332 CfgVector<InstJumpTable *> JumpTables; | 333 CfgVector<InstJumpTable *> JumpTables; |
333 | 334 CfgUnorderedMap<SizeT, CfgVector<SizeT>> LoopInfo; |
334 /// CurrentNode is maintained during dumping/emitting just for validating | 335 /// CurrentNode is maintained during dumping/emitting just for validating |
335 /// Variable::DefNode. Normally, a traversal over CfgNodes maintains this, but | 336 /// Variable::DefNode. Normally, a traversal over CfgNodes maintains this, but |
336 /// before global operations like register allocation, resetCurrentNode() | 337 /// before global operations like register allocation, resetCurrentNode() |
337 /// should be called to avoid spurious validation failures. | 338 /// should be called to avoid spurious validation failures. |
338 const CfgNode *CurrentNode = nullptr; | 339 const CfgNode *CurrentNode = nullptr; |
339 | 340 |
340 public: | 341 public: |
341 static void TlsInit() { CfgAllocatorTraits::init(); } | 342 static void TlsInit() { CfgAllocatorTraits::init(); } |
342 }; | 343 }; |
343 | 344 |
(...skipping 11 matching lines...) Expand all Loading... |
355 using OwnerType = Cfg; | 356 using OwnerType = Cfg; |
356 static StringPool *getStrings(const OwnerType *PoolOwner) { | 357 static StringPool *getStrings(const OwnerType *PoolOwner) { |
357 return PoolOwner->getVarStrings(); | 358 return PoolOwner->getVarStrings(); |
358 } | 359 } |
359 }; | 360 }; |
360 using VariableString = StringID<VariableStringPoolTraits>; | 361 using VariableString = StringID<VariableStringPoolTraits>; |
361 | 362 |
362 } // end of namespace Ice | 363 } // end of namespace Ice |
363 | 364 |
364 #endif // SUBZERO_SRC_ICECFG_H | 365 #endif // SUBZERO_SRC_ICECFG_H |
OLD | NEW |