Skip to content

Commit e45b4bd

Browse files
committed
SIL: clear operand bit fields of instructions which are moved between functions
This fixes a bug with can cause OperandSet to misbehave for instructions which were moved from another function.
1 parent 849cabc commit e45b4bd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/SIL/IR/SILBasicBlock.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ transferNodesFromList(llvm::ilist_traits<SILBasicBlock> &SrcTraits,
335335
for (SILValue result : II.getResults()) {
336336
result->resetBitfields();
337337
}
338+
for (Operand &op : II.getAllOperands()) {
339+
op.resetBitfields();
340+
}
338341
II.asSILNode()->resetBitfields();
339342

340343
II.setDebugScope(ScopeCloner.getOrCreateClonedScope(II.getDebugScope()));

lib/SIL/IR/SILInstruction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ transferNodesFromList(llvm::ilist_traits<SILInstruction> &L2,
8585
for (SILValue result : first->getResults()) {
8686
result->resetBitfields();
8787
}
88+
for (Operand &op : first->getAllOperands()) {
89+
op.resetBitfields();
90+
}
8891
first->asSILNode()->resetBitfields();
8992
}
9093
}

0 commit comments

Comments
 (0)