Compile:
authorChris Lattner <sabre@nondot.org>
Fri, 12 May 2006 17:03:46 +0000 (17:03 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 12 May 2006 17:03:46 +0000 (17:03 +0000)
        %tmp152 = setgt uint %tmp144, %tmp149           ; <bool> [#uses=1]
        %tmp159 = setlt uint %tmp144, %tmp149           ; <bool> [#uses=1]
        %bothcond2 = or bool %tmp152, %tmp159           ; <bool> [#uses=1]

To setne, not setune, which causes an assertion fault.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28244 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index ca123f497e5969cb2addcdb408993abfdc5772ee..712a03069f3122b7d4f8a5c25ba3636274322768 100644 (file)
@@ -217,7 +217,12 @@ ISD::CondCode ISD::getSetCCOrOperation(ISD::CondCode Op1, ISD::CondCode Op2,
   // If the N and U bits get set then the resultant comparison DOES suddenly
   // care about orderedness, and is true when ordered.
   if (Op > ISD::SETTRUE2)
-    Op &= ~16;     // Clear the N bit.
+    Op &= ~16;     // Clear the U bit if the N bit is set.
+  
+  // Canonicalize illegal integer setcc's.
+  if (isInteger && Op == ISD::SETUNE)  // e.g. SETUGT | SETULT
+    Op = ISD::SETNE;
+  
   return ISD::CondCode(Op);
 }