Commit Graph

2724 Commits

Author SHA1 Message Date
Chris Lattner
5113eb0c52 Move the function extractor pass from tools/extract into lib/Xform/IPO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4759 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 18:42:59 +00:00
Chris Lattner
9a641b4bce Add a new Module::getNamedFunction method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4758 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 18:41:44 +00:00
Brian Gaeke
c03a0cb01b Brian Gaeke says:
lib/Target/X86/InstSelectSimple.cpp: Add a little something to
 visitBranchInst which supports conditional branches.
lib/Target/X86/X86InstrInfo.def: Add defs of JNE, JE, CMPri8


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4755 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 09:08:47 +00:00
Nick Hildenbrandt
a1a64f8f27 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4754 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 22:21:52 +00:00
Chris Lattner
8f0d824dd7 Add peak memory usage measurement capability
Add (currently disabled) faciility to try to filter out pool allocation overhead from memory usage stats


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4753 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:47:09 +00:00
Chris Lattner
1855292172 Add peak memory usage measurement stuff
Add structure padding optimizations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4749 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:44:46 +00:00
Chris Lattner
4fe346184a Add peak memory usage support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4748 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:44:19 +00:00
Chris Lattner
49a1ed07ab Add stats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4747 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:42:45 +00:00
Nick Hildenbrandt
9850237536 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4745 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 20:55:50 +00:00
Chris Lattner
f9f6088e17 Start trying to print instructions more correctly. For now we also print out the opcode for each instruction as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4743 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 06:56:51 +00:00
Chris Lattner
f21dfcddcf Expose base opcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4742 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 06:56:24 +00:00
Chris Lattner
6aab9cf65c Start to add more information to instr.def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4741 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 05:37:11 +00:00
Chris Lattner
239dcfd215 Add instruction annotation about whether it has a 0x0F opcode prefix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4740 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 01:59:28 +00:00
Chris Lattner
9213b73c19 Add more void flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4739 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 01:37:48 +00:00
Chris Lattner
92bd0f9c4d Set the void flag on instructions that should get it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4738 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 01:34:36 +00:00
Chris Lattner
af55be15df Print is const!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4737 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 23:22:13 +00:00
Chris Lattner
3b49394f4f Pass on a targetmachine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4736 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 23:22:03 +00:00
Chris Lattner
927dd095c4 Arrange to have a TargetMachine available in X86InstrInfo::print
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4734 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 23:20:37 +00:00
Chris Lattner
e9b309ad13 Wow, I'm incapable of the simplest things today...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4732 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 23:05:21 +00:00
Chris Lattner
fb02a8b11f Rename registers to follow the intel style of all caps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4731 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 23:03:46 +00:00
Chris Lattner
ebdc7f32e9 Fix misleading indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4730 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:57:23 +00:00
Chris Lattner
dbb61c6445 Reorganize printing interface a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4728 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:53:13 +00:00
Chris Lattner
a187ed92ae Add default implementation of printing interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4727 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:53:03 +00:00
Chris Lattner
71e83caecd Fix minor detail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4725 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:33:26 +00:00
Chris Lattner
ed806bf9fc Add hack to only consider indirect calls indirect if they do more than cast
their source function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4723 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:17:12 +00:00
Chris Lattner
ae5f603665 Add MaxSCC statistics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4722 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:16:28 +00:00
Chris Lattner
db85e389ae Count CallInsts correctly, remove unneccesary initializers
S: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4721 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:15:40 +00:00
Chris Lattner
570f55de8d Remove only uses of markDef/markDefAndUse methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4719 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:14:08 +00:00
Chris Lattner
0692536b71 Fix Mul/Div clobbers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4718 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 21:56:38 +00:00
Chris Lattner
6fc3c52359 Fix a few typos, implement load/store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4716 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 21:11:55 +00:00
Chris Lattner
9562add237 Add functions to buld X86 specific constructs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4714 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 21:03:35 +00:00
Chris Lattner
1411ba31ba Add information about memory index representation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4712 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 20:33:26 +00:00
Chris Lattner
e7236ffa94 Add load/store instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 20:33:12 +00:00
Chris Lattner
43189d17c3 Switch visitRet to use getClass()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 20:07:45 +00:00
Brian Gaeke
6559bb96a9 include/llvm/CodeGen/MachineInstrBuilder.h: Add addClobber() inline
convenience method.  Fix typo in comment.
lib/Target/X86/InstSelectSimple.cpp: Explicitly specify some implicit uses.
 Use MOVZX/MOVSX instead of MOV instructions with sign extend instructions.
 Take out LEAVE instructions.
 32-bit IDIV and DIV use CDQ, not CWQ (CWQ is a typo).
 Fix typo in comment and remove some FIXME comments.
lib/Target/X86/Printer.cpp: Include X86InstrInfo.h and llvm/Function.h.
 Add some simple code to Printer::runOnFunction to iterate over
  MachineBasicBlocks and call X86InstrInfo::print().
lib/Target/X86/X86InstrInfo.def: Make some more instructions with
 implicit defs "Void".  Add more sign/zero extending "move" insns
 (movsx, movzx).
lib/Target/X86/X86RegisterInfo.def: Add EFLAGS as a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4707 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-14 22:32:30 +00:00
Dinakar Dhurjati
e555460e4e Gives the count for various instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4706 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-13 18:22:13 +00:00
Vikram S. Adve
586aa3c801 Pass to compute various statisics related to DSGraphs.
For now, this just computes the #indirect call sites and
the avg. #callees per indirect call site (actually it prints
both totals and the average is their ratio).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4705 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-13 15:41:00 +00:00
Chris Lattner
12ae297cbd Fix bug: 2002-11-13-PointerFunction.ll
This should fix codegen on vortex to work much better


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4704 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-13 06:54:20 +00:00
Chris Lattner
5f1f2c6162 Inline graphs from outside the SCC into the SCC before SCC resolution starts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4701 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-12 15:58:08 +00:00
Chris Lattner
5190ce8374 Fix two bugs:
* The globals vector was getting broken and unsorted, this caused vortex
   to get badly pessimized
 * Node offset handling was being handled really poorly, and in particular
   we were not merging types with offsets right.  This causes several graphs
   to be non-merged.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4699 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-12 07:20:45 +00:00
Chris Lattner
3ba8893af5 Fix bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4697 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 22:23:56 +00:00
Chris Lattner
0ecc42619f Handle a mismatch between # function args and call site args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4696 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:36:05 +00:00
Chris Lattner
e425844d8c Elimiante calls to a node with nothing in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4695 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:35:38 +00:00
Chris Lattner
a9c9c0216e Complete rewrite of BU code to use Tarjan's SCC finding algorithm to drive
the algorithm instead of hand coded depth first iteration


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:35:13 +00:00
Brian Gaeke
20abb6bf45 InstSelectSimple.cpp: (visitReturnInst) Add return instructions with return
values.
X86InstrInfo.def: add LEAVE instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4691 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 19:37:09 +00:00
Chris Lattner
e71ffc291c Mark stuff reachable by _AUX_ calls as incomplete in the BU graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4690 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 03:36:55 +00:00
Chris Lattner
8a5db46967 Fix infinite loop in the BU algorithm. Unfortunately this dies a serious
death when handling moderately sized SCC's, but what can you do


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4689 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 00:01:34 +00:00
Chris Lattner
6052594209 Print the right call set size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 00:01:02 +00:00
Chris Lattner
998c49c247 Use call site mergeWith method to simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4687 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 00:00:46 +00:00
Chris Lattner
d11e954f08 Fix a bug that could trigger when varargs call sites had non-matching number of arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4683 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 07:46:08 +00:00
Chris Lattner
aa8146f5c4 * Dramatically rework liveness evaluation.
* Implement the first step of the Globals graph: Deleting nodes from function
  graphs.  In practice, these nodes need to be moved to the globals graph, but
  this will be taken care of later.  Note that the graphs computed right now are
  not strictly correct!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:59:55 +00:00
Chris Lattner
4f7815f684 Honor the shouldPrintAuxCalls flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4678 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:53:59 +00:00
Chris Lattner
2a06886759 Initialize PrintAuxCalls member
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4677 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:53:38 +00:00
Chris Lattner
a1079051d8 * Bottom-Up graphs print the Aux call vector
* Significantly improve DEBUG output
* Aggressively fold calls together if we inlined a graph that provides
  call nodes.
* Add a bailout if the current graph has over 200 call nodes in it, this is
  a really whacky case that should never happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4675 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:52:47 +00:00
Chris Lattner
a2b8d7bff2 Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4668 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 03:36:55 +00:00
Chris Lattner
f40f0a39bd eliminate the ability to remove global nodes from deadNodeElminate... for now.
This slows stuff down a bit, but it should get much better before it gets any
worse.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4666 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 22:07:02 +00:00
Chris Lattner
dd398486ca Remove obsolete code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4665 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:41:44 +00:00
Chris Lattner
f76e754c2e Fix logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4664 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:40:58 +00:00
Chris Lattner
aa0b468f6d Add globals graphs to all three passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:12:07 +00:00
Chris Lattner
7900ed146f Move maskNodeTypes to header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4661 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:02:26 +00:00
Chris Lattner
65f2897f2c Clean up DSGraph::removeDeadNodes interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:00:49 +00:00
Chris Lattner
96517253a1 Make removeTriviallyDeadNodes a private interface of DSGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4659 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:55:24 +00:00
Chris Lattner
2cfbaaf3b9 Don't put constants into the scalar map!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4657 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:14:03 +00:00
Chris Lattner
2e4f9bf86e Add initial support for a globals graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4656 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:01:01 +00:00
Chris Lattner
d888893a54 Tighten up array handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4655 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 19:25:27 +00:00
Chris Lattner
0779ba6c47 #include Datastructure.h first
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4654 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 19:25:10 +00:00
Chris Lattner
0006bd7520 Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 00:49:43 +00:00
Chris Lattner
bf10f05bf7 Fix warning & release build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4648 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 00:49:05 +00:00
Chris Lattner
51c20e9a3a Fix spelling error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 23:18:37 +00:00
Chris Lattner
23f83dce3f Fold arrays down to a single element. This causes huge wins on some benchmarks
for example: 197.parser (64M->14M), 164.gzip (14M->2.7M).  The actual graphs
represented should not change at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 22:49:57 +00:00
Chris Lattner
70925b0569 ONLY merge in the aux call sites, this causes a HUGE speedup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4640 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 22:27:25 +00:00
Chris Lattner
acf491f0b4 Allow specification of whether the call sites should be copied, AND whether
the aux call sites should be copied


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4639 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 22:27:09 +00:00
Chris Lattner
ce2d1328fc Reenable 'quick exit' case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4638 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 22:26:43 +00:00
Chris Lattner
7cc9875c9d Reduce amount of work needed to compute ip/modref
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4637 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 22:17:01 +00:00
Chris Lattner
7a21163cef Reimplement TD pass completely it now works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4635 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 21:28:37 +00:00
Chris Lattner
01fb0c75aa Cannot modify original call sites vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4634 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 21:27:37 +00:00
Chris Lattner
679e8e1b19 - Add a bunch of checking to make sure that dead nodes are not used after they
are marked DEAD.  This helped track down some bugs
- Fix a bunch of bugs where we were doing work on nodes after they became dead
- Add support for aux function call sites
- Add support for not cloning call sites


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4633 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 21:27:12 +00:00
Chris Lattner
1a948a8269 Remove gunk used by broken TD pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4632 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 21:25:24 +00:00
Chris Lattner
93fbd733e7 Use the new getMainFunction() method to efficiently locate main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4630 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 20:34:21 +00:00
Chris Lattner
a9a93f3777 Add a method "getMainFunction()" that efficiently locates 'main' in a module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4629 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 20:34:02 +00:00
Chris Lattner
d321593330 Fix IPModRef to use new DS interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4628 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 19:13:14 +00:00
Chris Lattner
25f6f373b8 Implement feof
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4627 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 19:10:26 +00:00
Chris Lattner
f8c6aab05e Use DSNodeHandleMap instead to be safe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4622 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 05:01:14 +00:00
Chris Lattner
5134006f93 * actually handle constants (especially constantexprs) correctly.
- This seems to dramatically improve many benchmarks, only slowing down
    gzip significantly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4621 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 05:00:44 +00:00
Chris Lattner
33312f7031 Add flush
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4619 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 01:21:07 +00:00
Chris Lattner
6f23963adc Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4618 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 00:38:20 +00:00
Chris Lattner
9c1338b71c _REALLY_ fix the float constant problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4609 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 22:12:53 +00:00
Chris Lattner
eb6f8c757f Print out 'float' constants correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4607 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 19:43:59 +00:00
Chris Lattner
a4479cd946 Implement freopen for burg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4606 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 19:33:50 +00:00
Chris Lattner
ab2dea5687 Make command line arguments setup be endian correct!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4605 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 19:29:31 +00:00
Brian Gaeke
1749d6359b Add instruction selection code and tests for setcc instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4603 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 17:59:21 +00:00
Chris Lattner
ed8e6499dd Implement ResolveCallSiteModRefInfo for IPModRef. computeModRef is not yet done though!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4602 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 07:12:23 +00:00
Chris Lattner
460ea29b45 Instead of using a bool that constant has to be explained, use a self
explanitory enum instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4600 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 07:06:20 +00:00
Chris Lattner
076c1f923b Implement a new mergeInGraph method, which basically factors code out of
the BU class.

This will be used by the IPModRef class to do stuff, eventually perhaps the
TD pass will use it also.

Speaking of the TD pass, this also eliminates the self recursive case, which
was broken, and couldn't occur anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4599 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 06:31:54 +00:00
Chris Lattner
b10604341f Rename DataStructureAnalysis namespace to DS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4596 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 05:20:53 +00:00
Chris Lattner
e83cb5316b Fix problem with dangling referrers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4595 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 05:00:35 +00:00
Chris Lattner
f17b39ab2a Minor bugfix to enable generation of methcall.llvm.lib, objinst.llvm.lib, and
The problem was merging two unsized types like function's, ie int (int*) with
int (uint *)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4594 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 04:59:28 +00:00
Chris Lattner
1421233dc1 Compute total number of nodes and # call nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4592 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 02:18:46 +00:00
Chris Lattner
3c87b29985 Move printouts to be wrapped in DEBUG() macros
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4588 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 01:54:56 +00:00
Chris Lattner
95a80adc23 When the -only-print-main-ds option is specified, still print out graph size
statistics for skipped functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4587 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 01:54:44 +00:00
Chris Lattner
cf9b4f0f41 Implement fprintf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4585 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 23:05:03 +00:00
Chris Lattner
a5c0bfe09a Implement fputc and ungetc to allow burg to run in lli
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4584 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 22:59:28 +00:00
Nick Hildenbrandt
088b472eed Fixes escapeing bug in strings. Fixes test case test/Regression/CBackend/2002-11-06-PrintEscaped.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4583 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 21:40:23 +00:00
Nick Hildenbrandt
2cf2cbcefb Loads and stores can't be inlined. This fixes test/Singlesource/matrixTranspose
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4579 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 20:07:54 +00:00
Chris Lattner
4476ceb414 Allow the ResolveCallSiteModRefInfo method to return a mapping of nodes,
implement the mod/ref bit masking


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4578 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 19:59:33 +00:00
Chris Lattner
268748a0d8 Add a stub to implement the context sensitive mod/ref info for call sites
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4577 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 19:38:43 +00:00
Chris Lattner
2110808fd8 Give a back pointer to the IPModRef object to the FunctionModRefInfo object
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4576 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 19:07:13 +00:00
Chris Lattner
fc928245ad Remove a couple of #includes, move some code from .h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4575 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 18:38:18 +00:00
Chris Lattner
d747e8ffe9 Change Steens class to build with Vikram's changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4572 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 18:08:32 +00:00
Chris Lattner
2c0bd014c5 Make PointerSize & Shift be enums
Fix problem with recursive merging


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4570 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 18:01:39 +00:00
Vikram S. Adve
75310d59c9 Make query operations non-const to allow demand-driven analyses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4569 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 17:17:55 +00:00
Vikram S. Adve
895c0bd3fb An interprocedural analysis pass that computes flow-insensitive
IP Mod and Ref information for every function and every call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4567 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 17:02:03 +00:00
Chris Lattner
08db719c4b Dramatically simplify internal DSNode representation, get implementation
*FULLY OPERATIONAL* and safe.  We are now capable of completely analyzing
at LEAST the Olden benchmarks + 181.mcf


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4562 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 06:20:27 +00:00
Chris Lattner
ef5af99195 Delete "StripScalars" argument to cloneInto method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4560 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 06:16:30 +00:00
Vikram S. Adve
c227a9a513 Remove a nasty little semi-colon someone introduced which
prevented any machine instrs from being printed!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4557 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 00:34:26 +00:00
Chris Lattner
5953513308 Attempted fixes to the mergemap to make it work better.
Ended up disabling merge map merging completely.  It shall be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4550 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-05 00:01:58 +00:00
Chris Lattner
69e79e0be4 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4547 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 21:06:54 +00:00
Chris Lattner
a95078dc24 Sun can now use mallinfo()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4546 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 21:05:21 +00:00
Chris Lattner
c9d8beff59 No need to explicitly inclue ExportSymbols now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4543 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 20:50:57 +00:00
Chris Lattner
18eba91a05 Allow memory sizes to be negative, remove obsolete TmpRSS field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4538 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 19:19:36 +00:00
Chris Lattner
6cd11f6535 mallinfo is not available on sun apparently :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4537 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 19:01:41 +00:00
Chris Lattner
0188534cd1 Instcombine this away:
%A = getelementptr [4 x int]* %M, long 0, long 0
        %B = getelementptr int* %A, long 2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4536 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 16:43:32 +00:00
Chris Lattner
0864acf07b Add a transformation to turn:
malloc Ty, C
int
  malloc [C x Ty], 1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4534 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 16:18:53 +00:00
Vikram S. Adve
c405daf392 Simple passes that print out SCCs in the CFGs or in the CallGraph of a module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4532 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 14:20:22 +00:00
Chris Lattner
02606637e0 Change the "Cannot merge two portions of the same node yet" from an assertion
into a "oh crap, lets collapse" case


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4530 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 06:48:26 +00:00
Chris Lattner
35b74c4e54 Ack: Fix bug in previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4526 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 05:50:42 +00:00
Chris Lattner
38dc4f06af Be more generous about level raising constant expressions don't force each
constant to one particular type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4525 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 05:46:37 +00:00
Chris Lattner
af663465d6 Make sure to _delete_ memory allocated by worklists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 02:54:22 +00:00
Chris Lattner
048912bad9 Give a better error message in an unhandled case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4521 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 02:29:15 +00:00
Chris Lattner
a5cf9364f1 Minor fix to space accounting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4520 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 01:49:45 +00:00
Chris Lattner
9d4ef12b9c Implement MaxRSS in terms of mallinfo instead of the system RSS. This gives
us much more accurate numbers and actually WORKS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4518 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 00:32:44 +00:00
Chris Lattner
1650015822 Allow the call graph to be called from analyze naturally with print implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4517 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 00:21:19 +00:00
Chris Lattner
c875f023d4 Rename ValueMap to ScalarMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4516 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-03 21:27:48 +00:00
Chris Lattner
d18f342af8 Rename NewNode flag to HeapNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4515 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-03 21:24:04 +00:00
Chris Lattner
ef69ccf71b Change the letters used to represent stack and heap allocations to "S" and "H"
respectively.  This is to make presentation easier in the paper.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4514 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-03 19:46:15 +00:00
Anand Shukla
93d545e691 code to lightly instrument at branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4511 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-03 01:45:20 +00:00
Chris Lattner
5da2e6ac70 Move function to cpp file from header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4510 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 22:07:51 +00:00
Chris Lattner
f01729ea56 Implement signed and unsigned division and remainder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4508 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 20:54:46 +00:00
Chris Lattner
ca9671d864 Implement multiply operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4506 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 20:28:58 +00:00
Chris Lattner
68aad93291 * Implement subtract
* Merge add code into logical code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 20:13:22 +00:00
Chris Lattner
e2954c84e9 shuffle code around a bit, implement and, or, xor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4502 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 20:04:26 +00:00
Chris Lattner
51b49a9633 Add PHI node support, add comment for branch function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4500 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 19:45:49 +00:00
Chris Lattner
2df035bb3c Implement unconditional branching support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4498 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 19:27:56 +00:00
Chris Lattner
e9913f2cff * Fix nonconstant shift case
* Turn table into 2d table


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4496 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 01:41:55 +00:00
Chris Lattner
b1761fc4df Use a more table driven approach to handling types. Seems to simplify the
code a bit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4493 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 01:15:18 +00:00
Chris Lattner
d5a87f80b7 Make switch statements denser, but only because of the follow-on patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4492 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 00:49:56 +00:00
Chris Lattner
796df73e6e * Remove dead variable
* Shift amount is always guaranteed to be 8 bits


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4491 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 00:44:25 +00:00
Chris Lattner
5af344d79d Implement the "unknown flag" which mainly consists of aligning printing code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4490 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 00:36:03 +00:00
Chris Lattner
7a0b5bb7ab Oops, this was not meant to be checked in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4489 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 00:26:32 +00:00
Chris Lattner
92673296e6 Stop representing scalars as explicit nodes in the graph. Now the only
nodes in the graph are memory objects, which is very nice.  This also greatly
reduces the size and memory footprint for DSGraphs.  For example, the local
DSGraph for llu went from 65 to 13 nodes with this change.  As a side bonus,
dot seems to lay out the graphs slightly better too.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4488 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-02 00:13:20 +00:00
Nick Hildenbrandt
7e9fea736d Fixed bug in Regression/CBackend/2002-10-30-FunctionPointerAlloca.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 17:37:09 +00:00
Chris Lattner
4f53bef7cd Fix comments, steens is context sensitive, we just haven't implemented
mod/ref apis yet


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 17:34:23 +00:00
Chris Lattner
ec3e2f41cd New iostream definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4482 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 16:46:05 +00:00
Chris Lattner
a145d4188c Make sure to include name information if we have it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4481 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 04:49:06 +00:00
Chris Lattner
7f124e3abd Add a fixme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4479 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 23:24:00 +00:00
Brian Gaeke
a1719c9130 InstSelectSimple.cpp: Include llvm/iOther.h for ShiftInst.
Add ISel::visitShiftInst() to instruction select shift instructions.
 Add a comment in visitAdd about how to do 64 bit adds.

X86InstrInfo.def: Add register-to-register move opcodes and shift opcodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4477 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 23:03:59 +00:00
Chris Lattner
9b87c5c53c * Minor optimization: when merging nodes, merge the smaller one into the
larger one.
     * Handle the case where we are merging two nodes of different size better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4476 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 22:41:15 +00:00
Chris Lattner
59b2b86f35 Reassociate pass now works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4473 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 17:16:18 +00:00
Chris Lattner
e4b730441d Fixes to the reassociate pass to make it respect dominance properties
Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4471 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 17:12:59 +00:00
Chris Lattner
2fe6626ead Fix nasty bug in ::isNeg()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4470 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 17:09:06 +00:00
Vikram S. Adve
26fbcec43b Restore support for indirect function calls (which briefly wasn't working
after I removed annotations on MachineInstr for the CallDescriptor).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4469 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 15:34:48 +00:00
Chris Lattner
7e51c8741f Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4467 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 06:52:26 +00:00
Chris Lattner
8f0a16eac6 This fixes all kinds of problems with array handling. There are still bugs to
be fixed, but we are getting much closer now.

    * Make DSNode::TypeRec a full fledged DSTypeRec type.
    * Add methods used to update and access the typerecords elements
    * Add methods to query if and to cause a node to be completely folded
    * DSGraph construction doesn't use the allocation type for anything at all,
      now nodes get their type information based on how they are used.
    * Fixed a bug with global value handling introduced in the last checkin
    * GEP support is now much better, arrays are handled correctly.  The array
      flag is now updated in type records.  There are still cases that are not
      handled yet (we do not detect pessimizations), but getting much closer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4465 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 05:45:02 +00:00
Chris Lattner
6b1c4fcfb5 Can simplify code now with the isCommutative() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4461 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 04:24:23 +00:00
Chris Lattner
f37c34430d Use new isCommutative interface, which gives us SetEQ and SetNE for free.
Thanks fly out to Casey Carter for this fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4460 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 04:20:07 +00:00
Chris Lattner
f2da7241f5 New isAssociative/isCommutative inspection methods, graciously contributed by
Casey Carter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4459 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 04:14:01 +00:00
Chris Lattner
6918c079a1 BreakCriticalEdges should update dominance frontier information as well as
other dominance stuff.  Patch contributed by Casey Carter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4457 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 02:44:36 +00:00
Chris Lattner
2fdaddf445 Fix two problems:
* Load Implementation can cause unaligned memory accesses, which caused
    problems for sparc.
  * cast from pointer to pointer would zero the upper 32 bits of the pointer
    which obviously causes problems on 64 bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4454 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 21:47:57 +00:00
Vikram S. Adve
601899d196 Bug fix: need to initialize new CallArgsDescriptor pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4453 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 20:38:49 +00:00
Vikram S. Adve
9691807669 In getID(), don't call getValidSymbolName to mangle external names!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4451 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 20:16:38 +00:00
Chris Lattner
cc0b0c59e8 Add lots more info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4450 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 06:04:46 +00:00
Chris Lattner
188732c971 Remove fixme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4447 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 02:02:37 +00:00
Chris Lattner
6a592271fb Add special code to make printing SSA form machine instructions nicer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4446 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 01:55:38 +00:00
Chris Lattner
8548ee75eb Make sure to set the destination register correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4444 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 01:49:01 +00:00
Chris Lattner
b752e9a2ae Set the destination register field based on the target specific flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4442 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 01:15:31 +00:00
Chris Lattner
9d17740295 Add flag to specify when no value is produced by an instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4441 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 01:09:34 +00:00
Chris Lattner
443d0122d7 Sparc backend doesn't use target specific flags yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4440 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 01:07:12 +00:00
Chris Lattner
2a79a0927c Use MRegisterInfo, if available, to print symbolic register names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4438 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:58:19 +00:00
Chris Lattner
e5f5221b5e Implement the new optional getRegisterInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4437 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:56:18 +00:00
Chris Lattner
1049164aa6 Implement structured machine code printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4435 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:48:05 +00:00
Chris Lattner
3dffa7953f Print machine code after instruction selection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4434 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:47:49 +00:00
Chris Lattner
42c7786227 Make sure to pass the LLVM basic block in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4433 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-30 00:47:40 +00:00
Chris Lattner
36b36037a3 Construct annotation, to make sure it's attached to function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4429 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:40:58 +00:00
Chris Lattner
88726188fe Make argsize calculation stuff optional, so that Targets without FrameInfo
objects yet don't die


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4427 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:40:03 +00:00
Chris Lattner
ddd7fcb887 Implement autoinserting ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4426 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:19:00 +00:00
Chris Lattner
e316efc0e7 Rename annotation id
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4425 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:18:43 +00:00
Misha Brukman
a3bbcb5b66 Fix spelling of `propagate'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4423 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:06:16 +00:00
Chris Lattner
b4f68ed32e Convert backend to use passes, implement X86TargetMachine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4421 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 22:37:54 +00:00
Chris Lattner
c66583ef3b These are no longer virtual methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4420 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 22:01:44 +00:00
Chris Lattner
c56406c236 * Privatize the TargetName
* Move optSizeForSubWordData to TargetData
* Remove unused fields


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4417 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 21:48:17 +00:00
Chris Lattner
62eaf7ef60 Implement findOptimalStorageSize a bit more generally
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4416 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 21:47:50 +00:00
Chris Lattner
6334205cb5 Allow TargetMachine to refuse static code gen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4415 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 21:12:46 +00:00
Chris Lattner
055c965bff Rename X86InstructionInfo to X86InstrInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4413 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 21:05:24 +00:00
Chris Lattner
33f53b554a Minor renaming
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4410 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 20:48:56 +00:00
Chris Lattner
eef7454e1c Remove unneccesary #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4408 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 20:47:46 +00:00
Chris Lattner
600e699794 Rename Sparc.h to TargetMachineImpls.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4407 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 20:47:26 +00:00
Chris Lattner
b85c7f4b91 Reenable X86 backend, even though it doesn't do much, at least it compiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4404 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 20:29:34 +00:00
Chris Lattner
ba64363562 Merge with sparc backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4403 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 20:10:58 +00:00
Chris Lattner
495fe2e087 X86 merge is complete, eliminate unused code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4400 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 20:07:16 +00:00
Vikram S. Adve
a2bae305fb Remove separate vector of implicit refs from MachineInstr, and
instead record them as extra operands in the operands[] vector.
Also, move CallArgsDescriptor into this class instead of making it an
annotation on the machine instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4399 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 19:41:18 +00:00
Vikram S. Adve
e68a3435ee Move CallArgsDescriptor into this class instead of making it an
annotation on the machine instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4398 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 19:38:46 +00:00
Vikram S. Adve
aabb595c4f Bug fix: align size for dynamic allocas according to stack pointer
alignment restrictions.  This is incomplete for one case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 19:37:31 +00:00
Chris Lattner
341a937169 Switch to generating machineinstr's instead of MInstructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4396 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:43:55 +00:00
Chris Lattner
a535fabe7d Be compatible with sparc backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:43:38 +00:00
Chris Lattner
9bbf439e38 Implement MachineInstrInfo interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4394 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:43:19 +00:00
Chris Lattner
79c033765c Switch to different flag set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4393 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:42:40 +00:00
Chris Lattner
f1757c414c Move TargetInstrDescriptors extern to the one .cpp file that refers to it:
MachineInstr.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4392 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:40:30 +00:00
Chris Lattner
adc101bbcd Move TargetInstrDescriptors to MachineInstrInfo.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4391 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:37:48 +00:00
Chris Lattner
f44f905196 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4390 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:35:41 +00:00
Chris Lattner
d9512caca8 Use higher level methods, don't use TargetInstrDescriptors directly!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4389 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:35:39 +00:00
Chris Lattner
8f7802727f Use higher level method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4386 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:25:41 +00:00
Chris Lattner
ea9d249595 Remove #include, misleading comment, and a typedef used only once
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4383 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:08:05 +00:00
Chris Lattner
88da77c739 Inline typedef, eliminate unused method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4382 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:03:19 +00:00
Chris Lattner
67eaf73c89 Remove long dead #if 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4381 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 17:00:19 +00:00
Chris Lattner
cb6b4bd1c6 Add #includes that were eliminated from headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4380 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 16:51:05 +00:00
Chris Lattner
770feb4bfc De-inline methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4379 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 16:50:33 +00:00
Chris Lattner
a80848704a Remove #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 16:50:20 +00:00
Chris Lattner
97d688515e Remove unneeded #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4377 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 16:50:06 +00:00
Chris Lattner
9538cecf27 Remove forward decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4376 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 16:49:44 +00:00
Chris Lattner
28760f4e77 Make assertIGNode be private to the InterferenceGraph.cpp file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4375 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 16:42:34 +00:00
Chris Lattner
047bbafb99 MachineInstrInfo doesn't need a TargetMachine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4372 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 15:45:20 +00:00
Chris Lattner
ba43675aa0 Don't build X86 target until it builds properly again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4369 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 23:56:41 +00:00
Chris Lattner
93fa70598c Seperate code out of TargetMachine into MachineInstrInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4368 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 23:55:33 +00:00
Chris Lattner
75276f150e Initial stab at MachineInstr'ication
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4367 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 23:55:19 +00:00
Chris Lattner
c5b8b1a040 MachineInstrInfo no longer #includes this header, so we must
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4366 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 23:54:47 +00:00
Chris Lattner
c01ff9c1f9 Use BuildMI instead of explicit code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4362 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 21:43:57 +00:00
Chris Lattner
9a8e4121aa Remove all traces of the "Opcode Mask" field in the MachineInstr class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4359 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 21:17:20 +00:00
Chris Lattner
b98a53f201 Remove more default arguments that are never used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4358 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 21:02:40 +00:00
Chris Lattner
7279122e66 Remove default operands that are never used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4357 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:59:49 +00:00
Chris Lattner
413746e983 * Make MachineOperand ctors private, so MachineOperand can only be created
by MachineInstr.
* Add a bunch of new methods to allow incremental addition of operands to the
  machine instr instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4356 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:48:39 +00:00
Chris Lattner
1c7907e896 Fix minor bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4355 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:11:17 +00:00
Chris Lattner
0fa600dd35 Don't pass default args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4354 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:10:56 +00:00
Misha Brukman
6ee9b5a57d Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4353 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:01:52 +00:00
Misha Brukman
e585a7d12a Rewrote uses of deprecated `MachineFunction::get(BasicBlock *BB)'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4352 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:01:13 +00:00
Misha Brukman
b7551ef115 Replaced uses of deprecated `MachineFunction::get(BasicBlock *BB)'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4351 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 20:00:31 +00:00
Nick Hildenbrandt
f0fca36d14 Casting NULL can cause problems so lets just not cast NULL to anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4349 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:54:06 +00:00
Chris Lattner
2f305989b3 Remove two arguments that are never specified
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4348 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:46:59 +00:00
Chris Lattner
5638bf973f Don't bother passing in default value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4347 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:46:25 +00:00
Chris Lattner
ccdf23ebbb Rename some regalloc fields
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4346 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:43:23 +00:00
Chris Lattner
4e3be2f728 Fixes to work with updated RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4345 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:32:07 +00:00
Chris Lattner
f726e776b8 Eliminate usage of MachineBasicBlock::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4344 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:22:04 +00:00
Nick Hildenbrandt
50de36a41d *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4343 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:05:12 +00:00
Chris Lattner
fcffe865f9 Remove usage of MachineBasicBlock::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4342 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:01:16 +00:00
Chris Lattner
fb3a0aed9b Remove usage of MachineBasicBlock::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4341 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 18:50:08 +00:00
Chris Lattner
601fc7c71c Eliminate uses of MachineBasicBlock::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4340 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 18:01:21 +00:00
Chris Lattner
b84a2ba877 Eliminate unneccesary use of MachineBasicBlock::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4339 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 06:01:57 +00:00
Chris Lattner
335d5c399b s/method/function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4338 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 05:58:46 +00:00
Chris Lattner
d0aa0cdbc6 Change MachineBasicBlock's to not be Annotations, instead they are kept as
part of a linked list tracked by MachineFunction.  MachineBasicBlock::get
is now linear time instead of constant time, and thus is deprecated!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4337 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 05:30:46 +00:00
Chris Lattner
07541a2711 Make sched class unsigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 04:59:43 +00:00
Chris Lattner
c5ddc8b74b Make Scheduling Class variables be 'unsigned' instead of 'int'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 04:53:02 +00:00