Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// | 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 return; | 320 return; |
| 321 Func->placePhiStores(); | 321 Func->placePhiStores(); |
| 322 if (Func->hasError()) | 322 if (Func->hasError()) |
| 323 return; | 323 return; |
| 324 Func->deletePhis(); | 324 Func->deletePhis(); |
| 325 if (Func->hasError()) | 325 if (Func->hasError()) |
| 326 return; | 326 return; |
| 327 Func->dump("After Phi lowering"); | 327 Func->dump("After Phi lowering"); |
| 328 } | 328 } |
| 329 | 329 |
| 330 // Run this early so it can be used to focus optimizations on potentially hot | |
| 331 // code. | |
|
jvoung (off chromium)
2015/09/01 18:56:18
Some new nodes are created later, but I suppose th
| |
| 332 // TODO: currently only used for regalloc not expensive high level | |
|
Jim Stichnoth
2015/09/01 22:17:38
TODO(ascull,stichnot)
ascull
2015/09/03 19:52:38
Done.
| |
| 333 // optimizations which could be focused on potentially hot code. | |
| 334 Func->computeLoopNestDepth(); | |
| 335 Func->dump("After loop nest depth analysis"); | |
| 336 | |
| 330 // Address mode optimization. | 337 // Address mode optimization. |
| 331 Func->getVMetadata()->init(VMK_SingleDefs); | 338 Func->getVMetadata()->init(VMK_SingleDefs); |
| 332 Func->doAddressOpt(); | 339 Func->doAddressOpt(); |
| 333 | 340 |
| 334 // Find read-modify-write opportunities. Do this after address mode | 341 // Find read-modify-write opportunities. Do this after address mode |
| 335 // optimization so that doAddressOpt() doesn't need to be applied to RMW | 342 // optimization so that doAddressOpt() doesn't need to be applied to RMW |
| 336 // instructions as well. | 343 // instructions as well. |
| 337 findRMW(); | 344 findRMW(); |
| 338 Func->dump("After RMW transform"); | 345 Func->dump("After RMW transform"); |
| 339 | 346 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 360 // Disable constant blinding or pooling for load optimization. | 367 // Disable constant blinding or pooling for load optimization. |
| 361 { | 368 { |
| 362 BoolFlagSaver B(RandomizationPoolingPaused, true); | 369 BoolFlagSaver B(RandomizationPoolingPaused, true); |
| 363 doLoadOpt(); | 370 doLoadOpt(); |
| 364 } | 371 } |
| 365 Func->genCode(); | 372 Func->genCode(); |
| 366 if (Func->hasError()) | 373 if (Func->hasError()) |
| 367 return; | 374 return; |
| 368 Func->dump("After x86 codegen"); | 375 Func->dump("After x86 codegen"); |
| 369 | 376 |
| 370 // Register allocation. This requires instruction renumbering and full | 377 // Register allocation. This requires instruction renumbering and full |
| 371 // liveness analysis. | 378 // liveness analysis. Loops must be identified before livness to variable use |
|
jvoung (off chromium)
2015/09/01 18:56:18
"livness"
something sounds odd about "Loops must
Jim Stichnoth
2015/09/01 22:17:38
I think you mean "so variable use"?
ascull
2015/09/03 19:52:38
Done.
| |
| 379 // weights are correct. | |
| 372 Func->renumberInstructions(); | 380 Func->renumberInstructions(); |
| 373 if (Func->hasError()) | 381 if (Func->hasError()) |
| 374 return; | 382 return; |
| 375 Func->liveness(Liveness_Intervals); | 383 Func->liveness(Liveness_Intervals); |
| 376 if (Func->hasError()) | 384 if (Func->hasError()) |
| 377 return; | 385 return; |
| 378 // Validate the live range computations. The expensive validation call is | 386 // Validate the live range computations. The expensive validation call is |
| 379 // deliberately only made when assertions are enabled. | 387 // deliberately only made when assertions are enabled. |
| 380 assert(Func->validateLiveness()); | 388 assert(Func->validateLiveness()); |
| 381 // The post-codegen dump is done here, after liveness analysis and associated | 389 // The post-codegen dump is done here, after liveness analysis and associated |
| (...skipping 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5364 } | 5372 } |
| 5365 // the offset is not eligible for blinding or pooling, return the original | 5373 // the offset is not eligible for blinding or pooling, return the original |
| 5366 // mem operand | 5374 // mem operand |
| 5367 return MemOperand; | 5375 return MemOperand; |
| 5368 } | 5376 } |
| 5369 | 5377 |
| 5370 } // end of namespace X86Internal | 5378 } // end of namespace X86Internal |
| 5371 } // end of namespace Ice | 5379 } // end of namespace Ice |
| 5372 | 5380 |
| 5373 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 5381 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
| OLD | NEW |