AArch64: Fix invalid CCMP emission
authorMatthias Braun <matze@braunis.de>
Thu, 6 Dec 2018 01:40:23 +0000 (01:40 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 6 Dec 2018 01:40:23 +0000 (01:40 +0000)
commitd041212c0784656f4ae101044cf0d1b28ac008b3
tree77a94e6cd9c297737179d2dcfb3aaf853fa73fed
parent0cd6b9b9f7483a16d5371cf29a5adbdac6078a4b
AArch64: Fix invalid CCMP emission

The code emitting AND-subtrees used to check whether any of the operands
was an OR in order to figure out if the result needs to be negated.
However the OR could be hidden in further subtrees and not immediately
visible.

Change the code so that canEmitConjunction() determines whether the
result of the generated subtree needs to be negated. Cleanup emission
logic to use this. I also changed the code a bit to make all negation
decisions early before we actually emit the subtrees.

This fixes http://llvm.org/PR39550

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

llvm-svn: 348444
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/arm64-ccmp.ll