[PATCH] Exit ScalarEvolution::getMulExpr Early when Choose Overflows

Thomas Jablin tjablin at gmail.com
Thu Aug 28 17:17:59 PDT 2014


Hi atrick,

ScalarEvolution::getMulExpr could take a very long time to execute when there is a long change of dependent multiplication. Worse yet, when the number of operands was very high, Overflow would be set consistently in the middle of the loop, so no progress was actually made in simplifying the SCEV. By testing for overflow early, we can avoid entering the loop in the first place. I have included a test case (choose-overflow-fast.ll) that takes a very long time (probably hours) to execute without this patch. After applying the patch, the test completes in about 1.5 seconds.

http://reviews.llvm.org/D5113

Files:
  lib/Analysis/ScalarEvolution.cpp
  test/Analysis/ScalarEvolution/choose-overflow-fast.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5113.13065.patch
Type: text/x-patch
Size: 4003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140829/ae0c458f/attachment.bin>


More information about the llvm-commits mailing list