llvm::TargetLowering::getNegatedExpression

getNegatedExpression overloads

Synopses

Declared in <llvm/CodeGen/TargetLowering.h>

This is the helper function to return the newly negated expression if the cost is not expensive.

SDValue
getNegatedExpression(
    SDValue Op,
    SelectionDAG& DAG,
    bool LegalOps,
    bool OptForSize,
    unsigned int Depth = 0) const;
» more...

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.

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

Return Value

  • The lowered or expanded SelectionDAG value, or an empty SDValue on failure.
  • 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.
DepthRecursion depth limit for the analysis.
CostMaximum acceptable negation cost.