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

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 12:22:10 PST 2018


mtrofin 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;
----------------
bkramer wrote:
> 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.
Ah - thanks, that looks better, indeed!


Repository:
  rL LLVM

https://reviews.llvm.org/D42946





More information about the llvm-commits mailing list