The patch looks good, and I am researching an issue which is a bit like this one. I think there should be more test case, for example cmp w0, #1 // =1 b.lt .LBB http://reviews.llvm.org/D4440