Mark Guard* as depending on Snapshot in DCE

We need to keep the Snapshot instruction alive.
This commit is contained in:
Max Bernstein 2025-04-07 15:40:51 -04:00 committed by Takashi Kokubun
parent 392c492b07
commit 0e766c9014
Notes: git 2025-04-18 13:47:40 +00:00

View File

@ -1198,12 +1198,15 @@ impl Function {
Insn::StringCopy { val }
| Insn::ArrayDup { val }
| Insn::StringIntern { val }
| Insn::GuardType { val, .. }
| Insn::GuardBitEquals { val, .. }
| Insn::Return { val }
| Insn::Defined { v: val, .. }
| Insn::Test { val } =>
worklist.push_back(val),
Insn::GuardType { val, state, .. }
| Insn::GuardBitEquals { val, state, .. } => {
worklist.push_back(val);
worklist.push_back(state);
}
Insn::ArraySet { array, val, .. } => {
worklist.push_back(array);
worklist.push_back(val);