llvm::expandDivision

Expand a division into generated integer arithmetic.

Synopsis

Declared in <llvm/Transforms/Utils/IntegerDivision.h>

bool
expandDivision(BinaryOperator* Div);

Description

Generate code to divide two integers, replacing Div with the generated code. This currently generates code similarly to compiler-rt's implementations, but future work includes generating more specialized code when more information about the operands are known. Implements both 32bit and 64bit scalar division.

Return Value

True if the division was successfully expanded.

Parameters

NameDescription
DivThe division instruction to replace with expanded code.