From 2250314cb9abcdd549a9eae6158e82fa05fe5af2 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Wed, 27 Mar 2024 10:49:48 -0700 Subject: [PATCH] Add missed case to AssignAddressToDef. (#72617) Fixes #71744 (cherry picked from commit a63078f279e76a64ae92f338c1875c3d372c540b) --- lib/IRGen/LoadableByAddress.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/IRGen/LoadableByAddress.cpp b/lib/IRGen/LoadableByAddress.cpp index f7c24f0ff230a..f9eda93f7b0a9 100644 --- a/lib/IRGen/LoadableByAddress.cpp +++ b/lib/IRGen/LoadableByAddress.cpp @@ -3798,6 +3798,15 @@ class AssignAddressToDef : SILInstructionVisitor { assignment.mapValueToAddress(origValue, newAddr); assignment.markForDeletion(bc); } + + void visitUncheckedBitwiseCastInst(UncheckedBitwiseCastInst *bc) { + auto builder = assignment.getBuilder(bc->getIterator()); + auto opdAddr = assignment.getAddressForValue(bc->getOperand()); + auto newAddr = builder.createUncheckedAddrCast( + bc->getLoc(), opdAddr, bc->getType().getAddressType()); + assignment.mapValueToAddress(origValue, newAddr); + assignment.markForDeletion(bc); + } }; } // namespace