This optimization identifies DIV instructions in a BB that can be profitably bypassed and carried out with a shorter, faster divide.

Synopsis

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

bool
bypassSlowDivision(
    BasicBlock* BB,
    DenseMap<unsigned int, unsigned int> const& BypassWidth,
    DomTreeUpdater* DTU = nullptr,
    LoopInfo* LI = nullptr,
    BranchProbabilityInfo* BPI = nullptr);

Description

This optimization may add basic blocks immediately after BB; for obvious reasons, you shouldn't pass those blocks to bypassSlowDivision.

Return Value

True if any division or remainder in BB was rewritten.

Parameters

Name

Description

BB

Basic block whose divisions may be bypassed.

BypassWidth

Map from operand bit width to profitable bypass width.

DTU

Optional dominator‐tree updater for CFG changes.

LI

Optional loop info to keep in sync with CFG changes.

BPI

Optional branch probabilities for inserted bypass branches.

Created with MrDocs