@@ -128,7 +128,7 @@ void TempLValueOptPass::tempLValueOpt(CopyAddrInst *copyInst) {
128
128
//
129
129
// alloc_stack %temp
130
130
// ...
131
- // first_use_of %temp // beginOfLiferange
131
+ // first_use_of %temp // beginOfLiverange
132
132
// ... // no reads or writes from/to %destination
133
133
// copy_addr [take] %temp to %destination // copyInst
134
134
// ... // no further uses of %temp (copyInst is the end of %temp liverange)
@@ -186,8 +186,8 @@ void TempLValueOptPass::tempLValueOpt(CopyAddrInst *copyInst) {
186
186
187
187
// Iterate over the liverange of the temporary and make some validity checks.
188
188
AliasAnalysis *AA = nullptr ;
189
- SILInstruction *beginOfLiferange = nullptr ;
190
- bool endOfLiferangeReached = false ;
189
+ SILInstruction *beginOfLiverange = nullptr ;
190
+ bool endOfLiverangeReached = false ;
191
191
for (auto iter = temporary->getIterator (); iter != block->end (); ++iter) {
192
192
SILInstruction *inst = &*iter;
193
193
// The dealloc_stack is the last user of the temporary.
@@ -197,19 +197,19 @@ void TempLValueOptPass::tempLValueOpt(CopyAddrInst *copyInst) {
197
197
if (users.contains (inst) != 0 ) {
198
198
// Check if the copyInst is the last user of the temporary (beside the
199
199
// dealloc_stack).
200
- if (endOfLiferangeReached )
200
+ if (endOfLiverangeReached )
201
201
return ;
202
202
203
203
// Find the first user of the temporary to get a more precise liverange.
204
204
// It would be too conservative to treat the alloc_stack itself as the
205
205
// begin of the liverange.
206
- if (!beginOfLiferange )
207
- beginOfLiferange = inst;
206
+ if (!beginOfLiverange )
207
+ beginOfLiverange = inst;
208
208
209
209
if (inst == copyInst)
210
- endOfLiferangeReached = true ;
210
+ endOfLiverangeReached = true ;
211
211
}
212
- if (beginOfLiferange && !endOfLiferangeReached ) {
212
+ if (beginOfLiverange && !endOfLiverangeReached ) {
213
213
// If the root address of the destination is within the liverange of the
214
214
// temporary, we cannot replace all uses of the temporary with the
215
215
// destination (it would break the def-use dominance rule).
@@ -233,21 +233,21 @@ void TempLValueOptPass::tempLValueOpt(CopyAddrInst *copyInst) {
233
233
return ;
234
234
}
235
235
}
236
- assert (endOfLiferangeReached );
236
+ assert (endOfLiverangeReached );
237
237
238
238
// Move all projections of the destination address before the liverange of
239
239
// the temporary.
240
- for (auto iter = beginOfLiferange ->getIterator ();
240
+ for (auto iter = beginOfLiverange ->getIterator ();
241
241
iter != copyInst->getIterator ();) {
242
242
SILInstruction *inst = &*iter++;
243
243
if (projections.contains (inst))
244
- inst->moveBefore (beginOfLiferange );
244
+ inst->moveBefore (beginOfLiverange );
245
245
}
246
246
247
247
if (!copyInst->isInitializationOfDest ()) {
248
248
// Make sure the destination is uninitialized before the liverange of
249
249
// the temporary.
250
- SILBuilderWithScope builder (beginOfLiferange );
250
+ SILBuilderWithScope builder (beginOfLiverange );
251
251
builder.createDestroyAddr (copyInst->getLoc (), destination);
252
252
}
253
253
0 commit comments