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

Thomas Jablin tjablin at gmail.com
Fri Aug 29 17:15:53 PDT 2014


I have made the changes you suggested. The code is functionally equivalent to the original version, but the design of the original version is a bit unclear to me. Basically, the code is trying to combine many AddRecs into a single expression. The run-time is "only" N^2 in the size of Ops, because the second and third loop levels share indexes. I think the underlying issue is the expensive recursive calls to getMulExpr in the inner-most loop.

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.13119.patch
Type: text/x-patch
Size: 4642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140830/72eb0cdb/attachment.bin>


More information about the llvm-commits mailing list