Fix PR14361: wrong simplification of A+B==B+A. You may think that the old logic
authorDuncan Sands <baldrick@free.fr>
Fri, 16 Nov 2012 18:55:49 +0000 (18:55 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 16 Nov 2012 18:55:49 +0000 (18:55 +0000)
commitafe4539f8ea9e12404dce0d67b421d8decb2f0fb
tree1fc36cae1e9dc425262cf6075b6465baa9bb8d87
parent661dfdc9b7e8ea9f65f4af0dca677adc96889773
Fix PR14361: wrong simplification of A+B==B+A.  You may think that the old logic
replaced by this patch is equivalent to the new logic, but you'd be wrong, and
that's exactly where the bug was.  There's a similar bug in instsimplify which
manifests itself as instsimplify failing to simplify this, rather than doing it
wrong, see next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168181 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/icmp.ll