Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 10,887 Lines • ▼ Show 20 Lines | SDValue DAGCombiner::visitFREM(SDNode *N) { | ||||
if (SDValue NewSel = foldBinOpIntoSelect(N)) | if (SDValue NewSel = foldBinOpIntoSelect(N)) | ||||
return NewSel; | return NewSel; | ||||
return SDValue(); | return SDValue(); | ||||
} | } | ||||
SDValue DAGCombiner::visitFSQRT(SDNode *N) { | SDValue DAGCombiner::visitFSQRT(SDNode *N) { | ||||
if (!DAG.getTarget().Options.UnsafeFPMath) | SDNodeFlags Flags = N->getFlags(); | ||||
if (!DAG.getTarget().Options.UnsafeFPMath && | |||||
!Flags.hasApproximateFuncs()) | |||||
return SDValue(); | return SDValue(); | ||||
SDValue N0 = N->getOperand(0); | SDValue N0 = N->getOperand(0); | ||||
if (TLI.isFsqrtCheap(N0, DAG)) | if (TLI.isFsqrtCheap(N0, DAG)) | ||||
return SDValue(); | return SDValue(); | ||||
// TODO: FSQRT nodes should have flags that propagate to the created nodes. | // FSQRT nodes have flags that propagate to the created nodes. | ||||
// For now, create a Flags object for use with reassociation math transforms. | |||||
SDNodeFlags Flags; | |||||
Flags.setAllowReassociation(true); | |||||
return buildSqrtEstimate(N0, Flags); | return buildSqrtEstimate(N0, Flags); | ||||
} | } | ||||
/// copysign(x, fp_extend(y)) -> copysign(x, y) | /// copysign(x, fp_extend(y)) -> copysign(x, y) | ||||
/// copysign(x, fp_round(y)) -> copysign(x, y) | /// copysign(x, fp_round(y)) -> copysign(x, y) | ||||
static inline bool CanCombineFCOPYSIGN_EXTEND_ROUND(SDNode *N) { | static inline bool CanCombineFCOPYSIGN_EXTEND_ROUND(SDNode *N) { | ||||
SDValue N1 = N->getOperand(1); | SDValue N1 = N->getOperand(1); | ||||
if ((N1.getOpcode() == ISD::FP_EXTEND || | if ((N1.getOpcode() == ISD::FP_EXTEND || | ||||
▲ Show 20 Lines • Show All 7,208 Lines • Show Last 20 Lines |