[llvm-commits] [llvm] r151918 - /llvm/trunk/include/llvm/ADT/Hashing.h

Benjamin Kramer benny.kra at googlemail.com
Fri Mar 2 07:34:36 PST 2012


Author: d0k
Date: Fri Mar  2 09:34:35 2012
New Revision: 151918

URL: http://llvm.org/viewvc/llvm-project?rev=151918&view=rev
Log:
Hashing: microoptimize a truncate on 64 bit away. This currently blocks dead code eliminating the conditional.

The optimizer should handle this eventually, but currently LVI isn't really designed for this kind of stuff.

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

Modified: llvm/trunk/include/llvm/ADT/Hashing.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Hashing.h?rev=151918&r1=151917&r2=151918&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Hashing.h (original)
+++ llvm/trunk/include/llvm/ADT/Hashing.h Fri Mar  2 09:34:35 2012
@@ -173,7 +173,7 @@
 /// \brief Bitwise right rotate.
 /// Normally this will compile to a single instruction, especially if the
 /// shift is a manifest constant.
-inline uint64_t rotate(uint64_t val, unsigned shift) {
+inline uint64_t rotate(uint64_t val, size_t shift) {
   // Avoid shifting by 64: doing so yields an undefined result.
   return shift == 0 ? val : ((val >> shift) | (val << (64 - shift)));
 }





More information about the llvm-commits mailing list