llvm::TargetLowering::getNegatedExpression

Return the newly negated expression if the cost is not expensive and set the cost in Cost to indicate that if it is cheaper or neutral to do the negation.

Synopsis

Declared in <llvm/CodeGen/TargetLowering.h>

virtual
SDValue
getNegatedExpression(
    SDValue Op,
    SelectionDAG& DAG,
    bool LegalOps,
    bool OptForSize,
    NegatibleCost& Cost,
    unsigned int Depth = 0) const;

Return Value

The newly negated expression if the cost is not expensive and set the cost in Cost to indicate that if it is cheaper or neutral to do the negation.

Parameters

NameDescription
OpSDNode or value being queried.
DAGSelectionDAG providing context.
LegalOpsRestrict results to legal operations.
OptForSizeOptimize the negation for size.
CostMaximum acceptable negation cost.
DepthRecursion depth limit for the analysis.