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

Side by Side Diff: src/IceInst.cpp

Issue 557953007: Subzero: Fix incorrect address mode inference involving Phi temporaries. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add check against Var2->getIsMultidef() Created 6 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 | « no previous file | 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 // 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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698