| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |