[PATCH] Add support for legalizing SETNE/SETEQ by inverting the condition code and the result of the comparison.

Daniel Sanders daniel.sanders at imgtec.com
Wed Nov 20 03:54:03 PST 2013


Hi resistor,

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.

http://llvm-reviews.chandlerc.com/D2229

Files:
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  test/CodeGen/Mips/msa/compare.ll
  test/CodeGen/Mips/msa/llvm-stress-s3861334421.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2229.1.patch
Type: text/x-patch
Size: 16795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131120/57d729d5/attachment.bin>


More information about the llvm-commits mailing list