Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: src/IceInst.cpp

Issue 1326013002: Refactor Lo and Hi out of Variable. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactor Hi and Lo out of Variable Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698