PPCPreEmitPeephole will convert a BC to B when the conditional branch is based on a constant CR by CRSET or CRUNSET. This is added in https://reviews.llvm.org/rL343100.
When the conditional branch is known to be always taken, all branches will be removed and a new unconditional branch will be inserted. However, when SeenUse is false the original patch will not remove the branches, but still insert the new unconditional branch and update the successors, and create inconsistent IR. Compiling the synthetic testcase included can show the problem we run into.
It seems to me removing the patches should not depend on the value of SeenUse so I guess it is an oversight. The patch simply removes the SeenUse condition when adding branches into InstrsToErase set.