summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-12 17:03:46 +0000
committerChris Lattner <sabre@nondot.org>2006-05-12 17:03:46 +0000
commit8c02c3f41ad99a84d58e2cfc6e3a964be319085f (patch)
treee2754b03c1431e67b124c70bc21084db81447568 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parenta296339c877dc410a4dcda6d43cf7d3ed82f7f73 (diff)
downloadbcm5719-llvm-8c02c3f41ad99a84d58e2cfc6e3a964be319085f.tar.gz
bcm5719-llvm-8c02c3f41ad99a84d58e2cfc6e3a964be319085f.zip
Compile:
%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. llvm-svn: 28244
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ca123f497e5..712a03069f3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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);
}
OpenPOWER on IntegriCloud