OLD | NEW |
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// | 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// |
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 CfgNode class, including the complexities | 10 // This file implements the CfgNode class, including the complexities |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 for (InstPhi *Phi : Phis) { | 499 for (InstPhi *Phi : Phis) { |
500 if (Phi->isDeleted()) | 500 if (Phi->isDeleted()) |
501 continue; | 501 continue; |
502 // Emitting a Phi instruction should cause an error. | 502 // Emitting a Phi instruction should cause an error. |
503 Inst *Instr = Phi; | 503 Inst *Instr = Phi; |
504 Instr->emit(Func); | 504 Instr->emit(Func); |
505 } | 505 } |
506 for (Inst *I : Insts) { | 506 for (Inst *I : Insts) { |
507 if (I->isDeleted()) | 507 if (I->isDeleted()) |
508 continue; | 508 continue; |
509 // Here we detect redundant assignments like "mov eax, eax" and | |
510 // suppress them. | |
511 if (I->isRedundantAssign()) | |
512 continue; | |
513 if (Func->useIntegratedAssembler()) { | 509 if (Func->useIntegratedAssembler()) { |
514 I->emitIAS(Func); | 510 I->emitIAS(Func); |
515 } else { | 511 } else { |
516 I->emit(Func); | 512 I->emit(Func); |
517 } | 513 } |
518 // Update emitted instruction count, plus fill/spill count for | 514 // Update emitted instruction count, plus fill/spill count for |
519 // Variable operands without a physical register. | 515 // Variable operands without a physical register. |
520 if (uint32_t Count = I->getEmitInstCount()) { | 516 if (uint32_t Count = I->getEmitInstCount()) { |
521 Func->getContext()->statsUpdateEmitted(Count); | 517 Func->getContext()->statsUpdateEmitted(Count); |
522 if (Variable *Dest = I->getDest()) { | 518 if (Variable *Dest = I->getDest()) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 if (!First) | 599 if (!First) |
604 Str << ", "; | 600 Str << ", "; |
605 First = false; | 601 First = false; |
606 Str << "%" << I->getName(); | 602 Str << "%" << I->getName(); |
607 } | 603 } |
608 Str << "\n"; | 604 Str << "\n"; |
609 } | 605 } |
610 } | 606 } |
611 | 607 |
612 } // end of namespace Ice | 608 } // end of namespace Ice |
OLD | NEW |