Fix translateX86CC: if SetCCOpcode is SETULE and
authorDuncan Sands <baldrick@free.fr>
Fri, 24 Oct 2008 13:03:10 +0000 (13:03 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 24 Oct 2008 13:03:10 +0000 (13:03 +0000)
commit4047f4a0b478e20e981cc46d2aa0ca3141f79f07
treeedd4aed964b539c2043d458ef8f44c9fb0f3a150
parent389b715e0f8fed761bd7a58d663ec33047a76c79
Fix translateX86CC: if SetCCOpcode is SETULE and
LHS is a foldable load, then LHS and RHS are swapped
and SetCCOpcode is changed to SETUGT.  But the later
code is expecting operands to be the wrong way round
for SETUGT, but they are not in this case, resulting
in an inverted compare.  The solution is to move the
load normalization before the correction for SETUGT.
This bug was tickled by LegalizeTypes which happened
to legalize the testcase slightly differently to
LegalizeDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58092 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/2008-10-24-FlippedCompare.ll [new file with mode: 0644]