[llvm-commits] [llvm] r156767 - /llvm/trunk/include/llvm/ADT/BitVector.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon May 14 08:37:25 PDT 2012


Author: stoklund
Date: Mon May 14 10:37:25 2012
New Revision: 156767

URL: http://llvm.org/viewvc/llvm-project?rev=156767&view=rev
Log:
Remove BitVector binops.

These operators were crazy slow, calling malloc to return a temporary
result. At the same time, they look very innocent when used in code.

If you need temporary BitVectors to compute your thing, create them
explicitly, and use the inplace logical operators. This makes the high
cost explicit in the code.

Modified:
    llvm/trunk/include/llvm/ADT/BitVector.h

Modified: llvm/trunk/include/llvm/ADT/BitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/BitVector.h?rev=156767&r1=156766&r2=156767&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/BitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/BitVector.h Mon May 14 10:37:25 2012
@@ -482,24 +482,6 @@
   }
 };
 
-inline BitVector operator&(const BitVector &LHS, const BitVector &RHS) {
-  BitVector Result(LHS);
-  Result &= RHS;
-  return Result;
-}
-
-inline BitVector operator|(const BitVector &LHS, const BitVector &RHS) {
-  BitVector Result(LHS);
-  Result |= RHS;
-  return Result;
-}
-
-inline BitVector operator^(const BitVector &LHS, const BitVector &RHS) {
-  BitVector Result(LHS);
-  Result ^= RHS;
-  return Result;
-}
-
 } // End llvm namespace
 
 namespace std {





More information about the llvm-commits mailing list