OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
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 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 Func->advancedPhiLowering(); | 385 Func->advancedPhiLowering(); |
386 Func->dump("After advanced Phi lowering"); | 386 Func->dump("After advanced Phi lowering"); |
387 } | 387 } |
388 | 388 |
389 // Stack frame mapping. | 389 // Stack frame mapping. |
390 Func->genFrame(); | 390 Func->genFrame(); |
391 if (Func->hasError()) | 391 if (Func->hasError()) |
392 return; | 392 return; |
393 Func->dump("After stack frame mapping"); | 393 Func->dump("After stack frame mapping"); |
394 | 394 |
395 Func->deleteRedundantAssignments(); | |
396 Func->contractEmptyNodes(); | 395 Func->contractEmptyNodes(); |
397 Func->reorderNodes(); | 396 Func->reorderNodes(); |
398 | 397 |
399 // Branch optimization. This needs to be done just before code | 398 // Branch optimization. This needs to be done just before code |
400 // emission. In particular, no transformations that insert or | 399 // emission. In particular, no transformations that insert or |
401 // reorder CfgNodes should be done after branch optimization. We go | 400 // reorder CfgNodes should be done after branch optimization. We go |
402 // ahead and do it before nop insertion to reduce the amount of work | 401 // ahead and do it before nop insertion to reduce the amount of work |
403 // needed for searching for opportunities. | 402 // needed for searching for opportunities. |
404 Func->doBranchOpt(); | 403 Func->doBranchOpt(); |
405 Func->dump("After branch optimization"); | 404 Func->dump("After branch optimization"); |
(...skipping 22 matching lines...) Expand all Loading... |
428 Func->genCode(); | 427 Func->genCode(); |
429 if (Func->hasError()) | 428 if (Func->hasError()) |
430 return; | 429 return; |
431 Func->dump("After initial x8632 codegen"); | 430 Func->dump("After initial x8632 codegen"); |
432 | 431 |
433 Func->genFrame(); | 432 Func->genFrame(); |
434 if (Func->hasError()) | 433 if (Func->hasError()) |
435 return; | 434 return; |
436 Func->dump("After stack frame mapping"); | 435 Func->dump("After stack frame mapping"); |
437 | 436 |
438 Func->deleteRedundantAssignments(); | |
439 | |
440 // Nop insertion | 437 // Nop insertion |
441 if (shouldDoNopInsertion()) { | 438 if (shouldDoNopInsertion()) { |
442 Func->doNopInsertion(); | 439 Func->doNopInsertion(); |
443 } | 440 } |
444 } | 441 } |
445 | 442 |
446 bool TargetX8632::doBranchOpt(Inst *I, const CfgNode *NextNode) { | 443 bool TargetX8632::doBranchOpt(Inst *I, const CfgNode *NextNode) { |
447 if (InstX8632Br *Br = llvm::dyn_cast<InstX8632Br>(I)) { | 444 if (InstX8632Br *Br = llvm::dyn_cast<InstX8632Br>(I)) { |
448 return Br->optimizeBranch(NextNode); | 445 return Br->optimizeBranch(NextNode); |
449 } | 446 } |
(...skipping 4261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4711 } else if (IsConstant || IsExternal) | 4708 } else if (IsConstant || IsExternal) |
4712 Str << "\t.zero\t" << Size << "\n"; | 4709 Str << "\t.zero\t" << Size << "\n"; |
4713 // Size is part of .comm. | 4710 // Size is part of .comm. |
4714 | 4711 |
4715 if (IsConstant || HasNonzeroInitializer || IsExternal) | 4712 if (IsConstant || HasNonzeroInitializer || IsExternal) |
4716 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 4713 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
4717 // Size is part of .comm. | 4714 // Size is part of .comm. |
4718 } | 4715 } |
4719 | 4716 |
4720 } // end of namespace Ice | 4717 } // end of namespace Ice |
OLD | NEW |