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

Side by Side Diff: src/IceInst.cpp

Issue 1271923002: Subzero: Slight improvement to phi lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 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/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 /// \file 10 /// \file
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 Liveness *Liveness, LiveBeginEndMap *LiveBegin, 176 Liveness *Liveness, LiveBeginEndMap *LiveBegin,
177 LiveBeginEndMap *LiveEnd) { 177 LiveBeginEndMap *LiveEnd) {
178 assert(!isDeleted()); 178 assert(!isDeleted());
179 179
180 Dead = false; 180 Dead = false;
181 if (Dest) { 181 if (Dest) {
182 SizeT VarNum = Liveness->getLiveIndex(Dest->getIndex()); 182 SizeT VarNum = Liveness->getLiveIndex(Dest->getIndex());
183 if (Live[VarNum]) { 183 if (Live[VarNum]) {
184 if (!isDestNonKillable()) { 184 if (!isDestNonKillable()) {
185 Live[VarNum] = false; 185 Live[VarNum] = false;
186 if (LiveBegin) { 186 if (LiveBegin && Liveness->getRangeMask(Dest->getIndex())) {
187 LiveBegin->push_back(std::make_pair(VarNum, InstNumber)); 187 LiveBegin->push_back(std::make_pair(VarNum, InstNumber));
188 } 188 }
189 } 189 }
190 } else { 190 } else {
191 if (!hasSideEffects()) 191 if (!hasSideEffects())
192 Dead = true; 192 Dead = true;
193 } 193 }
194 } 194 }
195 if (Dead) 195 if (Dead)
196 return false; 196 return false;
(...skipping 19 matching lines...) Expand all
216 // twice. ICE only allows a variable to have a single 216 // twice. ICE only allows a variable to have a single
217 // liveness interval in a basic block (except for blocks 217 // liveness interval in a basic block (except for blocks
218 // where a variable is live-in and live-out but there is a 218 // where a variable is live-in and live-out but there is a
219 // gap in the middle). Therefore, this lowered sequence 219 // gap in the middle). Therefore, this lowered sequence
220 // needs to represent a single conservative live range for 220 // needs to represent a single conservative live range for
221 // t. Since the instructions are being traversed backwards, 221 // t. Since the instructions are being traversed backwards,
222 // we make sure LiveEnd is only set once by setting it only 222 // we make sure LiveEnd is only set once by setting it only
223 // when LiveEnd[VarNum]==0 (sentinel value). Note that it's 223 // when LiveEnd[VarNum]==0 (sentinel value). Note that it's
224 // OK to set LiveBegin multiple times because of the 224 // OK to set LiveBegin multiple times because of the
225 // backwards traversal. 225 // backwards traversal.
226 if (LiveEnd) { 226 if (LiveEnd && Liveness->getRangeMask(Var->getIndex())) {
227 // Ideally, we would verify that VarNum wasn't already 227 // Ideally, we would verify that VarNum wasn't already
228 // added in this block, but this can't be done very 228 // added in this block, but this can't be done very
229 // efficiently with LiveEnd as a vector. Instead, 229 // efficiently with LiveEnd as a vector. Instead,
230 // livenessPostprocess() verifies this after the vector 230 // livenessPostprocess() verifies this after the vector
231 // has been sorted. 231 // has been sorted.
232 LiveEnd->push_back(std::make_pair(VarNum, InstNumber)); 232 LiveEnd->push_back(std::make_pair(VarNum, InstNumber));
233 } 233 }
234 } 234 }
235 } 235 }
236 } 236 }
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 // preserve these. 974 // preserve these.
975 return true; 975 return true;
976 } 976 }
977 if (!Dest->hasReg() && !SrcVar->hasReg() && 977 if (!Dest->hasReg() && !SrcVar->hasReg() &&
978 Dest->getStackOffset() == SrcVar->getStackOffset()) 978 Dest->getStackOffset() == SrcVar->getStackOffset())
979 return true; 979 return true;
980 return false; 980 return false;
981 } 981 }
982 982
983 } // end of namespace Ice 983 } // end of namespace Ice
OLDNEW
« src/IceCfgNode.cpp ('K') | « src/IceCfgNode.cpp ('k') | src/IceLiveness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698