Skip to content

Commit d110b6d

Browse files
committed
Move DefRewriter::setStorageAddress above
1 parent dcf0803 commit d110b6d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,6 +2900,14 @@ class DefRewriter : SILInstructionVisitor<DefRewriter> {
29002900
storage.storageAddress = addrMat.materializeAddress(arg);
29012901
}
29022902

2903+
void setStorageAddress(SILValue oldValue, SILValue addr) {
2904+
auto &storage = pass.valueStorageMap.getStorage(oldValue);
2905+
// getReusedStorageOperand() ensures that oldValue does not already have
2906+
// separate storage. So there's no need to delete its alloc_stack.
2907+
assert(!storage.storageAddress || storage.storageAddress == addr);
2908+
storage.storageAddress = addr;
2909+
}
2910+
29032911
void beforeVisit(SILInstruction *inst) {
29042912
LLVM_DEBUG(llvm::dbgs() << "REWRITE DEF "; inst->dump());
29052913
if (storage.storageAddress)
@@ -3003,14 +3011,6 @@ class DefRewriter : SILInstructionVisitor<DefRewriter> {
30033011
addrMat.initializeComposingUse(&operand);
30043012
}
30053013

3006-
void setStorageAddress(SILValue oldValue, SILValue addr) {
3007-
auto &storage = pass.valueStorageMap.getStorage(oldValue);
3008-
// getReusedStorageOperand() ensures that oldValue does not already have
3009-
// separate storage. So there's no need to delete its alloc_stack.
3010-
assert(!storage.storageAddress || storage.storageAddress == addr);
3011-
storage.storageAddress = addr;
3012-
}
3013-
30143014
void visitUnconditionalCheckedCastInst(
30153015
UnconditionalCheckedCastInst *uncondCheckedCast) {
30163016
SILValue srcVal = uncondCheckedCast->getOperand();

0 commit comments

Comments
 (0)