Commit Graph

4 Commits

Author SHA1 Message Date
Erik Eckstein
012aa6227d SIL: when updating borrowed-from instructions, remove the old enclosing values first
When an optimization updates borrowed-from instruction it might be necessary to remove the old enclosing values from the borrowed-from instructions.
An optimization might transform the SIL in a way that an existing enclosing value is not valid anymore.
Fixes a compiler crash:
rdar://142991910
2025-01-21 08:21:26 +01:00
Erik Eckstein
c58f04f165 PhiUpdater: fix a problem when incrementally updating borrowed-from instructions
When replacing all uses, ignore existing borrowed-from instructions.

Fixes a SIL verifier error.
2025-01-02 10:42:00 +01:00
Erik Eckstein
cd7c533d42 Optimizer: add SingleValueInstruction.replace(with:) and use it throughout the optimizer
It replaces all uses and then erases the instruction.
2024-12-19 20:53:45 +01:00
Erik Eckstein
6990a195a3 Optimizer: rename GuaranteedPhiUpdater -> PhiUpdater
Because it now has the replacePhisWithIncomingValues utility, which works for all kind of phis.
2024-12-12 09:09:11 +01:00