[PATCH] D42946: Verify profile data confirms large loop trip counts.

Benjamin Kramer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 10:10:23 PST 2018


bkramer added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:8359
+    if (ExitsCount.getActiveBits() <= 32 &&
+        ExitsCount.getZExtValue() < std::numeric_limits<unsigned>::max()) {
+      ExpectedTC = static_cast<unsigned>(ExitsCount.getZExtValue()) + 1;
----------------
mtrofin wrote:
> bkramer wrote:
> > This is now redundant ;)
> Why? getZExtValue() could be 0xffff ffff (getActiveBits() == 32). 
> 
> That would overflow on line 8358.
I see. Off by one. I should've suggested ExitsCount.ult(std::numeric_limits<unsigned>::max()) in that case, which should do the same as your current condition.


Repository:
  rL LLVM

https://reviews.llvm.org/D42946





More information about the llvm-commits mailing list