Remove BitVector binops.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 14 May 2012 15:37:25 +0000 (15:37 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 14 May 2012 15:37:25 +0000 (15:37 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156767 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/BitVector.h

index bf6d76fbcc3194ec54b5998a4d22e81d4ce5fc31..23aad6e119cdffcd49290e17a701e8bd86df5520 100644 (file)
@@ -482,24 +482,6 @@ private:
   }
 };
 
-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 {