1 //===- llvm/Transforms/Utils/IntegerDivision.h ------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains an implementation of 32bit integer division for targets
11 // that don't have native support. It's largely derived from compiler-rt's
12 // implementation of __udivsi3, but hand-tuned for targets that prefer less
15 //===----------------------------------------------------------------------===//
17 #ifndef TRANSFORMS_UTILS_INTEGERDIVISION_H
18 #define TRANSFORMS_UTILS_INTEGERDIVISION_H
26 /// Generate code to divide two integers, replacing Div with the generated
27 /// code. This currently generates code similarly to compiler-rt's
28 /// implementations, but future work includes generating more specialized code
29 /// when more information about the operands are known. Currently only
30 /// implements 32bit scalar division, but future work is removing this
33 /// @brief Replace Div with generated code.
34 bool expandDivision(BinaryOperator* Div);
36 } // End llvm namespace