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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 llvm_unreachable("Phi operand not found for specified target node"); | 352 llvm_unreachable("Phi operand not found for specified target node"); |
353 } | 353 } |
354 | 354 |
355 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new | 355 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new |
356 // instruction "a=a_phi". | 356 // instruction "a=a_phi". |
357 Inst *InstPhi::lower(Cfg *Func, CfgNode *Node) { | 357 Inst *InstPhi::lower(Cfg *Func, CfgNode *Node) { |
358 Variable *Dest = getDest(); | 358 Variable *Dest = getDest(); |
359 assert(Dest); | 359 assert(Dest); |
360 IceString PhiName = Dest->getName() + "_phi"; | 360 IceString PhiName = Dest->getName() + "_phi"; |
361 Variable *NewSrc = Func->makeVariable(Dest->getType(), Node, PhiName); | 361 Variable *NewSrc = Func->makeVariable(Dest->getType(), Node, PhiName); |
| 362 NewSrc->setIsMultidef(); |
362 this->Dest = NewSrc; | 363 this->Dest = NewSrc; |
363 InstAssign *NewInst = InstAssign::create(Func, Dest, NewSrc); | 364 InstAssign *NewInst = InstAssign::create(Func, Dest, NewSrc); |
364 // Set Dest and NewSrc to have affinity with each other, as a hint | 365 // Set Dest and NewSrc to have affinity with each other, as a hint |
365 // for register allocation. | 366 // for register allocation. |
366 Dest->setPreferredRegister(NewSrc, false); | 367 Dest->setPreferredRegister(NewSrc, false); |
367 NewSrc->setPreferredRegister(Dest, false); | 368 NewSrc->setPreferredRegister(Dest, false); |
368 Dest->replaceDefinition(NewInst, Node); | 369 Dest->replaceDefinition(NewInst, Node); |
369 return NewInst; | 370 return NewInst; |
370 } | 371 } |
371 | 372 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 763 |
763 void InstTarget::dump(const Cfg *Func) const { | 764 void InstTarget::dump(const Cfg *Func) const { |
764 Ostream &Str = Func->getContext()->getStrDump(); | 765 Ostream &Str = Func->getContext()->getStrDump(); |
765 Str << "[TARGET] "; | 766 Str << "[TARGET] "; |
766 Inst::dump(Func); | 767 Inst::dump(Func); |
767 } | 768 } |
768 | 769 |
769 void InstTarget::dumpExtras(const Cfg *Func) const { Inst::dumpExtras(Func); } | 770 void InstTarget::dumpExtras(const Cfg *Func) const { Inst::dumpExtras(Func); } |
770 | 771 |
771 } // end of namespace Ice | 772 } // end of namespace Ice |
OLD | NEW |