We can use known bits or etc to test if signed overflow is possible or not. Or more generally, if sbc hl, bc always sets PO, then call pe, __setflags will never be called and can be safely removed.
The other way to get this optimization would be to remove conditional calls if it can be proven that they will never be called.
__setflags discussion here: https://discordapp.com/channels/432891584451706892/1488273105121185875
We can use known bits or etc to test if signed overflow is possible or not. Or more generally, if
sbc hl, bcalways setsPO, thencall pe, __setflagswill never be called and can be safely removed.The other way to get this optimization would be to remove conditional calls if it can be proven that they will never be called.
__setflagsdiscussion here: https://discordapp.com/channels/432891584451706892/1488273105121185875