This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)
ClosedPublic

Authored by szepet on Oct 14 2017, 6:03 AM.

Details

Summary

The loop unrolling feature aims to track the maximum possible steps a loop can make. In order to implement this, it investigates the initial value of the counter variable and the bound number. (There has to be known.)
These numbers are used as llvm::APInts, however, it was not checked if their bitwidths are the same which lead to some crashes.
This revision solves this problem by extending the "shorter" one (to the length of the "longer" one).
For the detailed bug report, see: https://bugs.llvm.org/show_bug.cgi?id=34943

Diff Detail

Repository
rL LLVM

Event Timeline

szepet created this revision.Oct 14 2017, 6:03 AM
This revision is now accepted and ready to land.Oct 18 2017, 4:53 AM
dcoughlin accepted this revision.Oct 20 2017, 10:42 AM

Thanks for fixing this!

This revision was automatically updated to reflect the committed changes.