llvm.org GIT mirror llvm / 04142bc
Move bypassSlowDivision into the llvm namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163503 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 8 years ago
2 changed file(s) with 14 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1919
2020 #include "llvm/Function.h"
2121
22 namespace llvm {
23
2224 /// This optimization identifies DIV instructions that can be
2325 /// profitably bypassed and carried out with a shorter, faster divide.
24 bool bypassSlowDivision(llvm::Function &F,
25 llvm::Function::iterator &I,
26 const llvm::DenseMap &BypassTypeMap);
26 bool bypassSlowDivision(Function &F,
27 Function::iterator &I,
28 const DenseMap &BypassTypeMap);
29
30 } // End llvm namespace
2731
2832 #endif
2323
2424 using namespace llvm;
2525
26 namespace llvm {
26 namespace {
2727 struct DivOpInfo {
2828 bool SignedOp;
2929 Value *Dividend;
4040 DivPhiNodes(PHINode *InQuotient, PHINode *InRemainder)
4141 : Quotient(InQuotient), Remainder(InRemainder) {}
4242 };
43
43 }
44
45 namespace llvm {
4446 template<>
4547 struct DenseMapInfo {
4648 static bool isEqual(const DivOpInfo &Val1, const DivOpInfo &Val2) {
216218
217219 // bypassSlowDivision - This optimization identifies DIV instructions that can
218220 // be profitably bypassed and carried out with a shorter, faster divide.
219 bool bypassSlowDivision(Function &F,
220 Function::iterator &I,
221 const llvm::DenseMap &BypassTypeMap) {
221 bool llvm::bypassSlowDivision(Function &F,
222 Function::iterator &I,
223 const DenseMap &BypassTypeMap) {
222224 DivCacheTy DivCache;
223225
224226 bool MadeChange = false;