Don't generate ordered or unordered comparison operations if it is not legal to do so.

llvm-svn: 161053
This commit is contained in:
Micah Villmow 2012-07-31 16:48:03 +00:00
parent 16250c7c18
commit 6b12f596ef
1 changed files with 2 additions and 1 deletions

View File

@ -2464,7 +2464,8 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
// Otherwise, we can't fold it. However, we can simplify it to SETUO/SETO
// if it is not already.
ISD::CondCode NewCond = UOF == 0 ? ISD::SETO : ISD::SETUO;
if (NewCond != Cond)
if (NewCond != Cond && (DCI.isBeforeLegalizeOps()
|| getCondCodeAction(NewCond, N0.getValueType()) == Legal))
return DAG.getSetCC(dl, VT, N0, N1, NewCond);
}