Add support for legalizing SETNE/SETEQ by inverting the condition code and the result...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 21 Nov 2013 13:24:49 +0000 (13:24 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 21 Nov 2013 13:24:49 +0000 (13:24 +0000)
commitf89ddfccc0a5f053d61b0f6c89bba1bcb5064e00
tree2705248c1bbb34c4427ee8c4acbaaff02643bf62
parent52658c9db59f5b04cf45ba96e84b32247163fce3
Add support for legalizing SETNE/SETEQ by inverting the condition code and the result of the comparison.

Summary:
LegalizeSetCCCondCode can now legalize SETEQ and SETNE by returning the inverse
condition and requesting that the caller invert the result of the condition.

The caller of LegalizeSetCCCondCode must handle the inverted CC, and they do
so as follows:
  SETCC, BR_CC:
    Invert the result of the SETCC with SelectionDAG::getNOT()
  SELECT_CC:
    Swap the true/false operands.

This is necessary for MSA which lacks an integer SETNE instruction.

Reviewers: resistor

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2229

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195355 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
test/CodeGen/Mips/msa/compare.ll
test/CodeGen/Mips/msa/llvm-stress-s3861334421.ll [new file with mode: 0644]