@@ -877,7 +877,6 @@ AvailableValues &Implementation::computeAvailableValues(SILBasicBlock *block) {
877877 llvm::dbgs ()
878878 << " Destructuring available values in preds to smallest size for bb"
879879 << block->getDebugID() << '\n');
880- auto *fn = block->getFunction ();
881880 IntervalMapAllocator::Map typeSpanToValue (getAllocator());
882881 for (auto *predBlock : predsSkippingBackEdges) {
883882 SWIFT_DEFER { typeSpanToValue.clear (); };
@@ -930,20 +929,10 @@ AvailableValues &Implementation::computeAvailableValues(SILBasicBlock *block) {
930929 // smallest offset size could result in further destructuring that an
931930 // earlier value required. Instead, we do a final loop afterwards using
932931 // the interval map to update each available value.
933- auto iterType = iterValue->getType ();
934932 auto loc = getSafeLoc (predBlock->getTerminator ());
935933 SILBuilderWithScope builder (predBlock->getTerminator ());
936934
937935 while (smallestOffsetSize->first .size < iterOffsetSize.size ) {
938- TypeOffsetSizePair childOffsetSize;
939- SILType childType;
940-
941- // We are returned an optional here and should never fail... so use a
942- // force unwrap.
943- std::tie (childOffsetSize, childType) =
944- *iterOffsetSize.walkOneLevelTowardsChild (iterOffsetSize, iterType,
945- fn);
946-
947936 // Before we destructure ourselves, erase our entire value from the
948937 // map. We do not need to consider the possibility of there being holes
949938 // in our range since we always store values whole to their entire
@@ -1401,8 +1390,8 @@ void Implementation::rewriteUses(InstructionDeleter *deleter) {
14011390
14021391 // Then walk one level towards our target type.
14031392 std::tie (iterOffsetSize, iterType) =
1404- *useOffsetSize.walkOneLevelTowardsChild (parentOffsetSize,
1405- iterType, fn);
1393+ *useOffsetSize.walkOneLevelTowardsChild (
1394+ parentOffsetSize, iterType, unwrappedOperandType , fn);
14061395
14071396 unsigned start = parentOffsetSize.startOffset ;
14081397 consumeBuilder.emitDestructureValueOperation (
0 commit comments