LLVM: llvm::SignedDivisionByConstantInfo Struct Reference (original) (raw)

Magic data for optimising signed division by a constant. More...

#include "[llvm/Support/DivisionByConstantInfo.h](DivisionByConstantInfo%5F8h%5Fsource.html)"

Magic data for optimising signed division by a constant.

Definition at line 22 of file DivisionByConstantInfo.h.

get()

Calculate the magic numbers required to implement a signed integer division by a constant as a sequence of multiplies, adds and shifts.

Requires that the divisor not be 0, 1, or -1. Taken from "Hacker's Delight", Henry S. Warren, Jr., Chapter 10.

Definition at line 21 of file DivisionByConstantInfo.cpp.

References assert(), D(), llvm::APInt::getSignedMinValue(), llvm::APInt::isZero(), Magic, llvm::APInt::negate(), P, R2, ShiftAmount, T, llvm::APInt::udivrem(), llvm::APInt::uge(), and llvm::APInt::ult().

Referenced by llvm::TargetLowering::BuildSDIV(), and llvm::CombinerHelper::buildSDivOrSRemUsingMul().

Magic

APInt llvm::SignedDivisionByConstantInfo::Magic

ShiftAmount

unsigned llvm::SignedDivisionByConstantInfo::ShiftAmount


The documentation for this struct was generated from the following files: