OLD | NEW |
1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph 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 /// \file | 10 /// \file |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 const bool IsDest = true; | 610 const bool IsDest = true; |
611 if (!Dest->getLiveRange().containsValue(InstNumber, IsDest)) | 611 if (!Dest->getLiveRange().containsValue(InstNumber, IsDest)) |
612 Invalid = true; | 612 Invalid = true; |
613 // Check that this instruction actually *begins* Dest's live range, | 613 // Check that this instruction actually *begins* Dest's live range, |
614 // by checking that Dest is not live in the previous instruction. As | 614 // by checking that Dest is not live in the previous instruction. As |
615 // a special exception, we don't check this for the first instruction | 615 // a special exception, we don't check this for the first instruction |
616 // of the block, because a Phi temporary may be live at the end of | 616 // of the block, because a Phi temporary may be live at the end of |
617 // the previous block, and if it is also assigned in the first | 617 // the previous block, and if it is also assigned in the first |
618 // instruction of this block, the adjacent live ranges get merged. | 618 // instruction of this block, the adjacent live ranges get merged. |
619 if (static_cast<class Inst *>(&Inst) != FirstInst && | 619 if (static_cast<class Inst *>(&Inst) != FirstInst && |
620 !Inst.isDestNonKillable() && | 620 !Inst.isDestRedefined() && |
621 Dest->getLiveRange().containsValue(InstNumber - 1, IsDest)) | 621 Dest->getLiveRange().containsValue(InstNumber - 1, IsDest)) |
622 Invalid = true; | 622 Invalid = true; |
623 if (Invalid) { | 623 if (Invalid) { |
624 Valid = false; | 624 Valid = false; |
625 Str << "Liveness error: inst " << Inst.getNumber() << " dest "; | 625 Str << "Liveness error: inst " << Inst.getNumber() << " dest "; |
626 Dest->dump(this); | 626 Dest->dump(this); |
627 Str << " live range " << Dest->getLiveRange() << "\n"; | 627 Str << " live range " << Dest->getLiveRange() << "\n"; |
628 } | 628 } |
629 } | 629 } |
630 } | 630 } |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 } | 808 } |
809 } | 809 } |
810 // Print each basic block | 810 // Print each basic block |
811 for (CfgNode *Node : Nodes) | 811 for (CfgNode *Node : Nodes) |
812 Node->dump(this); | 812 Node->dump(this); |
813 if (isVerbose(IceV_Instructions)) | 813 if (isVerbose(IceV_Instructions)) |
814 Str << "}\n"; | 814 Str << "}\n"; |
815 } | 815 } |
816 | 816 |
817 } // end of namespace Ice | 817 } // end of namespace Ice |
OLD | NEW |