[ARM] Optimize expressions like "return x != 0;" for Thumb1.
authorEli Friedman <efriedma@quicinc.com>
Tue, 2 Apr 2019 00:01:23 +0000 (00:01 +0000)
committerEli Friedman <efriedma@quicinc.com>
Tue, 2 Apr 2019 00:01:23 +0000 (00:01 +0000)
commit3813fe0bda83f40355c23298c3ca887c51ce3b22
treee5621e5ddaf3d44cecca43b35e1008bc21a66794
parent73af6ef2e7525a9fc47e1219552955c7635bc660
[ARM] Optimize expressions like "return x != 0;" for Thumb1.

There's an existing optimization for x != C, but somehow it was missing
a special case for 0.

While I'm here, also cleaned up the code/comments a bit: the second
value produced by the MERGE_VALUES was actually dead, since a CMOV only
produces one result.

Differential Revision: https://reviews.llvm.org/D59616

llvm-svn: 357437
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/select-imm.ll
llvm/test/CodeGen/Thumb/umulo-128-legalisation-lowering.ll
llvm/test/CodeGen/Thumb/umulo-32-legalisation-lowering.ll