OLD | NEW |
1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// | 1 //===- subzero/src/IceInst.cpp - High-level instruction 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 Inst class, primarily the various | 10 // This file implements the Inst class, primarily the various |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 } | 354 } |
355 } | 355 } |
356 llvm_unreachable("Phi operand not found for specified target node"); | 356 llvm_unreachable("Phi operand not found for specified target node"); |
357 } | 357 } |
358 | 358 |
359 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new | 359 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new |
360 // instruction "a=a_phi". | 360 // instruction "a=a_phi". |
361 Inst *InstPhi::lower(Cfg *Func) { | 361 Inst *InstPhi::lower(Cfg *Func) { |
362 Variable *Dest = getDest(); | 362 Variable *Dest = getDest(); |
363 assert(Dest); | 363 assert(Dest); |
364 IceString PhiName = Dest->getName() + "_phi"; | 364 Variable *NewSrc = Func->makeVariable(Dest->getType()); |
365 Variable *NewSrc = Func->makeVariable(Dest->getType(), PhiName); | 365 if (ALLOW_DUMP) |
| 366 NewSrc->setName(Func, Dest->getName(Func) + "_phi"); |
366 this->Dest = NewSrc; | 367 this->Dest = NewSrc; |
367 return InstAssign::create(Func, Dest, NewSrc); | 368 return InstAssign::create(Func, Dest, NewSrc); |
368 } | 369 } |
369 | 370 |
370 InstRet::InstRet(Cfg *Func, Operand *RetValue) | 371 InstRet::InstRet(Cfg *Func, Operand *RetValue) |
371 : InstHighLevel(Func, Ret, RetValue ? 1 : 0, NULL) { | 372 : InstHighLevel(Func, Ret, RetValue ? 1 : 0, NULL) { |
372 if (RetValue) | 373 if (RetValue) |
373 addSource(RetValue); | 374 addSource(RetValue); |
374 } | 375 } |
375 | 376 |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 | 811 |
811 void InstTarget::dump(const Cfg *Func) const { | 812 void InstTarget::dump(const Cfg *Func) const { |
812 if (!ALLOW_DUMP) | 813 if (!ALLOW_DUMP) |
813 return; | 814 return; |
814 Ostream &Str = Func->getContext()->getStrDump(); | 815 Ostream &Str = Func->getContext()->getStrDump(); |
815 Str << "[TARGET] "; | 816 Str << "[TARGET] "; |
816 Inst::dump(Func); | 817 Inst::dump(Func); |
817 } | 818 } |
818 | 819 |
819 } // end of namespace Ice | 820 } // end of namespace Ice |
OLD | NEW |