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

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: Adds lit tests for the sandboxed call/ret sequences; add lit tests for the new pad_to_end bundle lo… 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
59 NumGlobals = TmpNumGlobals; 59 NumGlobals = TmpNumGlobals;
60 else 60 else {
61 if (TmpNumGlobals != 0) {
62 Ostream &Str = Func->getContext()->getStrDump();
63 for (auto I = FirstVar, E = Func->getVariables().end(); I != E; ++I) {
64 Variable *Var = *I;
65 if (VMetadata->isMultiBlock(Var)) {
66 Str << " Multiblock: ";
67 } else {
68 Str << "!Multiblock: ";
69 }
70 Var->dump(Str);
71 Str << "\n";
72 }
73 Func->dump();
74 }
61 assert(TmpNumGlobals == 0); 75 assert(TmpNumGlobals == 0);
62 76 }
63 // Resize each LivenessNode::LiveToVarMap, and the global LiveToVarMap. Reset 77 // Resize each LivenessNode::LiveToVarMap, and the global LiveToVarMap. Reset
64 // the counts to 0. 78 // the counts to 0.
65 for (auto I = FirstNode, E = Func->getNodes().end(); I != E; ++I) { 79 for (auto I = FirstNode, E = Func->getNodes().end(); I != E; ++I) {
66 LivenessNode &N = Nodes[(*I)->getIndex()]; 80 LivenessNode &N = Nodes[(*I)->getIndex()];
67 N.LiveToVarMap.assign(N.NumLocals, nullptr); 81 N.LiveToVarMap.assign(N.NumLocals, nullptr);
68 N.NumLocals = 0; 82 N.NumLocals = 0;
69 N.NumNonDeadPhis = 0; 83 N.NumNonDeadPhis = 0;
70 } 84 }
71 if (IsFullInit) 85 if (IsFullInit)
72 LiveToVarMap.assign(NumGlobals, nullptr); 86 LiveToVarMap.assign(NumGlobals, nullptr);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 144 }
131 145
132 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const { 146 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const {
133 if (LiveIndex < NumGlobals) 147 if (LiveIndex < NumGlobals)
134 return LiveToVarMap[LiveIndex]; 148 return LiveToVarMap[LiveIndex];
135 SizeT NodeIndex = Node->getIndex(); 149 SizeT NodeIndex = Node->getIndex();
136 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals]; 150 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals];
137 } 151 }
138 152
139 } // end of namespace Ice 153 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698