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

Side by Side Diff: src/IceLiveness.cpp

Issue 680733002: Subzero: Allow delaying Phi lowering until after register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix vector const undef lowering for phis. Created 6 years, 1 month 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/IceLiveness.h ('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/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 // This file provides some of the support for the Liveness class. In 10 // This file provides some of the support for the Liveness class. In
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex(); 46 SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex();
47 ++Nodes[Index].NumLocals; 47 ++Nodes[Index].NumLocals;
48 } 48 }
49 } 49 }
50 50
51 // Resize each LivenessNode::LiveToVarMap, and the global 51 // Resize each LivenessNode::LiveToVarMap, and the global
52 // LiveToVarMap. Reset the counts to 0. 52 // LiveToVarMap. Reset the counts to 0.
53 for (SizeT i = 0; i < NumNodes; ++i) { 53 for (SizeT i = 0; i < NumNodes; ++i) {
54 Nodes[i].LiveToVarMap.assign(Nodes[i].NumLocals, NULL); 54 Nodes[i].LiveToVarMap.assign(Nodes[i].NumLocals, NULL);
55 Nodes[i].NumLocals = 0; 55 Nodes[i].NumLocals = 0;
56 Nodes[i].NumNonDeadPhis = 0;
56 } 57 }
57 LiveToVarMap.assign(NumGlobals, NULL); 58 LiveToVarMap.assign(NumGlobals, NULL);
58 59
59 // Sort each variable into the appropriate LiveToVarMap. Also set 60 // Sort each variable into the appropriate LiveToVarMap. Also set
60 // VarToLiveMap. 61 // VarToLiveMap.
61 SizeT TmpNumGlobals = 0; 62 SizeT TmpNumGlobals = 0;
62 for (SizeT i = 0; i < NumVars; ++i) { 63 for (SizeT i = 0; i < NumVars; ++i) {
63 Variable *Var = Func->getVariables()[i]; 64 Variable *Var = Func->getVariables()[i];
64 SizeT VarIndex = Var->getIndex(); 65 SizeT VarIndex = Var->getIndex();
65 SizeT LiveIndex; 66 SizeT LiveIndex;
(...skipping 22 matching lines...) Expand all
88 } 89 }
89 90
90 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const { 91 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const {
91 if (LiveIndex < NumGlobals) 92 if (LiveIndex < NumGlobals)
92 return LiveToVarMap[LiveIndex]; 93 return LiveToVarMap[LiveIndex];
93 SizeT NodeIndex = Node->getIndex(); 94 SizeT NodeIndex = Node->getIndex();
94 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals]; 95 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals];
95 } 96 }
96 97
97 } // end of namespace Ice 98 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceLiveness.h ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698