Skip to content

Commit 16cbae3

Browse files
committed
[SILMem2Reg] Added explanation to assert.
1 parent 63192ba commit 16cbae3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ static void replaceLoad(LoadInst *li, SILValue newValue, AllocStackInst *asi,
163163

164164
while (op != asi) {
165165
assert(isa<UncheckedAddrCastInst>(op) || isa<StructElementAddrInst>(op) ||
166-
isa<TupleElementAddrInst>(op));
166+
isa<TupleElementAddrInst>(op) &&
167+
"found instruction that should have been skipped in "
168+
"isLoadFromStack");
167169
auto *inst = cast<SingleValueInstruction>(op);
168170
projections.push_back(Projection(inst));
169171
op = inst->getOperand(0);

0 commit comments

Comments
 (0)