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
This commit is contained in:
Michael Ilseman
2012-09-18 22:02:40 +00:00
parent b37b6ca4bb
commit d2014649e0
3 changed files with 333 additions and 0 deletions

View File

@@ -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