Commit Graph

18 Commits

Author SHA1 Message Date
Chris Lattner 3d1ca67fdd Two minor improvements:
1. Get rid of the silly abort block.  When doing bb extraction, we get one
     abort block for every block extracted, which is kinda annoying.
  2. If the switch ends up having a single destination, turn it into an
     unconditional branch.

I would like to add support for conditional branches, but to do this we will
want to have the function return a bool instead of a ushort.

llvm-svn: 13478
2004-05-12 03:22:33 +00:00
Misha Brukman 3596f0a180 * Allow aggregating extracted function arguments (controlled by flag)
* Commandline option (for now) controls that flag that is passed in

llvm-svn: 13141
2004-04-23 23:54:17 +00:00
Chris Lattner 232155dc1b Fix bug: CodeExtractor/2004-03-17-MissedLiveIns.ll
With this fix we now successfully extract all 149 loops from 256.bzip2 without
crashing or miscompiling the program!

llvm-svn: 12493
2004-03-18 05:56:32 +00:00
Chris Lattner acd75986ee Fix CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll
llvm-svn: 12489
2004-03-18 05:38:31 +00:00
Chris Lattner 320d59f4cd Seriously simplify and correct the PHI node handling code.
llvm-svn: 12487
2004-03-18 05:28:49 +00:00
Chris Lattner d8017a340d Fix CodeExtractor/2004-03-17-OutputMismatch.ll
llvm-svn: 12486
2004-03-18 04:12:05 +00:00
Chris Lattner 37de257ef0 Fix several bugs in the extractor:
1. Names were not put on the new arguments created (ok, this just helps sanity :)
2. Fix outgoing pointer values
3. Do not insert stores for values that had not been computed
4. Fix some wierd problems with the outset calculation

This fixes CodeExtractor/2004-03-14-DominanceProblem.ll, making the extractor
work on at least one simple case!

llvm-svn: 12484
2004-03-18 03:49:40 +00:00
Chris Lattner cee3404d0a Prune #includes, moving the module interface to the front. Note that this
exposed the fact that the header was not self-contained.  There is a reason
we do things :)

llvm-svn: 12481
2004-03-18 03:15:29 +00:00
Chris Lattner fb87cdecd8 Mostly cosmetic improvements. Do fix the bug where a global value was considered an input.
llvm-svn: 12406
2004-03-15 01:26:44 +00:00
Chris Lattner 73ab1fa7c8 Assert that input blocks meet the invariants we expect
Simplify the input/output finder.  All elements of a basic block are
instructions.  Any used arguments are also inputs.  An instruction can only
be used by another instruction.

llvm-svn: 12405
2004-03-15 01:18:23 +00:00
Chris Lattner 5b2072ecd3 No correctness fixes here, just minor qoi fixes:
* Don't insert a branch to the switch instruction after the call, just
  make it a single block.
* Insert the new alloca instructions in the entry block of the original
  function instead of having them execute dynamically
* Don't make the default edge of the switch instruction go back to the switch.
  The loop extractor shouldn't create new loops!
* Give meaningful names to the alloca slots and the reload instructions
* Some minor code simplifications

llvm-svn: 12402
2004-03-14 23:43:24 +00:00
Chris Lattner b4d8bf365c Simplify code a bit, and fix bug CodeExtractor/2004-03-14-NoSwitchSupport.ll
This also implements a two minor improvements:
  * Don't insert live-out stores IN the region, insert them on the code path
    that exits the region
  * If the region is exited to the same block from multiple paths, share the
    switch statement entry, live-out store code, and the basic block.

llvm-svn: 12401
2004-03-14 23:05:49 +00:00
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 4fca71eb44 Minor random cleanups
llvm-svn: 12382
2004-03-14 04:01:47 +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
Misha Brukman f44acae31e Implement ExtractCodeRegion()
llvm-svn: 12070
2004-03-02 00:20:57 +00:00
Misha Brukman 5af2be7d09 * Add implementation of ExtractBasicBlock()
* Add comments to ExtractLoop()

llvm-svn: 12053
2004-03-01 18:28:34 +00:00
Misha Brukman caa1a5abeb A generic code extractor: given a list of BasicBlocks, it will rip them out into
a new function, taking care of inputs and outputs.

llvm-svn: 11935
2004-02-28 03:26:20 +00:00