llvm::TargetLowering::BuildSDIVPow2

Provide custom lowering of signed division by a power-of-2 constant.

Synopsis

Declared in <llvm/CodeGen/TargetLowering.h>

virtual
SDValue
BuildSDIVPow2(
    SDNode* N,
    APInt const& Divisor,
    SelectionDAG& DAG,
    SmallVectorImpl<SDNode*>& Created) const;

Description

Targets may override this function to provide custom SDIV lowering for power-of-2 denominators. If the target returns an empty SDValue, LLVM assumes SDIV is expensive and replaces it with a series of other integer operations.

Return Value

The lowered or expanded SelectionDAG value, or an empty SDValue on failure.

Parameters

NameDescription
NSDNode being queried.
DivisorConstant power-of-two divisor.
DAGSelectionDAG providing context.
CreatedNodes created by custom lowering.