Commit Graph

61 Commits

Author SHA1 Message Date
David Greene 9b063df40b Ok, third time's the charm. No changes from last time except the CMake
source addition.  Apparently the buildbots were wrong about failures.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

llvm-svn: 100249
2010-04-02 23:17:14 +00:00
Evan Cheng 389525bdea Revert 100204. It broke a bunch of tests and apparently changed what passes are run during codegen.
llvm-svn: 100207
2010-04-02 19:29:15 +00:00
David Greene 8f32cb9fce Let's try this again. Re-apply 100143 including an apparent missing
<string> include.  For some reason the buildbot choked on this while my
builds did not.  It's probably due to a difference in system headers.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

llvm-svn: 100204
2010-04-02 18:46:26 +00:00
Eric Christopher 5342ddaadf Revert r100143.
llvm-svn: 100146
2010-04-01 22:54:42 +00:00
David Greene 6789e21094 Add some switches helpful for debugging:
-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

llvm-svn: 100143
2010-04-01 22:43:57 +00:00
Benjamin Kramer f4512a3a9d s/getNameStr/getName/
llvm-svn: 100011
2010-03-31 16:06:22 +00:00
Chris Lattner 707431cf26 reapply my timer rewrite with a change for PassManager to store
timers by pointer instead of by-value.

llvm-svn: 99871
2010-03-30 04:03:22 +00:00
Chris Lattner ec8ef9b643 revert r99862 which is causing FNT failures.
llvm-svn: 99870
2010-03-30 03:57:00 +00:00
Chris Lattner 57a0542397 fairly major rewrite of various timing related stuff.
llvm-svn: 99862
2010-03-30 02:38:19 +00:00
Chris Lattner 9efd4fcceb eliminate a bunch more unneeded dynamic_cast's.
llvm-svn: 94156
2010-01-22 05:37:10 +00:00
Dan Gohman 86dc886584 Fix this debug output to handle the case where the loop has been deleted.
llvm-svn: 82994
2009-09-28 15:40:01 +00:00
Dan Gohman 0bd312afd8 Include the name of the loop header in debug messages.
llvm-svn: 82993
2009-09-28 15:07:18 +00:00
Dan Gohman 4dbb301f17 Move the dominator verification code out of special code embedded within
the PassManager code into a regular verifyAnalysis method.

Also, reorganize loop verification. Make the LoopPass infrastructure
call verifyLoop as needed instead of having LoopInfo::verifyAnalysis
check every loop in the function after each looop pass. Add a new
command-line argument, -verify-loop-info, to enable the expensive
full checking.

llvm-svn: 82952
2009-09-28 00:27:48 +00:00
Dan Gohman 2963777d0c Move this assert to check the condition as soon as it is known.
llvm-svn: 82951
2009-09-28 00:10:28 +00:00
Dan Gohman 277e767578 Extend the StartPassTimer and StopPassTimer functions so that the
code that stops the timer doesn't have to search to find the timer
object before it stops the timer. This avoids a lock acquisition
and a few other things done with the timer running.

llvm-svn: 82949
2009-09-28 00:07:05 +00:00
Dan Gohman b0934cdd1c Fix an old copy+pasto.
llvm-svn: 82947
2009-09-27 23:52:07 +00:00
Dan Gohman adde5dfde2 Extract the code for inserting a loop into the loop queue into
a separate function.

llvm-svn: 82946
2009-09-27 23:49:43 +00:00
Dan Gohman 37a99664ff When a loop is deleted, immediately release all of the active
LoopPasses for that loop. This avoids trouble with the PassManager
trying to call verifyAnalysis on them, and frees up some memory
sooner rather than later.

llvm-svn: 82945
2009-09-27 23:43:07 +00:00
Dan Gohman cb663d749d Delete a bogus comment.
llvm-svn: 82908
2009-09-27 17:50:44 +00:00
Dan Gohman 96a26bd35a Don't try to verify a LoopPass analysis if the loop has been deleted.
llvm-svn: 80919
2009-09-03 15:09:24 +00:00
Chris Lattner 4883d90396 convert LoopInfo.h and GraphWriter.h to use raw_ostream
llvm-svn: 79836
2009-08-23 07:19:13 +00:00
Torok Edwin 24c7835d19 Call doInitialization(), releaseMemory(), and doFinalization() for on-the-fly passes as well.
Also don't call finalizers for LoopPass if initialization was not called.
Add a unittest that tests that these methods are called, in the proper
order, and the correct number of times.

llvm-svn: 74438
2009-06-29 18:49:09 +00:00
Devang Patel 4555618854 Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block.
llvm-svn: 67719
2009-03-25 23:57:48 +00:00
Chris Lattner 4c1e9541d3 Sprinkle some PrettyStackEntry magic into the passmanager. With this, we now
get nice and happy stack traces when we crash in an optimizer or codegen.  For
example, an abort put in UnswitchLoops now looks like this:

Stack dump:
0.	Program arguments: clang pr3399.c -S -O3 
1.	<eof> parser at end of file
2.	per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'pr3399.c'.
4.	Running pass 'Loop Pass Manager' on function '@foo'
5.	Running pass 'Unswitch loops' on basic block '%for.inc'
Abort

llvm-svn: 66260
2009-03-06 06:45:05 +00:00
Dan Gohman 4330034160 Add a method to ScalarEvolution for telling it when a loop has been
modified in a way that may effect the trip count calculation. Change
IndVars to use this method when it rewrites pointer or floating-point
induction variables instead of using a doInitialization method to
sneak these changes in before ScalarEvolution has a chance to see
the loop. This eliminates the need for LoopPass to depend on
ScalarEvolution.

llvm-svn: 64810
2009-02-17 20:49:49 +00:00
Dan Gohman 143206d07b Move dumpPassStructure out of line.
llvm-svn: 64796
2009-02-17 19:41:26 +00:00
Dan Gohman a79db30d28 Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Chris Lattner 4c493d9a58 Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.

llvm-svn: 54528
2008-08-08 15:14:09 +00:00
Dan Gohman 0e52a0c89e Fix spelling of "hierarchy" in comments.
llvm-svn: 53489
2008-07-11 22:51:32 +00:00
Devang Patel 874a3a0b0d Keep track of inherited analysis (e.g. dominator tree).
llvm-svn: 53088
2008-07-03 07:02:30 +00:00
Devang Patel 67c79a4992 Fix typos in comments.
Thanks for the feedback!

llvm-svn: 52978
2008-07-01 19:50:56 +00:00
Devang Patel 9dbe4d15ec Add dom info verifier.
llvm-svn: 52967
2008-07-01 17:44:24 +00:00
Chris Lattner f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Dan Gohman c731c97fac Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().

llvm-svn: 42585
2007-10-03 19:26:29 +00:00
Devang Patel ee35011d01 ooops...
llvm-svn: 42118
2007-09-18 23:58:14 +00:00
Anton Korobeynikov 5849a625ff - Use correct header for SCEV inside LoopPass.cpp
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug

llvm-svn: 41197
2007-08-20 21:17:26 +00:00
Devang Patel cc2b233b62 Introduce Simple Analysis interface for loop passes.
Right now, this interface provides hooks for only to operations, 1) clone basic block 2) delete value.

llvm-svn: 40625
2007-07-31 08:00:57 +00:00
Devang Patel a273d1cd3a Verify loop info.
llvm-svn: 40062
2007-07-19 18:02:32 +00:00
Duncan Sands 60f28bff4c Replace mysterious code causing a g++-4.2 warning
with hopefully correct code that pleases g++-4.2.

llvm-svn: 40051
2007-07-19 09:42:01 +00:00
Devang Patel 88197332e7 Add loop info verification mechanism.
llvm-svn: 37822
2007-06-29 23:13:42 +00:00
Devang Patel 8c78a0bff0 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel e95c6ad802 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel 09f162ca6a Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Devang Patel 2ac57e1f02 Now IndVarSimplify is a LoopPass.
llvm-svn: 35003
2007-03-07 06:39:01 +00:00
Devang Patel 901a27d892 Now LoopUnswitch is a LoopPass.
llvm-svn: 34992
2007-03-07 00:26:10 +00:00
Devang Patel db0db9740b Insert loop into LQ before visiting children.
llvm-svn: 34982
2007-03-06 19:50:49 +00:00
Devang Patel 4a8725cf2f Use schedulePass() instead of assignPassManager() to add new LPPassManager.
This ensures that require analysis info is available.

llvm-svn: 34980
2007-03-06 19:11:25 +00:00
Devang Patel ef7ac13406 Add LPPassManager::insertLoop().
llvm-svn: 34979
2007-03-06 19:00:02 +00:00
Devang Patel fca3aa3645 LPPassManager::deleteLoopFromQueue() add meat. Cut-n-paste code from
LoopUnswitch pass.

llvm-svn: 34977
2007-03-06 18:38:33 +00:00
Devang Patel 1699384509 LPPassManager. Implement preparePassManager() hook.
llvm-svn: 34975
2007-03-06 17:59:37 +00:00