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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } | 378 } |
379 | 379 |
380 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new instruction | 380 // Change "a=phi(...)" to "a_phi=phi(...)" and return a new instruction |
381 // "a=a_phi". | 381 // "a=a_phi". |
382 Inst *InstPhi::lower(Cfg *Func) { | 382 Inst *InstPhi::lower(Cfg *Func) { |
383 Variable *Dest = getDest(); | 383 Variable *Dest = getDest(); |
384 assert(Dest); | 384 assert(Dest); |
385 Variable *NewSrc = Func->makeVariable(Dest->getType()); | 385 Variable *NewSrc = Func->makeVariable(Dest->getType()); |
386 if (BuildDefs::dump()) | 386 if (BuildDefs::dump()) |
387 NewSrc->setName(Func, Dest->getName(Func) + "_phi"); | 387 NewSrc->setName(Func, Dest->getName(Func) + "_phi"); |
| 388 if (auto *NewSrc64On32 = llvm::dyn_cast<Variable64On32>(NewSrc)) |
| 389 NewSrc64On32->initHiLo(Func); |
388 this->Dest = NewSrc; | 390 this->Dest = NewSrc; |
389 return InstAssign::create(Func, Dest, NewSrc); | 391 return InstAssign::create(Func, Dest, NewSrc); |
390 } | 392 } |
391 | 393 |
392 InstRet::InstRet(Cfg *Func, Operand *RetValue) | 394 InstRet::InstRet(Cfg *Func, Operand *RetValue) |
393 : InstHighLevel(Func, Ret, RetValue ? 1 : 0, nullptr) { | 395 : InstHighLevel(Func, Ret, RetValue ? 1 : 0, nullptr) { |
394 if (RetValue) | 396 if (RetValue) |
395 addSource(RetValue); | 397 addSource(RetValue); |
396 } | 398 } |
397 | 399 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 // upper 32 bits of rax. We need to recognize and preserve these. | 953 // upper 32 bits of rax. We need to recognize and preserve these. |
952 return true; | 954 return true; |
953 } | 955 } |
954 if (!Dest->hasReg() && !SrcVar->hasReg() && | 956 if (!Dest->hasReg() && !SrcVar->hasReg() && |
955 Dest->getStackOffset() == SrcVar->getStackOffset()) | 957 Dest->getStackOffset() == SrcVar->getStackOffset()) |
956 return true; | 958 return true; |
957 return false; | 959 return false; |
958 } | 960 } |
959 | 961 |
960 } // end of namespace Ice | 962 } // end of namespace Ice |
OLD | NEW |