OSDN Git Service

Merging r195355:
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 21 Nov 2013 15:03:54 +0000 (15:03 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 21 Nov 2013 15:03:54 +0000 (15:03 +0000)
commit4e2d2f091e88dd83d1685173d2c0692d8ae155e6
tree9e93aac3ffb4e24e7d1657fff20f394c63cfb995
parent9eaade8b56b124150d189e1786b14306cdaf5641
Merging r195355:
------------------------------------------------------------------------
r195355 | dsanders | 2013-11-21 13:24:49 +0000 (Thu, 21 Nov 2013) | 20 lines

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/branches/release_34@195363 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]