[llvm-commits] [llvm] r163503 - in /llvm/trunk: include/llvm/Transforms/Utils/BypassSlowDivision.h lib/Transforms/Utils/BypassSlowDivision.cpp

Benjamin Kramer benny.kra at googlemail.com
Mon Sep 10 04:52:08 PDT 2012


Author: d0k
Date: Mon Sep 10 06:52:08 2012
New Revision: 163503

URL: http://llvm.org/viewvc/llvm-project?rev=163503&view=rev
Log:
Move bypassSlowDivision into the llvm namespace.

Modified:
    llvm/trunk/include/llvm/Transforms/Utils/BypassSlowDivision.h
    llvm/trunk/lib/Transforms/Utils/BypassSlowDivision.cpp

Modified: llvm/trunk/include/llvm/Transforms/Utils/BypassSlowDivision.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/BypassSlowDivision.h?rev=163503&r1=163502&r2=163503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/BypassSlowDivision.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/BypassSlowDivision.h Mon Sep 10 06:52:08 2012
@@ -20,10 +20,14 @@
 
 #include "llvm/Function.h"
 
+namespace llvm {
+
 /// This optimization identifies DIV instructions that can be
 /// profitably bypassed and carried out with a shorter, faster divide.
-bool bypassSlowDivision(llvm::Function &F,
-                        llvm::Function::iterator &I,
-                        const llvm::DenseMap<llvm::Type *, llvm::Type *> &BypassTypeMap);
+bool bypassSlowDivision(Function &F,
+                        Function::iterator &I,
+                        const DenseMap<Type *, Type *> &BypassTypeMap);
+
+} // End llvm namespace
 
 #endif

Modified: llvm/trunk/lib/Transforms/Utils/BypassSlowDivision.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BypassSlowDivision.cpp?rev=163503&r1=163502&r2=163503&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BypassSlowDivision.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BypassSlowDivision.cpp Mon Sep 10 06:52:08 2012
@@ -24,7 +24,7 @@
 
 using namespace llvm;
 
-namespace llvm {
+namespace {
   struct DivOpInfo {
     bool SignedOp;
     Value *Dividend;
@@ -41,7 +41,9 @@
     DivPhiNodes(PHINode *InQuotient, PHINode *InRemainder)
       : Quotient(InQuotient), Remainder(InRemainder) {}
   };
+}
 
+namespace llvm {
   template<>
   struct DenseMapInfo<DivOpInfo> {
     static bool isEqual(const DivOpInfo &Val1, const DivOpInfo &Val2) {
@@ -217,9 +219,9 @@
 
 // bypassSlowDivision - This optimization identifies DIV instructions that can
 // be profitably bypassed and carried out with a shorter, faster divide.
-bool bypassSlowDivision(Function &F,
-                        Function::iterator &I,
-                        const llvm::DenseMap<Type *, Type *> &BypassTypeMap) {
+bool llvm::bypassSlowDivision(Function &F,
+                              Function::iterator &I,
+                              const DenseMap<Type *, Type *> &BypassTypeMap) {
   DivCacheTy DivCache;
 
   bool MadeChange = false;





More information about the llvm-commits mailing list