| 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 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 bool Invalid = false; | 909 bool Invalid = false; |
| 910 constexpr bool IsDest = true; | 910 constexpr bool IsDest = true; |
| 911 if (!Dest->getLiveRange().containsValue(InstNumber, IsDest)) | 911 if (!Dest->getLiveRange().containsValue(InstNumber, IsDest)) |
| 912 Invalid = true; | 912 Invalid = true; |
| 913 // Check that this instruction actually *begins* Dest's live range, | 913 // Check that this instruction actually *begins* Dest's live range, |
| 914 // by checking that Dest is not live in the previous instruction. As | 914 // by checking that Dest is not live in the previous instruction. As |
| 915 // a special exception, we don't check this for the first instruction | 915 // a special exception, we don't check this for the first instruction |
| 916 // of the block, because a Phi temporary may be live at the end of | 916 // of the block, because a Phi temporary may be live at the end of |
| 917 // the previous block, and if it is also assigned in the first | 917 // the previous block, and if it is also assigned in the first |
| 918 // instruction of this block, the adjacent live ranges get merged. | 918 // instruction of this block, the adjacent live ranges get merged. |
| 919 if (static_cast<class Inst *>(&Instr) != FirstInst && | 919 if (&Instr != FirstInst && !Instr.isDestRedefined() && |
| 920 !Instr.isDestRedefined() && | |
| 921 Dest->getLiveRange().containsValue(InstNumber - 1, IsDest)) | 920 Dest->getLiveRange().containsValue(InstNumber - 1, IsDest)) |
| 922 Invalid = true; | 921 Invalid = true; |
| 923 if (Invalid) { | 922 if (Invalid) { |
| 924 Valid = false; | 923 Valid = false; |
| 925 Str << "Liveness error: inst " << Instr.getNumber() << " dest "; | 924 Str << "Liveness error: inst " << Instr.getNumber() << " dest "; |
| 926 Dest->dump(this); | 925 Dest->dump(this); |
| 927 Str << " live range " << Dest->getLiveRange() << "\n"; | 926 Str << " live range " << Dest->getLiveRange() << "\n"; |
| 928 } | 927 } |
| 929 } | 928 } |
| 930 } | 929 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 } | 1134 } |
| 1136 } | 1135 } |
| 1137 // Print each basic block | 1136 // Print each basic block |
| 1138 for (CfgNode *Node : Nodes) | 1137 for (CfgNode *Node : Nodes) |
| 1139 Node->dump(this); | 1138 Node->dump(this); |
| 1140 if (isVerbose(IceV_Instructions)) | 1139 if (isVerbose(IceV_Instructions)) |
| 1141 Str << "}\n"; | 1140 Str << "}\n"; |
| 1142 } | 1141 } |
| 1143 | 1142 |
| 1144 } // end of namespace Ice | 1143 } // end of namespace Ice |
| OLD | NEW |