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

Unified Diff: src/IceInst.cpp

Issue 589003002: Subzero: Refactor tracking of Defs and block-local Variables. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: "Mark args as being used in the entry node" was unnecessary. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index d6e0f59b15d30d1ad4236f00cfe020765310819d..629c6bdfddd41b2ca8a13dff15bb4bd18717e521 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -111,21 +111,7 @@ bool Inst::isLastUse(const Operand *TestSrc) const {
return false;
}
-void Inst::updateVars(CfgNode *Node) {
- if (Dest)
- Dest->setDefinition(this, Node);
-
- for (SizeT I = 0; I < getSrcSize(); ++I) {
- Operand *Src = getSrc(I);
- SizeT NumVars = Src->getNumVars();
- for (SizeT J = 0; J < NumVars; ++J) {
- Variable *Var = Src->getVar(J);
- Var->setUse(this, Node);
- }
- }
-}
-
-void Inst::livenessLightweight(llvm::BitVector &Live) {
+void Inst::livenessLightweight(Cfg *Func, llvm::BitVector &Live) {
assert(!isDeleted());
if (llvm::isa<InstFakeKill>(this))
return;
@@ -136,7 +122,7 @@ void Inst::livenessLightweight(llvm::BitVector &Live) {
SizeT NumVars = Src->getNumVars();
for (SizeT J = 0; J < NumVars; ++J, ++VarIndex) {
const Variable *Var = Src->getVar(J);
- if (Var->isMultiblockLife())
+ if (Func->getVMetadata()->isMultiBlock(Var))
continue;
SizeT Index = Var->getIndex();
if (Live[Index])
@@ -354,19 +340,17 @@ void InstPhi::livenessPhiOperand(llvm::BitVector &Live, CfgNode *Target,
// Change "a=phi(...)" to "a_phi=phi(...)" and return a new
// instruction "a=a_phi".
-Inst *InstPhi::lower(Cfg *Func, CfgNode *Node) {
+Inst *InstPhi::lower(Cfg *Func) {
Variable *Dest = getDest();
assert(Dest);
IceString PhiName = Dest->getName() + "_phi";
- Variable *NewSrc = Func->makeVariable(Dest->getType(), Node, PhiName);
- NewSrc->setIsMultidef();
+ Variable *NewSrc = Func->makeVariable(Dest->getType(), PhiName);
this->Dest = NewSrc;
InstAssign *NewInst = InstAssign::create(Func, Dest, NewSrc);
// Set Dest and NewSrc to have affinity with each other, as a hint
// for register allocation.
Dest->setPreferredRegister(NewSrc, false);
NewSrc->setPreferredRegister(Dest, false);
- Dest->replaceDefinition(NewInst, Node);
return NewInst;
}
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698