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 /// \file | 10 /// \file |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 llvm_unreachable("Phi operand not found for specified target node"); | 445 llvm_unreachable("Phi operand not found for specified target node"); |
446 } | 446 } |
447 | 447 |
448 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new instruction | 448 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new instruction |
449 // "a=a_phi". | 449 // "a=a_phi". |
450 Inst *InstPhi::lower(Cfg *Func) { | 450 Inst *InstPhi::lower(Cfg *Func) { |
451 Variable *Dest = getDest(); | 451 Variable *Dest = getDest(); |
452 assert(Dest); | 452 assert(Dest); |
453 Variable *NewSrc = Func->makeVariable(Dest->getType()); | 453 Variable *NewSrc = Func->makeVariable(Dest->getType()); |
454 if (BuildDefs::dump()) | 454 if (BuildDefs::dump()) |
455 NewSrc->setName(Func, Dest->getName(Func) + "_phi"); | 455 NewSrc->setName(Func, Dest->getName() + "_phi"); |
456 if (auto *NewSrc64On32 = llvm::dyn_cast<Variable64On32>(NewSrc)) | 456 if (auto *NewSrc64On32 = llvm::dyn_cast<Variable64On32>(NewSrc)) |
457 NewSrc64On32->initHiLo(Func); | 457 NewSrc64On32->initHiLo(Func); |
458 this->Dest = NewSrc; | 458 this->Dest = NewSrc; |
459 return InstAssign::create(Func, Dest, NewSrc); | 459 return InstAssign::create(Func, Dest, NewSrc); |
460 } | 460 } |
461 | 461 |
462 InstRet::InstRet(Cfg *Func, Operand *RetValue) | 462 InstRet::InstRet(Cfg *Func, Operand *RetValue) |
463 : InstHighLevel(Func, Ret, RetValue ? 1 : 0, nullptr) { | 463 : InstHighLevel(Func, Ret, RetValue ? 1 : 0, nullptr) { |
464 if (RetValue) | 464 if (RetValue) |
465 addSource(RetValue); | 465 addSource(RetValue); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 // upper 32 bits of rax. We need to recognize and preserve these. | 1033 // upper 32 bits of rax. We need to recognize and preserve these. |
1034 return true; | 1034 return true; |
1035 } | 1035 } |
1036 if (!Dest->hasReg() && !SrcVar->hasReg() && | 1036 if (!Dest->hasReg() && !SrcVar->hasReg() && |
1037 Dest->getStackOffset() == SrcVar->getStackOffset()) | 1037 Dest->getStackOffset() == SrcVar->getStackOffset()) |
1038 return true; | 1038 return true; |
1039 return false; | 1039 return false; |
1040 } | 1040 } |
1041 | 1041 |
1042 } // end of namespace Ice | 1042 } // end of namespace Ice |
OLD | NEW |