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 // This file implements the Cfg class, including constant pool | 10 // This file implements the Cfg class, including constant pool |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // appears within the Variable's computed live range. | 309 // appears within the Variable's computed live range. |
310 bool Cfg::validateLiveness() const { | 310 bool Cfg::validateLiveness() const { |
311 TimerMarker T(TimerStack::TT_validateLiveness, this); | 311 TimerMarker T(TimerStack::TT_validateLiveness, this); |
312 bool Valid = true; | 312 bool Valid = true; |
313 Ostream &Str = Ctx->getStrDump(); | 313 Ostream &Str = Ctx->getStrDump(); |
314 for (CfgNode *Node : Nodes) { | 314 for (CfgNode *Node : Nodes) { |
315 Inst *FirstInst = NULL; | 315 Inst *FirstInst = NULL; |
316 for (Inst *Inst : Node->getInsts()) { | 316 for (Inst *Inst : Node->getInsts()) { |
317 if (Inst->isDeleted()) | 317 if (Inst->isDeleted()) |
318 continue; | 318 continue; |
319 if (llvm::isa<InstFakeKill>(Inst)) | |
320 continue; | |
321 if (FirstInst == NULL) | 319 if (FirstInst == NULL) |
322 FirstInst = Inst; | 320 FirstInst = Inst; |
323 InstNumberT InstNumber = Inst->getNumber(); | 321 InstNumberT InstNumber = Inst->getNumber(); |
324 if (Variable *Dest = Inst->getDest()) { | 322 if (Variable *Dest = Inst->getDest()) { |
325 if (!Dest->getIgnoreLiveness()) { | 323 if (!Dest->getIgnoreLiveness()) { |
326 bool Invalid = false; | 324 bool Invalid = false; |
327 const bool IsDest = true; | 325 const bool IsDest = true; |
328 if (!Dest->getLiveRange().containsValue(InstNumber, IsDest)) | 326 if (!Dest->getLiveRange().containsValue(InstNumber, IsDest)) |
329 Invalid = true; | 327 Invalid = true; |
330 // Check that this instruction actually *begins* Dest's live | 328 // Check that this instruction actually *begins* Dest's live |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 } | 461 } |
464 } | 462 } |
465 // Print each basic block | 463 // Print each basic block |
466 for (CfgNode *Node : Nodes) | 464 for (CfgNode *Node : Nodes) |
467 Node->dump(this); | 465 Node->dump(this); |
468 if (getContext()->isVerbose(IceV_Instructions)) | 466 if (getContext()->isVerbose(IceV_Instructions)) |
469 Str << "}\n"; | 467 Str << "}\n"; |
470 } | 468 } |
471 | 469 |
472 } // end of namespace Ice | 470 } // end of namespace Ice |
OLD | NEW |