diff options
author | Michael Ilseman <milseman@apple.com> | 2012-09-18 22:02:40 +0000 |
---|---|---|
committer | Michael Ilseman <milseman@apple.com> | 2012-09-18 22:02:40 +0000 |
commit | d2014649e0fc3c630c7530f6da060618c789d78d (patch) | |
tree | 418a0f86a38d92b73298a5f0826b272a00827b11 /include/llvm/Transforms/Utils/IntegerDivision.h | |
parent | b37b6ca4bb9a46bdf3788e7a45454e1cdeca17bd (diff) | |
download | external_llvm-d2014649e0fc3c630c7530f6da060618c789d78d.zip external_llvm-d2014649e0fc3c630c7530f6da060618c789d78d.tar.gz external_llvm-d2014649e0fc3c630c7530f6da060618c789d78d.tar.bz2 |
New utility for expanding integer division for targets that don't support it.
Implementation derived from compiler-rt's implementation of signed and unsigned integer division.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/IntegerDivision.h')
-rw-r--r-- | include/llvm/Transforms/Utils/IntegerDivision.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/IntegerDivision.h b/include/llvm/Transforms/Utils/IntegerDivision.h new file mode 100644 index 0000000..531ef13 --- /dev/null +++ b/include/llvm/Transforms/Utils/IntegerDivision.h @@ -0,0 +1,26 @@ +//===- llvm/Transforms/Utils/IntegerDivision.h ------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains an implementation of 32bit integer division for targets +// that don't have native support. It's largely derived from compiler-rt's +// implementation of __udivsi3, but hand-tuned for targets that prefer less +// control flow. +// +//===----------------------------------------------------------------------===// + +#ifndef TRANSFORMS_UTILS_INTEGERDIVISION_H +#define TRANSFORMS_UTILS_INTEGERDIVISION_H + +namespace llvm { + + bool expandDivision(BinaryOperator* Div); + +} // End llvm namespace + +#endif |