Skip to content

Commit df7c76f

Browse files
authored
Merge pull request #18290 from mhong/master_const_fold_no_multi_value_inst
Fixed a bug in const folding, where an inst that's not of type SingleValueInstruction gets added to the worklist
2 parents 6ac8553 + 75d9540 commit df7c76f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SILOptimizer/Utils/ConstantFolding.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,8 @@ ConstantFolder::processWorkList() {
16681668

16691669
// The new constant could be further folded now, add it to the worklist.
16701670
if (auto *Inst = C->getDefiningInstruction())
1671-
WorkList.insert(Inst);
1671+
if (isa<SingleValueInstruction>(Inst))
1672+
WorkList.insert(Inst);
16721673
}
16731674

16741675
// Eagerly DCE. We do this after visiting all users to ensure we don't

0 commit comments

Comments
 (0)