Exponential expansion in IndVarSimplify/ScalarEvolutionExpander
| Bugzilla Link | 31543 |
| Version | trunk |
| OS | Linux |
| Attachments | reduced ll file that gives exponential expansion with opt |
| CC | @hfinkel,@mikaelholmen |
Extended Description
File size of output file and time taken by opt is an exponential function of a loop iteration count for the attached file:
opt -S -O1 -o foo.opt.ll foo.ll
alternatively, if -O1 is expanded and reduced:
opt -S -instcombine -loop-rotate -licm -instcombine -indvars -o foo.opt.ll foo.ll
It's IndVarSimplify::rewriteLoopExitValues() that calls ScalarEvolutionExpander to calculate loop exit value, but the expansion becomes exponential.
If I change the loop iteration count on this line:
%_tmp12 = icmp slt i16 %_tmp11, 6
The output ll file grows and compilation time lengthens exponentially. Some sample values:
bound file size of foo.opt.ll 6 4912 7 8944 8 17088 .. 15 2065266
This issue does not reproduce anymore and it may have been solved late February somehow. Closing.
@uabjean Thanks for following up on the issue and closing it!