[InstSimplify] fixed (?) to not mutate icmps

As Eli noted in the post-commit thread for r288833, the use of
swapOperands() may not be allowed in InstSimplify, so I'm 
removing those calls here pending further review. 

The swap mutates the icmp, and there doesn't appear to be precedent
for instruction mutation in InstSimplify.

I didn't actually have any tests for those cases, so I'm adding
a few here. 

llvm-svn: 288855
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index cc4a6ba..bbabf2a 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -1523,11 +1523,8 @@
 static Value *simplifyAndOfICmpsWithSameOperands(ICmpInst *Op0, ICmpInst *Op1) {
   ICmpInst::Predicate Pred0, Pred1;
   Value *A ,*B;
-  match(Op0, m_ICmp(Pred0, m_Value(A), m_Value(B)));
-  if (match(Op1, m_ICmp(Pred1, m_Specific(B), m_Specific(A))))
-    Op1->swapOperands();
-
-  if (!match(Op1, m_ICmp(Pred1, m_Specific(A), m_Specific(B))))
+  if (!match(Op0, m_ICmp(Pred0, m_Value(A), m_Value(B))) ||
+      !match(Op1, m_ICmp(Pred1, m_Specific(A), m_Specific(B))))
     return nullptr;
 
   // We have (icmp Pred0, A, B) & (icmp Pred1, A, B).
@@ -1738,11 +1735,8 @@
 static Value *simplifyOrOfICmpsWithSameOperands(ICmpInst *Op0, ICmpInst *Op1) {
   ICmpInst::Predicate Pred0, Pred1;
   Value *A ,*B;
-  match(Op0, m_ICmp(Pred0, m_Value(A), m_Value(B)));
-  if (match(Op1, m_ICmp(Pred1, m_Specific(B), m_Specific(A))))
-    Op1->swapOperands();
-
-  if (!match(Op1, m_ICmp(Pred1, m_Specific(A), m_Specific(B))))
+  if (!match(Op0, m_ICmp(Pred0, m_Value(A), m_Value(B))) ||
+      !match(Op1, m_ICmp(Pred1, m_Specific(A), m_Specific(B))))
     return nullptr;
 
   // We have (icmp Pred0, A, B) | (icmp Pred1, A, B).