Chris Lattner
6b736d8b32
foo bug291 bar PR 291
...
llvm-svn: 12430
2004-03-16 05:17:07 +00:00
Chris Lattner
29db00a4e0
PR291
...
Bug 291!
llvm-svn: 12429
2004-03-16 05:16:05 +00:00
Chris Lattner
cf2608c0e9
// Testcase from Bug 291
...
llvm-svn: 12428
2004-03-16 05:14:47 +00:00
Chris Lattner
8ad948ddbd
Add some missing functions. Make sure to handle calls together in case the
...
client has another VN implementation that can VN calls.
llvm-svn: 12427
2004-03-16 03:41:35 +00:00
Chris Lattner
8726ebd326
Fix thinko, and PR292
...
llvm-svn: 12426
2004-03-16 01:51:54 +00:00
Chris Lattner
e0b49952f6
Fix PR294
...
llvm-svn: 12425
2004-03-16 01:45:55 +00:00
Alkis Evlogimenos
804dc659b6
Add LAHF instruction
...
llvm-svn: 12424
2004-03-15 17:20:14 +00:00
Chris Lattner
95ce36da0d
Restore old inlining heuristic. As the comment indicates, this is a nasty
...
horrible hack.
llvm-svn: 12423
2004-03-15 06:38:14 +00:00
Chris Lattner
7f04ebc858
Ok, the assertion was bogus. Calls that do not read/write memory should not
...
have an alias set, just like adds and subtracts don't.
llvm-svn: 12422
2004-03-15 06:28:07 +00:00
Chris Lattner
f5c8f4cea6
This assertion is bogus now that calls do not necessarily read/write memory
...
llvm-svn: 12421
2004-03-15 06:24:15 +00:00
Chris Lattner
cd83282df1
Add counters for the number of calls elimianted
...
llvm-svn: 12420
2004-03-15 05:46:59 +00:00
Chris Lattner
53a3587997
Implement CSE of call instructions in the most trivial case. This implements
...
GCSE/call_cse.ll
llvm-svn: 12419
2004-03-15 05:44:59 +00:00
Chris Lattner
2c8efdb348
New testcase for CSE of call instructions
...
llvm-svn: 12418
2004-03-15 05:44:29 +00:00
Chris Lattner
ea42c857d6
Fix a minor bug, implementing GCSE/call_pure_function.ll
...
Also, add some stuff I missed before.
llvm-svn: 12417
2004-03-15 04:18:28 +00:00
Chris Lattner
ecdbee5542
Make sure that pure calls don't kill loads
...
llvm-svn: 12416
2004-03-15 04:17:53 +00:00
Chris Lattner
20cda2645e
Implement LICM of calls in simple cases. This is sufficient to move around
...
sin/cos/strlen calls and stuff. This implements:
LICM/call_sink_pure_function.ll
LICM/call_sink_const_function.ll
llvm-svn: 12415
2004-03-15 04:11:30 +00:00
Chris Lattner
fb5d561193
New testcases to test LICM of call instructions
...
llvm-svn: 12414
2004-03-15 04:10:08 +00:00
Chris Lattner
21c60f1549
Don't be COMPLETELY pessimistic in the face of function calls
...
llvm-svn: 12413
2004-03-15 04:08:36 +00:00
Chris Lattner
2f87d5872f
Tweak argument
...
llvm-svn: 12412
2004-03-15 04:08:18 +00:00
Chris Lattner
f4c9028b06
Deinline a couple of methods. Improve comment.
...
llvm-svn: 12411
2004-03-15 04:07:59 +00:00
Chris Lattner
a67dbd02cf
Deinline some virtual methods, provide better mod/ref answers through the
...
use of the boolean queries
llvm-svn: 12410
2004-03-15 04:07:29 +00:00
Chris Lattner
d441444234
Pass through the boolean queries
...
llvm-svn: 12409
2004-03-15 04:06:46 +00:00
Chris Lattner
d82256a7a1
Teach basicaa about some stdc functions.
...
llvm-svn: 12408
2004-03-15 03:36:49 +00:00
Chris Lattner
41ab361ae2
Add two new methods which can be used to enable a bunch of transformations
...
in common cases.
llvm-svn: 12407
2004-03-15 01:58:54 +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
fec74e7ce2
New testcase that causes the code extractor to generate bogus code.
...
llvm-svn: 12404
2004-03-15 00:08:49 +00:00
Chris Lattner
2f155d8734
Fix several bugs in the loop extractor. In particular, subloops were never
...
extracted, and a function that contained a single top-level loop never had
the loop extracted, regardless of how much non-loop code there was.
llvm-svn: 12403
2004-03-15 00:02:02 +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
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