From 730f1fb5b355c382421a0fbb599145b20543384f Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 2 Mar 2012 15:34:35 +0000 Subject: [PATCH] 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. llvm-svn: 151918 --- include/llvm/ADT/Hashing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/ADT/Hashing.h b/include/llvm/ADT/Hashing.h index 2c270e4ffc5..120f9e56994 100644 --- a/include/llvm/ADT/Hashing.h +++ b/include/llvm/ADT/Hashing.h @@ -173,7 +173,7 @@ static const uint64_t k3 = 0xc949d7c7509e6557ULL; /// \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))); }