Try to simplify cast in similar way as for GEP and ADD with constant (e.g. sext/zext + trunc).
I'm fine with isSafeToSpeculativelyExecute part, it seems reasonable. But this doesn't seem to be NFC while whole patch claims it's an NFC. Should it be 2 different patches?
Please add a test. If you can't figure it out yourself, you can insert an assert and run a big enough tests corps to see if something changed, and then use bugpoint to reduce it. Good luck!