[llvm] r233881 - Fix a bug indicated by -fsanitize=shift-exponent.
Alexey Samsonov
vonosmas at gmail.com
Wed Apr 1 18:30:10 PDT 2015
Author: samsonov
Date: Wed Apr 1 20:30:10 2015
New Revision: 233881
URL: http://llvm.org/viewvc/llvm-project?rev=233881&view=rev
Log:
Fix a bug indicated by -fsanitize=shift-exponent.
Modified:
llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp?rev=233881&r1=233880&r2=233881&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp Wed Apr 1 20:30:10 2015
@@ -320,7 +320,7 @@ bool llvm::UnrollRuntimeLoopProlog(Loop
// This constraint lets us deal with an overflowing trip count easily; see the
// comment on ModVal below. This check is equivalent to `Log2(Count) <
// BEWidth`.
- if (static_cast<uint64_t>(Count) > (1ULL << BEWidth))
+ if (BEWidth < 64 && static_cast<uint64_t>(Count) > (1ULL << BEWidth))
return false;
// If this loop is nested, then the loop unroller changes the code in
More information about the llvm-commits
mailing list