forked from OSchip/llvm-project
Only apply the SETCC+SITOFP -> SELECTCC optimization when the SETCC returns an MVT::i1, i.e. before type legalization.
This is a speculative fix for a problem on Mips reported by Akira Hatanaka. llvm-svn: 160036
This commit is contained in:
parent
5f0a1b89d7
commit
b8844d6744
|
@ -5975,7 +5975,8 @@ SDValue DAGCombiner::visitSINT_TO_FP(SDNode *N) {
|
|||
}
|
||||
|
||||
// fold (sint_to_fp (setcc x, y, cc)) -> (select_cc x, y, -1.0, 0.0,, cc)
|
||||
if (N0.getOpcode() == ISD::SETCC && !VT.isVector() &&
|
||||
if (N0.getOpcode() == ISD::SETCC && N0.getValueType() == MVT::i1 &&
|
||||
!VT.isVector() &&
|
||||
(!LegalOperations ||
|
||||
TLI.isOperationLegalOrCustom(llvm::ISD::ConstantFP, VT))) {
|
||||
SDValue Ops[] =
|
||||
|
|
Loading…
Reference in New Issue