There is a small piece of combine code that is no longer covered by the existing tests and which also looks incorrect. The provided test case was performing movne r0, r0 for the return value.
Details
Diff Detail
Event Timeline
The code in question is hit pretty frequently; see http://lab.llvm.org:8080/coverage/coverage-reports/all/coverage/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/ARM/ARMISelLowering.cpp.html#L12550 . Maybe we don't have any tests which check this particular aspect of the output, though.
The provided test case was performing movne r0, r0 for the return value.
That's obviously not ideal, but deleting the transform isn't really improving the situation. (https://rise4fun.com/Alive/slIT ).
If you want to specifically detect a "no-op" select, like your testcase, instcombine is probably appropriate. (I think we already have that combine, but maybe it doesn't look through zero-extensions.)
The redundant mov is really a property of ARM specifically, though: unlike other architectures, like AArch64, a conditional mov is a two-address instruction on ARM, so we want to reuse an existing register if possible. And we don't really represent the "conditional-move" aspect until after legalization, so I'm not sure where we would move this code to, despite the FIXME.