forked from OSchip/llvm-project
[DAGCombiner] Use getBitcast helper when possible. NFCI.
llvm-svn: 261437
This commit is contained in:
parent
ff4b63739e
commit
c5199aae82
|
@ -7388,11 +7388,9 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) {
|
||||||
|
|
||||||
if (N0.getValueType() == MVT::ppcf128 && !LegalTypes) {
|
if (N0.getValueType() == MVT::ppcf128 && !LegalTypes) {
|
||||||
APInt SignBit = APInt::getSignBit(VT.getSizeInBits() / 2);
|
APInt SignBit = APInt::getSignBit(VT.getSizeInBits() / 2);
|
||||||
SDValue Cst = DAG.getNode(ISD::BITCAST, SDLoc(N0.getOperand(0)), VT,
|
SDValue Cst = DAG.getBitcast(VT, N0.getOperand(0));
|
||||||
N0.getOperand(0));
|
|
||||||
AddToWorklist(Cst.getNode());
|
AddToWorklist(Cst.getNode());
|
||||||
SDValue X = DAG.getNode(ISD::BITCAST, SDLoc(N0.getOperand(1)), VT,
|
SDValue X = DAG.getBitcast(VT, N0.getOperand(1));
|
||||||
N0.getOperand(1));
|
|
||||||
AddToWorklist(X.getNode());
|
AddToWorklist(X.getNode());
|
||||||
SDValue XorResult = DAG.getNode(ISD::XOR, SDLoc(N0), VT, Cst, X);
|
SDValue XorResult = DAG.getNode(ISD::XOR, SDLoc(N0), VT, Cst, X);
|
||||||
AddToWorklist(XorResult.getNode());
|
AddToWorklist(XorResult.getNode());
|
||||||
|
@ -8969,9 +8967,7 @@ static SDValue FoldIntToFPToInt(SDNode *N, SelectionDAG &DAG) {
|
||||||
}
|
}
|
||||||
if (VT.getScalarSizeInBits() < SrcVT.getScalarSizeInBits())
|
if (VT.getScalarSizeInBits() < SrcVT.getScalarSizeInBits())
|
||||||
return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, Src);
|
return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, Src);
|
||||||
if (SrcVT == VT)
|
return DAG.getBitcast(VT, Src);
|
||||||
return Src;
|
|
||||||
return DAG.getNode(ISD::BITCAST, SDLoc(N), VT, Src);
|
|
||||||
}
|
}
|
||||||
return SDValue();
|
return SDValue();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue