LLVM 17.0.0git
llvm::SignedDivisionByConstantInfo Struct Reference

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

#include "llvm/Support/DivisionByConstantInfo.h"

Collaboration diagram for llvm::SignedDivisionByConstantInfo:
[legend]

## Static Public Member Functions

static SignedDivisionByConstantInfo get (const APInt &D)
Calculate the magic numbers required to implement a signed integer division by a constant as a sequence of multiplies, adds and shifts.

## Public Attributes

APInt Magic
magic number

unsigned ShiftAmount
shift amount

## Detailed Description

Magic data for optimising signed division by a constant.

Definition at line 21 of file DivisionByConstantInfo.h.

## ◆ get()

 SignedDivisionByConstantInfo SignedDivisionByConstantInfo::get ( const APInt & D )
static

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.

Referenced by llvm::TargetLowering::BuildSDIV().

## ◆ Magic

 APInt llvm::SignedDivisionByConstantInfo::Magic

magic number

Definition at line 23 of file DivisionByConstantInfo.h.

Referenced by llvm::TargetLowering::BuildSDIV(), and get().

## ◆ ShiftAmount

 unsigned llvm::SignedDivisionByConstantInfo::ShiftAmount

shift amount

Definition at line 24 of file DivisionByConstantInfo.h.

Referenced by llvm::TargetLowering::BuildSDIV(), and get().

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