[ARM] CMOV->BFI combining: handle both senses of CMPZ
authorJames Molloy <james.molloy@arm.com>
Thu, 12 Nov 2015 13:49:17 +0000 (13:49 +0000)
committerJames Molloy <james.molloy@arm.com>
Thu, 12 Nov 2015 13:49:17 +0000 (13:49 +0000)
commitb5caa9fd5620456d686d1e947ca0771f16c68019
tree43be0898604a7dc14425e4b29b5206381a565371
parent0e66a5f53c74056f95d178c86531d7d9cfb23da9
[ARM] CMOV->BFI combining: handle both senses of CMPZ

I completely misunderstood what ARMISD::CMPZ means. It's not "compare equal to zero", it's "compare, only setting the zero/Z flag". It can either be equal-to-zero or not-equal-to-zero, and we weren't checking what sense it was.

If it's equal-to-zero, we can swap the operands around and pretend like it is not-equal-to-zero, which is both a bug fix and lets us handle more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252891 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/bfi.ll