Skip to content

Commit 34f87eb

Browse files
committed
[sil] Make notifyMovedInstruction rewire the undef of values.
1 parent b85f75f commit 34f87eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SIL/IR/SILModule.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,12 @@ void SILModule::notifyAddedInstruction(SILInstruction *inst) {
760760

761761
void SILModule::notifyMovedInstruction(SILInstruction *inst,
762762
SILFunction *fromFunction) {
763+
for (auto &op : inst->getAllOperands()) {
764+
if (auto *undef = dyn_cast<SILUndef>(op.get())) {
765+
op.set(SILUndef::get(inst->getFunction(), undef->getType()));
766+
}
767+
}
768+
763769
inst->forEachDefinedLocalArchetype([&](CanLocalArchetypeType archeTy,
764770
SILValue dependency) {
765771
LocalArchetypeKey key = {archeTy, fromFunction};

0 commit comments

Comments
 (0)