I hit an ICE inside an optimizer pass because the code had a glaring syntax error that we diagnosed correctly, but since we kept going, the transformation didn't find the CFG in the assumed state, causing the ICE.
Is there any reason in particular we don't just make the gate functions return false when errorcount > 0?