I was looking at other target's implementations of analyzeBranch to see if there's anything we're neglecting to handle for RISC-V. It looks like this optimisation in analyzeBranch is handled in OptimizeBlock in BranchFolding, so it's not clear there's any advantage in repeating in in X86's analyzeBranch. Certainly, no tests fail upon removing it.
Perhaps there's a benefit of handling it here that I'm missing?