Commit Graph

11097 Commits

Author SHA1 Message Date
Chris Lattner 9c431f6c44 Simplify the code a bit by making the collection of basic blocks to extract
a member of the class.  While we're at it, turn the collection into a set
instead of a vector to improve efficiency and make queries simpler.

llvm-svn: 12400
2004-03-14 22:34:55 +00:00
Chris Lattner 99e9b17641 New testcase that crashes the loop extractor
llvm-svn: 12399
2004-03-14 22:16:52 +00:00
Chris Lattner bcec7875fb After reducing a miscompiled program down to the functions which are being
miscompiled, try to use the loop extractor to reduce the program down to a
loop nest that is being miscompiled.  In practice, the loop extractor appears
to have too many bugs for this to be useful, but hopefully they will be fixed
soon...

llvm-svn: 12398
2004-03-14 22:08:00 +00:00
Chris Lattner 0e6549b8c7 Fix a minor bug in runPassesOn
llvm-svn: 12397
2004-03-14 21:37:41 +00:00
Chris Lattner 37117a0f6a Add a new "AutoDebugCrashes" option
llvm-svn: 12396
2004-03-14 21:21:57 +00:00
Chris Lattner 6ce2d03352 Refactor to use a new method
llvm-svn: 12395
2004-03-14 21:17:22 +00:00
Chris Lattner 1a5c540c27 Add new method
llvm-svn: 12394
2004-03-14 21:17:03 +00:00
Chris Lattner fd72bed301 Refactor and clean up a bunch more code. No major functionality changes.
* Make several methods of bugdriver global functions (ParseInputFile, PrintFunctionList)
 * Make PrintFunctionList truncate the output after 10 entries, like the crash debugger
   did.  This allows code sharing.
 * Add a couple of methods to BugDriver that allows us to eliminate some friends
 * Improve comments in ExtractFunction.cpp
 * Make classes that used to be friends up bugdriver now live in anon namespaces
 * Rip a bunch of functionality in the miscompilation tester into a new
   TestMergedProgram function for future code sharing.
 * Fix a bug in the miscompilation tester induced in my last checkin

llvm-svn: 12393
2004-03-14 20:50:42 +00:00
Alkis Evlogimenos 4837f6c0d9 Another API change to MRegisterInfo::foldMemoryOperand. Instead of a
MachineBasicBlock::iterator take a MachineInstr*.

llvm-svn: 12392
2004-03-14 20:14:27 +00:00
Chris Lattner 3fe96bc9fd Add a method to extract a loop
llvm-svn: 12391
2004-03-14 20:02:07 +00:00
Chris Lattner a1672c1bd8 Split into two passes. Now there is the general loop extractor, usable on
the command line, and the single loop extractor, usable by bugpoint

llvm-svn: 12390
2004-03-14 20:01:36 +00:00
Chris Lattner f624c99379 Rename createLoopExtractorPass to createSingleLoopExtractorPass
Doxygenify

llvm-svn: 12389
2004-03-14 20:00:37 +00:00
Chris Lattner 5a5e414bc0 add a fixme
llvm-svn: 12388
2004-03-14 19:31:00 +00:00
Chris Lattner 567543f09e Refactor all of the "splitting a module into two pieces" code to avoid
code duplication.  Also, don't use ReduceMiscompilingFunctions::TestFuncs
to print out the final message.

llvm-svn: 12387
2004-03-14 19:27:19 +00:00
Alkis Evlogimenos 48da2f8a6d Change MRegisterInfo::foldMemoryOperand to return the folded
instruction to make the API more flexible.

llvm-svn: 12386
2004-03-14 07:19:51 +00:00
Chris Lattner 0137de5ecb Passes don't print stuff!
llvm-svn: 12385
2004-03-14 04:17:53 +00:00
Chris Lattner b68659552a Do not create empty basic blocks when the lowerswitch pass expects blocks to
be non-empty!  This fixes LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll

llvm-svn: 12384
2004-03-14 04:14:31 +00:00
Chris Lattner e7ae4a8cb4 New testcase that crashes the -lowerswitch pass
llvm-svn: 12383
2004-03-14 04:13:57 +00:00
Chris Lattner 4fca71eb44 Minor random cleanups
llvm-svn: 12382
2004-03-14 04:01:47 +00:00
Chris Lattner 6c3e8c78cf FunctionPass's should not define their own 'run' method.
Require 'simplified' loops, not just raw natural loops.  This fixes
CodeExtractor/2004-03-13-LoopExtractorCrash.ll

llvm-svn: 12381
2004-03-14 04:01:06 +00:00
Chris Lattner d078812f96 If a block is dead, dominators will not be calculated for it. Because of this
loop information won't see it, and we could have unreachable blocks pointing to
the non-header node of blocks in a natural loop.  This isn't tidy, so have the
loopsimplify pass clean it up.

llvm-svn: 12380
2004-03-14 03:59:22 +00:00
Chris Lattner 9ece94b02b Catch some more cases of broken code. The loop extractor seems to be creating
situations where there is a branch that goes to a block in another function.

llvm-svn: 12379
2004-03-14 03:23:54 +00:00
Chris Lattner 3684469326 Verify functions as they are produced if -debug is specified. Reduce
curly braceage

llvm-svn: 12378
2004-03-14 03:17:22 +00:00
Chris Lattner b870ca7766 verifyFunction has been broken for a long time now. Fix it.
llvm-svn: 12377
2004-03-14 03:16:15 +00:00
Chris Lattner d828ad5089 New testcase that crashes the loop extractor
llvm-svn: 12376
2004-03-14 03:03:59 +00:00
Chris Lattner 78a996aec4 Move prototype to IPO.h instead of Scalar.h
Make sure that the file interface header (IPO.h) is included first
remove dead #incldue

llvm-svn: 12375
2004-03-14 02:37:16 +00:00
Chris Lattner 6d24a7ce8a Move loop extractor to the IPO header
llvm-svn: 12374
2004-03-14 02:36:34 +00:00
Chris Lattner 692a47aeb9 Indent anon namespace properly, add copyright block
llvm-svn: 12373
2004-03-14 02:34:07 +00:00
Chris Lattner 41ec709e00 Move to the IPO library. Utils shouldn't contain passes.
llvm-svn: 12372
2004-03-14 02:32:27 +00:00
Chris Lattner 96a7fbd503 Remove dead file
llvm-svn: 12371
2004-03-14 02:13:57 +00:00
Chris Lattner 8eebc49884 DemoteRegToStack got moved from DemoteRegToStack.h to Local.h
llvm-svn: 12368
2004-03-14 02:13:38 +00:00
Chris Lattner 3b18771d9f Move DemoteRegToStack prototype out of DemoteRegToStack.h to this file.
llvm-svn: 12367
2004-03-14 02:13:07 +00:00
Chris Lattner b911de4c39 Document stuff that is known to be broken
llvm-svn: 12366
2004-03-14 02:03:02 +00:00
Chris Lattner 7d2a539735 Add some debugging output
Fix InstCombine/2004-03-13-InstCombineInfLoop.ll which caused an infinite
loop compiling (I think) povray.

llvm-svn: 12365
2004-03-13 23:54:27 +00:00
Chris Lattner e561cb51de New testcase, distilled from povray I think.
llvm-svn: 12364
2004-03-13 23:53:04 +00:00
Chris Lattner 2dc85b27e4 This change makes two big adjustments.
* Be a lot more accurate about what the effects will be when inlining a call
   to a function when an argument is an alloca.
 * Dramatically reduce the penalty for inlining a call in a large function.
   This heuristic made it almost impossible to inline a function into a large
   function, no matter how small the callee is.

llvm-svn: 12363
2004-03-13 23:15:45 +00:00
Chris Lattner 797cb2f6c1 This little patch speeds up the loop used to update the dominator set analysis.
On the testcase from GCC PR12440, which has a LOT of loops (1392 of which require
preheaders to be inserted), this speeds up the loopsimplify pass from 1.931s to
0.1875s.  The loop in question goes from 1.65s -> 0.0097s, which isn't bad. All of
these times are a debug build.

This adds a dependency on DominatorTree analysis that was not there before, but
we always had dominatortree available anyway, because LICM requires both loop
simplify and DT, so this doesn't add any extra analysis in practice.

llvm-svn: 12362
2004-03-13 22:01:26 +00:00
Chris Lattner 024385ba5f Turn on argument promotion in gccas. This can give us substantially better
code in cases where the file has lots of static functions or anon namespaces.

llvm-svn: 12361
2004-03-13 21:38:35 +00:00
Chris Lattner 84d0f63804 Option no more
llvm-svn: 12360
2004-03-13 19:36:30 +00:00
Chris Lattner 0ee372cfe3 Fix the "infinite looping unless you disable adce" bug
Also remove an option to disable adce :)

llvm-svn: 12359
2004-03-13 19:35:54 +00:00
Chris Lattner 652eb53dad Fix a tiny bug that caused an incorrect assertion failure poolallocating
boxed-sim.

llvm-svn: 12358
2004-03-13 01:14:23 +00:00
Chris Lattner 699aa70f0c It helps if I save the file. :)
llvm-svn: 12357
2004-03-13 00:24:52 +00:00
Chris Lattner 071a5e5649 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.

llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Chris Lattner 022167f13b Implement sub.ll:test14
llvm-svn: 12355
2004-03-13 00:11:49 +00:00
Chris Lattner d689a5eb9c Oh right, casts can interfere. Test this too
llvm-svn: 12354
2004-03-13 00:11:38 +00:00
Chris Lattner 92295c5031 Implement InstCombine/sub.ll:test12 & test13
llvm-svn: 12353
2004-03-12 23:53:13 +00:00
Chris Lattner b4e933ba14 new testcases
llvm-svn: 12352
2004-03-12 23:52:51 +00:00
Chris Lattner f9e69b4553 Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null

llvm-svn: 12351
2004-03-12 23:12:55 +00:00
John Criswell 13875932b2 Performed some updates on the new options to these command line tools.
llvm-svn: 12350
2004-03-12 22:45:35 +00:00
Chris Lattner a036253872 Implement mod/ref analysis for a trivial case where locals don't escape.
This comes up when you have a local array on the stack and you never pass
the address of elements around.

llvm-svn: 12349
2004-03-12 22:39:00 +00:00