Open
Description
foldBitOpOfBitcasts (#137322) allows us to fold bitlogic(bitcast(x),bitcast(y)) -> bitcast(bitlogic(x,y)) if x and y are the same type and it doesn't cost anymore.
We can generalise this to work with other matching cast ops (trunc/sext/zext) - similar to how foldShuffleOfCastops works (although much simpler as there's no shuffle mask manipulation to do).