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

Side by Side Diff: src/IceLiveness.cpp

Issue 1559243002: Suzero. X8664. NaCl Sandboxing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 11 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
OLDNEW
1 //===- subzero/src/IceLiveness.cpp - Liveness analysis implementation -----===// 1 //===- subzero/src/IceLiveness.cpp - Liveness analysis 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 SizeT TmpNumGlobals = 0; 48 SizeT TmpNumGlobals = 0;
49 for (auto I = FirstVar, E = Func->getVariables().end(); I != E; ++I) { 49 for (auto I = FirstVar, E = Func->getVariables().end(); I != E; ++I) {
50 Variable *Var = *I; 50 Variable *Var = *I;
51 if (VMetadata->isMultiBlock(Var)) { 51 if (VMetadata->isMultiBlock(Var)) {
52 ++TmpNumGlobals; 52 ++TmpNumGlobals;
53 } else { 53 } else {
54 SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex(); 54 SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex();
55 ++Nodes[Index].NumLocals; 55 ++Nodes[Index].NumLocals;
56 } 56 }
57 } 57 }
58 if (IsFullInit) 58 if (IsFullInit) {
Jim Stichnoth 2016/01/14 00:09:52 I would just revert this change completely in this
John 2016/01/14 23:18:25 This was on the spirit of last afternoon's discuss
59 NumGlobals = TmpNumGlobals; 59 NumGlobals = TmpNumGlobals;
60 else 60 } else {
61 assert(TmpNumGlobals == 0); 61 assert(TmpNumGlobals == 0);
62 62 }
63 // Resize each LivenessNode::LiveToVarMap, and the global LiveToVarMap. Reset 63 // Resize each LivenessNode::LiveToVarMap, and the global LiveToVarMap. Reset
64 // the counts to 0. 64 // the counts to 0.
65 for (auto I = FirstNode, E = Func->getNodes().end(); I != E; ++I) { 65 for (auto I = FirstNode, E = Func->getNodes().end(); I != E; ++I) {
66 LivenessNode &N = Nodes[(*I)->getIndex()]; 66 LivenessNode &N = Nodes[(*I)->getIndex()];
67 N.LiveToVarMap.assign(N.NumLocals, nullptr); 67 N.LiveToVarMap.assign(N.NumLocals, nullptr);
68 N.NumLocals = 0; 68 N.NumLocals = 0;
69 N.NumNonDeadPhis = 0; 69 N.NumNonDeadPhis = 0;
70 } 70 }
71 if (IsFullInit) 71 if (IsFullInit)
72 LiveToVarMap.assign(NumGlobals, nullptr); 72 LiveToVarMap.assign(NumGlobals, nullptr);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const { 132 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const {
133 if (LiveIndex < NumGlobals) 133 if (LiveIndex < NumGlobals)
134 return LiveToVarMap[LiveIndex]; 134 return LiveToVarMap[LiveIndex];
135 SizeT NodeIndex = Node->getIndex(); 135 SizeT NodeIndex = Node->getIndex();
136 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals]; 136 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals];
137 } 137 }
138 138
139 } // end of namespace Ice 139 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698