mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
add a couple of missing folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26724 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8f4191d619
commit
79dbea5ab4
@ -2102,6 +2102,18 @@ SDOperand DAGCombiner::visitFP_ROUND(SDNode *N) {
|
||||
// fold (fp_round c1fp) -> c1fp
|
||||
if (N0CFP)
|
||||
return DAG.getNode(ISD::FP_ROUND, VT, N0);
|
||||
|
||||
// fold (fp_round (fp_extend x)) -> x
|
||||
if (N0.getOpcode() == ISD::FP_EXTEND && VT == N0.getOperand(0).getValueType())
|
||||
return N0.getOperand(0);
|
||||
|
||||
// fold (fp_round (copysign X, Y)) -> (copysign (fp_round X), Y)
|
||||
if (N0.getOpcode() == ISD::FCOPYSIGN && N0.Val->hasOneUse()) {
|
||||
SDOperand Tmp = DAG.getNode(ISD::FP_ROUND, VT, N0.getOperand(0));
|
||||
AddToWorkList(Tmp.Val);
|
||||
return DAG.getNode(ISD::FCOPYSIGN, VT, Tmp, N0.getOperand(1));
|
||||
}
|
||||
|
||||
return SDOperand();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user