Owen Anderson
d85c9ccdba
Lower the unrolling theshold to 150. Empirical tests indicate that this is a sweet spot in the performance per
...
code size increase curve.
llvm-svn: 113595
2010-09-10 17:57:00 +00:00
Owen Anderson
04cf3fd761
What the loop unroller cares about, rather than just not unrolling loops with calls, is
...
not unrolling loops that contain calls that would be better off getting inlined. This mostly
comes up when an interleaved devirtualization pass has devirtualized a call which the inliner
will inline on a future pass. Thus, rather than blocking all loops containing calls, add
a metric for "inline candidate calls" and block loops containing those instead.
llvm-svn: 113535
2010-09-09 20:32:23 +00:00
Owen Anderson
6270515918
Revert r113439, which relaxed the requirement that loops containing calls cannot be unrolled. After some discussion,
...
there seems to be a better way to achieve the same effect.
llvm-svn: 113528
2010-09-09 20:02:23 +00:00
Owen Anderson
11ab204fdc
r113526 introduced an unintended change to the loop unrolling threshold. Revert it.
...
llvm-svn: 113527
2010-09-09 19:11:57 +00:00
Owen Anderson
b61b1647e2
Fix typo in code to cap the loop code size reduction calculation.
...
llvm-svn: 113526
2010-09-09 19:08:59 +00:00
Owen Anderson
62ea1b718c
Use code-size reduction metrics to estimate the amount of savings we'll get when we unroll a loop.
...
Next step is to recalculate the threshold values given this new heuristic.
llvm-svn: 113525
2010-09-09 19:07:31 +00:00
Owen Anderson
8084dbaf8e
Relax the "don't unroll loops containing calls" rule. Instead, when a loop contains a call, lower the
...
unrolling threshold to the optimize-for-size threshold. Basically, for loops containing calls, unrolling
can still be profitable as long as the loop is REALLY small.
llvm-svn: 113439
2010-09-08 23:10:07 +00:00
Owen Anderson
a4d9c78aa1
Add a separate unrolling threshold when the current function is being optimized for size.
...
The threshold value of 50 is arbitrary, and I chose it simply by analogy to the inlining thresholds, where
the baseline unrolling threshold is slightly smaller than the baseline inlining threshold. This could
undoubtedly use some tuning.
llvm-svn: 113306
2010-09-07 23:15:30 +00:00
Chris Lattner
d6f46b8af8
now that loop passes don't use DomFrontier, there is no reason
...
for the unroller to pretend it supports updating it. It still
has a horrible hack for DomTree.
llvm-svn: 112444
2010-08-29 17:21:35 +00:00
Owen Anderson
a7aed18624
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
bda59bd247
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
755aceb5d0
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Owen Anderson
9f2bca02d7
Experiments show that we can safely increase our unrolling threshold without unduly impacting code size, particularly
...
since unrolling is not enabled at -Os.
llvm-svn: 110233
2010-08-04 18:32:46 +00:00
Dan Gohman
0141c13b22
Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogus
...
dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier
pass in StandardPasses.h to ensure that it gets scheduled at the right
time.
Declare that loop unrolling preserves ScalarEvolution, and shuffle some
getAnalysisUsages.
This eliminates one LoopSimplify and one LCCSA run in the standard
compile opts sequence.
llvm-svn: 109413
2010-07-26 18:11:16 +00:00
Owen Anderson
a57b97e7e7
Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
...
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Dan Gohman
2734ebd37f
Add a DominatorTree argument to isLCSSA so that it doesn't have to
...
compute a set of reachable blocks for itself each time it is called, which
is fairly frequently.
llvm-svn: 98179
2010-03-10 19:38:49 +00:00
Jakob Stoklund Olesen
5f9ead2714
Don't unroll loops containing function calls.
...
llvm-svn: 95454
2010-02-05 23:21:31 +00:00
David Greene
e0b9789593
Change errs() to dbgs().
...
llvm-svn: 92623
2010-01-05 01:27:44 +00:00
Dan Gohman
969e83a4ff
Replace LoopUnrollPass.cpp's custom code-size estimation code using
...
the new common CodeMetrics code.
llvm-svn: 85663
2009-10-31 14:54:17 +00:00
Dan Gohman
af94015c18
Remove an unnecessary #include.
...
llvm-svn: 85661
2009-10-31 14:39:43 +00:00
Dan Gohman
f70e76c435
Rename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp to
...
LoopUnrollPass.cpp, for consistency with other passes which are
similarly split.
llvm-svn: 85659
2009-10-31 14:37:31 +00:00