Commit Graph

1561 Commits

Author SHA1 Message Date
Chris Lattner 9d8350939a Remove default ctor
llvm-svn: 5139
2002-12-25 05:01:05 +00:00
Chris Lattner 21d48e8f2c *** empty log message ***
llvm-svn: 5138
2002-12-25 05:00:49 +00:00
Chris Lattner 6e6c6eda24 Remove dependency on SSARegMap.h
llvm-svn: 5137
2002-12-25 05:00:16 +00:00
Chris Lattner a4d7e4f203 Allow the target machines to specify endianness and pointer size
llvm-svn: 5128
2002-12-24 00:02:17 +00:00
Chris Lattner 996fe01028 Initial checkin of new LLI with JIT compiler
llvm-svn: 5126
2002-12-24 00:01:05 +00:00
Chris Lattner de4aa4cf8c New files for miscompilation detection
llvm-svn: 5120
2002-12-23 23:50:16 +00:00
Chris Lattner 5629397d28 Simplify interface to remove virtual function references
llvm-svn: 5100
2002-12-17 04:20:39 +00:00
Chris Lattner b74c150efc Add support for register alias set description
llvm-svn: 5080
2002-12-16 16:39:14 +00:00
Chris Lattner 050d0ce094 Export well known instruction opcodes usable by target independant passes
llvm-svn: 5063
2002-12-15 22:16:08 +00:00
Chris Lattner 432447fed1 Add new opIsUse method
llvm-svn: 5062
2002-12-15 22:05:02 +00:00
Chris Lattner e2533336f5 Simplify interfaces used by regalloc to insert code
llvm-svn: 5052
2002-12-15 20:06:35 +00:00
Chris Lattner df1f77207a Simplify TargetRegisterClass a bit, also eliminating virtual function call
overhead

llvm-svn: 5049
2002-12-15 19:29:14 +00:00
Chris Lattner 663cd4fc2e * Rename const_regclass_begin/end to just regclass_begin/end
* Regclass iterators need an extra level of pointerness to work right
* Pull inverse mapping code out of target description files

llvm-svn: 5046
2002-12-15 18:40:01 +00:00
Chris Lattner 0345ea6908 Add capability to have a MachineBasicBlock as an operand to a MachineInstr
Add a bunch of methods to MachineOperand is* to reduce usage of MO_foo

llvm-svn: 5032
2002-12-15 08:01:02 +00:00
Misha Brukman 78401cbb3c Added moveReg2Reg() and moveImm2Reg() to accomodate moving data around due to
PHI nodes.

llvm-svn: 5001
2002-12-13 09:54:12 +00:00
Chris Lattner 34cd32d42a Final version of BuildMI for symmetry and because I want to use it
llvm-svn: 5000
2002-12-13 09:33:06 +00:00
Chris Lattner a8d8e0d9dd Get rid of deprecated function
llvm-svn: 4997
2002-12-13 07:30:45 +00:00
Misha Brukman eedcef4f92 Define the 2-address flag used by X86 instructions (add,sub,and,or,xor) that
need to be declared as such.

llvm-svn: 4975
2002-12-12 23:19:51 +00:00
Chris Lattner c1ba0cddd6 Make a release build compile. This field is not really an enum, it's really a bitfield
llvm-svn: 4971
2002-12-12 05:31:26 +00:00
Misha Brukman 0d19db3c34 No need to specify the class if the method is within the class declaration.
llvm-svn: 4969
2002-12-12 05:28:39 +00:00
Chris Lattner 5bd7897ac2 Fix header
llvm-svn: 4966
2002-12-12 03:43:30 +00:00
Vikram S. Adve 5fb974b74a This file provides the function DemoteRegToStack(), which takes a
virtual register computed by an Instruction& X and replaces it with
a slot in the stack frame, allocated via alloca.

llvm-svn: 4963
2002-12-10 13:07:12 +00:00
Vikram S. Adve 41aab86c40 The pass Parallelize automatically parallelizes a program using the
Cilk multi-threaded runtime system to execute parallel code.  This file
exposes some routines needed for code generation for that pass.

llvm-svn: 4961
2002-12-10 00:42:22 +00:00
Vikram S. Adve 775e51d87a Iterator that enumerates the ProgramDependenceGraph (PDG) for a function,
i.e., enumerates all data and control dependences for the function.

llvm-svn: 4958
2002-12-08 14:13:19 +00:00
Vikram S. Adve 8975afdfc4 An explicit representation of dependence graphs, and a pass that
computes a dependence graph for data dependences on memory locations
using interprocedural Mod/Ref information.

llvm-svn: 4957
2002-12-08 13:26:29 +00:00
Chris Lattner 906eea0e43 Give better error message if two passes of the same argument are registered
llvm-svn: 4950
2002-12-07 04:41:22 +00:00
Vikram S. Adve d1665d2bab Stronger assertion in getNodeId(): node id must exist in the map.
llvm-svn: 4949
2002-12-06 21:19:07 +00:00
Vikram S. Adve 00ca82dbd2 Added static helper method MergeNodes(). See DataStructure.cpp for more.
llvm-svn: 4946
2002-12-06 21:10:17 +00:00
Vikram S. Adve 80cac479bd Bug fix in operator==() and in method fini().
llvm-svn: 4945
2002-12-06 15:02:22 +00:00
Chris Lattner bf10511db7 Make sure to print indirect node again
llvm-svn: 4943
2002-12-06 06:40:00 +00:00
Misha Brukman 25e6ed4ec1 Added prototypes for emitting prologue and epilogue for function code
generation.

llvm-svn: 4927
2002-12-04 23:55:56 +00:00
Misha Brukman 1af9bebcda storeReg2RegOffset() and loadRegOffset2Reg() now take the iterator by value
instead of by reference, since they return the modified iterator.

llvm-svn: 4914
2002-12-04 17:14:13 +00:00
Misha Brukman 0d28502c32 Moved buildReg2RegClassMap() into from X86RegisterInfo to MRegisterInfo, since
it is target-independent.

llvm-svn: 4911
2002-12-04 16:47:04 +00:00
Chris Lattner 418b77ef4b Add support for direct global references
llvm-svn: 4905
2002-12-04 06:44:27 +00:00
Chris Lattner 4843ebc4ba Expose target data through a method for uniformity
llvm-svn: 4901
2002-12-04 05:20:12 +00:00
Misha Brukman 9e4163539f RegisterInfo now supports handing out caller- and callee-save registers, as
well as building a map from a physical register to its register class.

llvm-svn: 4896
2002-12-03 23:09:53 +00:00
Chris Lattner 8f520dfa9c Add virtual dtor, expose a debug impl
llvm-svn: 4892
2002-12-03 20:56:20 +00:00
Chris Lattner aa0d2c5fb3 Add entries to track information about implicit uses and definitions of
the instructions

llvm-svn: 4875
2002-12-03 05:41:32 +00:00
Chris Lattner f24e2a748f More support
llvm-svn: 4873
2002-12-02 21:56:28 +00:00
Chris Lattner d5eadf6aa4 Start adding to the meat of MachineCodeEmitter
llvm-svn: 4869
2002-12-02 21:44:13 +00:00
Chris Lattner b0a750cf39 Initial version of MachineCodeEmitter interface: empty
llvm-svn: 4864
2002-12-02 21:21:36 +00:00
Chris Lattner 23f0e10a9a The hopefully final version of addPassesToEmitMachineCode which does not
have any question about ownership

llvm-svn: 4863
2002-12-02 21:15:42 +00:00
Chris Lattner e992ff49bd Add comment about ownership semantics
llvm-svn: 4859
2002-12-02 21:13:45 +00:00
Chris Lattner 7b6411c3c0 Add stub to emit machine code for JIT
llvm-svn: 4856
2002-12-02 21:00:50 +00:00
Vikram S. Adve cb8b5af572 Several fixes:
(1) Applied patch from Casey to implement iterator::operator= correctly:
    it should use a pointer, not a reference.
(2) Added operators == and !=, and method all().
(3) Important bug fix: excess bits need to be ignored in operations
    like ==, count(), and all().  We do this by ensuring excess bits
    in the last bitset are always 0.

llvm-svn: 4837
2002-11-27 17:46:38 +00:00
Vikram S. Adve 0b5b784922 Added flags to CloneFlags to strip/keep Mod/Ref bits when cloning a graph.
llvm-svn: 4835
2002-11-27 17:39:37 +00:00
Vikram S. Adve 9409087108 No longer need local graph to find call sites.
Also some major fixes within IPModRef.cpp.

llvm-svn: 4834
2002-11-27 17:38:56 +00:00
Misha Brukman ec6b8e9fad Added virtual functions for storing and retrieving values from the stack.
llvm-svn: 4824
2002-11-22 22:41:23 +00:00
Misha Brukman 5bed2faf6b Instead of checking op.getType() against MO_VirtualRegister and
MO_MachineRegister, we no longer distinguish Virtual vs. Machine registers
externally, they're ALL registers, all equal.

Registers are only differentiated whether they are >=
MRegisterInfo::FirstVirtual or not.

llvm-svn: 4823
2002-11-22 22:40:52 +00:00
Misha Brukman 31457f066d Set SSARegMap to NULL after deleting it.
llvm-svn: 4822
2002-11-22 22:32:15 +00:00
Chris Lattner a35d7412c6 Cloning stuff doesn't modify the source module
llvm-svn: 4787
2002-11-20 20:22:58 +00:00
Misha Brukman 45f6b8410e MRegisterInfo.h - Added prototypes for functions we need to map a register to
an appropriate TargetRegisterClass, also adds TargetRegisterClass definition.
TargetMachine.h - speling.

llvm-svn: 4781
2002-11-20 18:54:53 +00:00
Chris Lattner 98cf1f5d64 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner b251c3d727 Eliminate the concept of a deferred symbol table. The optimization really isn't,
and it causes obscure bugs to show up in passes.

llvm-svn: 4777
2002-11-20 18:07:48 +00:00
Misha Brukman a5381b4932 SSARegMap -- the mapping between SSARegisters and their RegisterClasses, which
imply types of SSA Registers. This is on a per-function basis, so the
MachineFunction contains the SSARegMap, and has accessor functions to it.

llvm-svn: 4774
2002-11-20 00:53:10 +00:00
Chris Lattner c362618f2a Minor changes to cloning interface
llvm-svn: 4770
2002-11-19 22:54:01 +00:00
Chris Lattner 3aecfe8f61 Extend function cloning interface to support inlining
llvm-svn: 4767
2002-11-19 21:54:38 +00:00
Chris Lattner 891bbab848 This file is supersumed by Utils/Cloning.h
llvm-svn: 4765
2002-11-19 21:00:33 +00:00
Chris Lattner 36d074aac6 Merge cloning and inlining utilities
llvm-svn: 4763
2002-11-19 20:58:38 +00:00
Chris Lattner 9c1e935711 Move inlining pass to IPO.h
llvm-svn: 4761
2002-11-19 20:43:24 +00:00
Chris Lattner 58f9002b4a Move the function extractor pass from tools/extract into lib/Xform/IPO
llvm-svn: 4759
2002-11-19 18:42:59 +00:00
Chris Lattner b2e46c0714 Add a new Module::getNamedFunction method
llvm-svn: 4758
2002-11-19 18:41:44 +00:00
Chris Lattner 831f94c5a4 Ignore options that are ""
llvm-svn: 4757
2002-11-19 17:10:14 +00:00
Chris Lattner a3ddb9b5ce Add facility to compute peak memory usage
llvm-svn: 4752
2002-11-18 21:45:55 +00:00
Chris Lattner 2a254b6aa6 Inline DSTypeRec stuff into DSNode
llvm-svn: 4751
2002-11-18 21:45:30 +00:00
Chris Lattner 6d6b48b005 Inline DSTypeRec into DSNode
llvm-svn: 4750
2002-11-18 21:45:07 +00:00
Chris Lattner 11dbd0ff35 Templatize graph traits and iterator to work with const and non-const clients
llvm-svn: 4746
2002-11-18 21:42:19 +00:00
Chris Lattner ee285c1df9 Add helper method
llvm-svn: 4744
2002-11-18 06:57:05 +00:00
Chris Lattner d8ea18b695 Print is const!
llvm-svn: 4737
2002-11-17 23:22:13 +00:00
Chris Lattner 02fd454f07 Make sure that print gets a targetmachine
CVS: ----------------------------------------------------------------------

llvm-svn: 4735
2002-11-17 23:21:45 +00:00
Chris Lattner 7d413cdb2b Omit the indirect node when printing call graphs
llvm-svn: 4733
2002-11-17 23:10:27 +00:00
Chris Lattner 4a22fb1fe9 Add machine independant printer interface
llvm-svn: 4729
2002-11-17 22:54:55 +00:00
Chris Lattner be5ef9028b Finish enumating code
llvm-svn: 4726
2002-11-17 22:33:54 +00:00
Chris Lattner 618c92908c Remove unused methods
llvm-svn: 4720
2002-11-17 22:14:22 +00:00
Chris Lattner 76a95ecad0 Convert to use an enum to access def/use/use&def information. These make
reading code much easier than just seeing "true, false" especially when
default parameters default one but not both arguments.

llvm-svn: 4717
2002-11-17 21:56:10 +00:00
Chris Lattner 9fbccc672d Return const refefrences to enable default construction
llvm-svn: 4713
2002-11-17 21:02:42 +00:00
Chris Lattner fb1855921c Fix warning
llvm-svn: 4708
2002-11-15 18:04:16 +00:00
Brian Gaeke e74543584a 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.

llvm-svn: 4707
2002-11-14 22:32:30 +00:00
Chris Lattner 01f00ca60d Remove dead method, add new method
llvm-svn: 4700
2002-11-12 15:57:28 +00:00
Chris Lattner f8172fa67e Almost complete rewrite of BU closure code
llvm-svn: 4693
2002-11-11 21:34:34 +00:00
Chris Lattner 7bb4144def add method
llvm-svn: 4686
2002-11-10 23:47:02 +00:00
Chris Lattner b16b332280 Add code to be able to merge two call sites
llvm-svn: 4685
2002-11-10 23:46:51 +00:00
Chris Lattner c0a07a4631 Add tarj_end() method
llvm-svn: 4684
2002-11-10 23:46:31 +00:00
Chris Lattner 6fa433344d Add hasGraph() methods to all of the passes for the printer
llvm-svn: 4676
2002-11-10 06:53:19 +00:00
Chris Lattner f4850d6484 Implement swapping
llvm-svn: 4674
2002-11-10 06:48:24 +00:00
Chris Lattner 69494867d8 Implement support for swapping. Callsites now sort by callee
llvm-svn: 4673
2002-11-10 06:48:11 +00:00
Chris Lattner 4525e7899d Add capability to set a preference of what call vector is printed to dot files
llvm-svn: 4672
2002-11-10 06:47:35 +00:00
Chris Lattner 628b23ab1d Fix a problem where bad graphs could be generated
llvm-svn: 4671
2002-11-10 06:47:03 +00:00
Chris Lattner 715a3a3b5c 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.

llvm-svn: 4666
2002-11-09 22:07:02 +00:00
Chris Lattner 4b1be35569 Add globals graphs to all three passes
llvm-svn: 4663
2002-11-09 21:12:07 +00:00
Chris Lattner ac64873403 Move maskNodeTypes from cpp file
llvm-svn: 4662
2002-11-09 21:02:30 +00:00
Chris Lattner 380d1ad4ab Clean up DSGraph::removeDeadNodes interface
llvm-svn: 4660
2002-11-09 21:00:49 +00:00
Chris Lattner 71381c4f34 Make removeTriviallyDeadNodes a private interface
llvm-svn: 4658
2002-11-09 20:55:04 +00:00
Chris Lattner e742f31e0c Add initial support for a globals graph
llvm-svn: 4656
2002-11-09 20:01:01 +00:00
Chris Lattner ba421d7fa4 Remove unneccesary #include
llvm-svn: 4653
2002-11-09 19:24:41 +00:00
Chris Lattner 352879d022 Remove GlobalDSGraph delcaration
llvm-svn: 4652
2002-11-09 19:21:56 +00:00
Chris Lattner 99cffdf379 Fix release build
llvm-svn: 4647
2002-11-09 00:48:52 +00:00
Chris Lattner 944dd0b1db Add new methods
llvm-svn: 4646
2002-11-08 23:22:48 +00:00
Chris Lattner 27ad48cdc8 Add another option to cloneGraph
llvm-svn: 4641
2002-11-08 22:28:55 +00:00
Chris Lattner 79a6ab809d - Add support for an "auxillary" call site list
- Original call sites are now never modified after construction by the local
  pass.
- DSGraph::cloneInto can now optionally not clone the call sites
- BUDataStructures no longer has a ton of book-keeping info for a broken
  implementation of the TD data structures

llvm-svn: 4631
2002-11-08 21:24:51 +00:00
Chris Lattner 1f985e0d3c Add a method "getMainFunction()" that efficiently locates 'main' in a module
llvm-svn: 4629
2002-11-08 20:34:02 +00:00
Vikram S. Adve 1b72f8cd28 Include HashExtras.h since it is almost always needed anyway.
llvm-svn: 4626
2002-11-08 14:07:33 +00:00
Chris Lattner 05788d4b82 Use DSNodeHandle for persistent maps
llvm-svn: 4623
2002-11-08 05:03:37 +00:00
Chris Lattner 90d5c39415 Add flag that may be used to determine if dead nodes are used. It's temporary
llvm-svn: 4620
2002-11-08 01:22:26 +00:00
Vikram S. Adve 88d2821555 Restore a #include because this header file needs the definitions
of DSCallSite::~DSCallSite and DSNodeHandle::~DSNodeHandle.

llvm-svn: 4616
2002-11-08 00:23:23 +00:00
Chris Lattner 58f10cb88d Add interfaces for ResolveCallSiteModRefInfo
llvm-svn: 4601
2002-11-07 07:11:49 +00:00
Chris Lattner 5e865cdbe2 Instead of using a bool that constant has to be explained, use a self
explanitory enum instead.

llvm-svn: 4600
2002-11-07 07:06:20 +00:00
Chris Lattner 8d493b51db Add new method
llvm-svn: 4598
2002-11-07 06:30:17 +00:00
Chris Lattner 312afcafaf Expose isPointerType to clients of dsanalysis
llvm-svn: 4597
2002-11-07 05:21:15 +00:00
Chris Lattner 7f6d8dd144 Add a comment
llvm-svn: 4586
2002-11-06 23:26:21 +00:00
Chris Lattner bac5fec8b9 Allow the ResolveCallSiteModRefInfo method to return a mapping of nodes,
implement the mod/ref bit masking

llvm-svn: 4578
2002-11-06 19:59:33 +00:00
Chris Lattner 2b23bf16e3 Add a stub to implement the context sensitive mod/ref info for call sites
llvm-svn: 4577
2002-11-06 19:38:43 +00:00
Chris Lattner 3cf08cc08a Give a back pointer to the IPModRef object to the FunctionModRefInfo object
llvm-svn: 4576
2002-11-06 19:07:13 +00:00
Chris Lattner 4167780062 Remove a couple of #includes, move some code to .cpp file
llvm-svn: 4574
2002-11-06 18:38:10 +00:00
Chris Lattner 21d8b9f0d6 Make maxSize a private variable, add a size() accessor
llvm-svn: 4573
2002-11-06 18:34:40 +00:00
Chris Lattner 468e98e64e Make PointerShift/Size be enums so they are constants instead of globals
llvm-svn: 4571
2002-11-06 18:02:26 +00:00
Vikram S. Adve 075a8d7341 Make query operations non-const to allow demand-driven analyses.
llvm-svn: 4569
2002-11-06 17:17:55 +00:00
Vikram S. Adve e781ba560e An implementation of the bit-vector representation of sets.
llvm-svn: 4568
2002-11-06 17:14:14 +00:00
Vikram S. Adve 36da63f19f An interprocedural analysis pass that computes flow-insensitive
IP Mod and Ref information for every function and every call site.

llvm-svn: 4567
2002-11-06 17:02:03 +00:00
Vikram S. Adve 85cbece4a3 Add const version of function getNodeForValue:
const DSNodeHandle &getNodeForValue(Value *V) const.

llvm-svn: 4566
2002-11-06 17:00:41 +00:00
Chris Lattner 48e37d9b97 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

llvm-svn: 4562
2002-11-06 06:20:27 +00:00
Chris Lattner 4c74bd8936 Remove stripscalars argument to cloneInto
llvm-svn: 4561
2002-11-06 06:18:56 +00:00
Chris Lattner 4331647781 Add a bunch of assertions
llvm-svn: 4549
2002-11-04 23:59:41 +00:00
Chris Lattner 745b8516d2 Allow memory sizes to be negative, eliminate TmpRSS
llvm-svn: 4539
2002-11-04 19:20:09 +00:00
Vikram S. Adve a9c3afbe4f Generic graph iterator to enumerate the SCCs of a graph
in linear time using Tarjan's DFS algorithm.

llvm-svn: 4531
2002-11-04 14:15:57 +00:00
Chris Lattner 0ac3e3c039 Implement methods needed to print out call graph
llvm-svn: 4522
2002-11-04 02:53:39 +00:00
Chris Lattner b9d55473b5 Allow the call graph to be called from analyze naturally with print implemented
llvm-svn: 4517
2002-11-04 00:21:19 +00:00
Chris Lattner a20fabc7ec Rename ValueMap to ScalarMap
llvm-svn: 4516
2002-11-03 21:27:48 +00:00
Chris Lattner bd7af8e664 Rename NewNode flag to HeapNode
llvm-svn: 4515
2002-11-03 21:24:04 +00:00
Chris Lattner 64b4ee3abc Check in header file that was missing, thus broke the build
llvm-svn: 4513
2002-11-03 19:24:49 +00:00
Misha Brukman 5ab3a23f2e Fixed comment on top of DSNode.h, added note to DSSupport.h as to why
functions were split out from DSNode class.

llvm-svn: 4509
2002-11-02 21:18:53 +00:00
Chris Lattner 63ba1aca7c Implement the "unknown flag" which mainly consists of aligning printing code
llvm-svn: 4490
2002-11-02 00:36:03 +00:00
Chris Lattner a19a7bccc0 * Eliminate Scalar node type (renumber other node types)
* Allow DSNodeHandle::mergeWith to work if a node handle isn't pointing to a node yet

llvm-svn: 4487
2002-11-02 00:11:12 +00:00
Chris Lattner 5ef09c401b Eliminate some unneccesary #includes and forward decls
llvm-svn: 4475
2002-10-31 21:24:10 +00:00
Misha Brukman d88a3c3c93 Refactored DSGraph.h:
* DSGraph.h   contains DSGraph
* DSNode.h    contains DSNode (soon UDSNode and MDSNode)
* DSSupport.h contains DSCallsite, DSTypeRec, and DSNodeHandler

llvm-svn: 4466
2002-10-31 06:34:18 +00:00
Chris Lattner 7d5f19886d 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.

llvm-svn: 4465
2002-10-31 05:45:02 +00:00
Chris Lattner cab6c33811 New isAssociative/isCommutative inspection methods, graciously contributed by
Casey Carter.

llvm-svn: 4459
2002-10-31 04:14:01 +00:00
Chris Lattner b017a3ef50 Statistic class should return const reference to *this, not a reference to
the data type.

llvm-svn: 4458
2002-10-31 02:50:27 +00:00
Chris Lattner 869142e0d7 Add interface to update domfrontier info, thanks to Casey Carter for impl
llvm-svn: 4456
2002-10-31 02:39:48 +00:00
Vikram S. Adve 9a51899691 Bug fix: need to initialize new CallArgsDescriptor pointer.
llvm-svn: 4453
2002-10-30 20:38:49 +00:00
Vikram S. Adve eaad439223 Bug fix in setting an implicit ref.
llvm-svn: 4452
2002-10-30 20:38:16 +00:00
Chris Lattner 5303b21635 Allow BuildMI that helps automate construction of SSA information
llvm-svn: 4443
2002-10-30 01:48:41 +00:00
Chris Lattner 0b8f3733f0 * Add new "Target Specific Flags" field to instruction descriptor
* Rename iclass to Flags

llvm-svn: 4439
2002-10-30 01:06:53 +00:00
Chris Lattner 75d3515824 Add new optional getRegisterInfo to TargetMachine
llvm-svn: 4436
2002-10-30 00:53:02 +00:00
Chris Lattner 528781d9ff Add support for structured printing
llvm-svn: 4432
2002-10-30 00:46:48 +00:00
Chris Lattner b7e661059b Improve comments, add methods for structured printing
llvm-svn: 4431
2002-10-30 00:46:31 +00:00
Chris Lattner 61fa909cc9 Add method
llvm-svn: 4428
2002-10-29 23:40:30 +00:00
Chris Lattner 4623709bb7 Add capability to have machine instruction autoinsert when it is created
llvm-svn: 4424
2002-10-29 23:18:23 +00:00
Misha Brukman b1e1d35012 Fixed spelling of `propagation'.
llvm-svn: 4422
2002-10-29 22:55:11 +00:00
Chris Lattner d9c45e1310 Eliminate virtual methods that are sparc specific
llvm-svn: 4419
2002-10-29 22:01:26 +00:00
Chris Lattner b848956370 * Privatize the TargetName
* Move optSizeForSubWordData to TargetData
* Remove unused fields

llvm-svn: 4417
2002-10-29 21:48:17 +00:00
Chris Lattner 5667f0eefd Allow TargetMachine to refuse static code gen
llvm-svn: 4415
2002-10-29 21:12:46 +00:00
Chris Lattner 548cd8e37f Rename Sparc.h to TargetMachineImpls.h. Add hook for X86 target
llvm-svn: 4412
2002-10-29 20:51:29 +00:00
Chris Lattner b7fbdb1bef Add hook for JIT compiler
llvm-svn: 4411
2002-10-29 20:51:10 +00:00
Chris Lattner c87281c349 Move to TargetMachineImpls.h
llvm-svn: 4405
2002-10-29 20:44:18 +00:00
Chris Lattner f4e4ed7612 Merge with sparc backend
llvm-svn: 4403
2002-10-29 20:10:58 +00:00
Chris Lattner ca8fbb9cde Merge to MachineInstrInfo.h
llvm-svn: 4402
2002-10-29 20:10:19 +00:00
Chris Lattner b7d29c224c X86 merge complete, eliminate dead code
llvm-svn: 4401
2002-10-29 20:07:50 +00:00
Chris Lattner 8d3e9ab2cf X86 merge is complete, eliminate unused code
llvm-svn: 4400
2002-10-29 20:07:16 +00:00
Vikram S. Adve a1b4f0f85e 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.

llvm-svn: 4399
2002-10-29 19:41:18 +00:00
Vikram S. Adve db6596e551 Move CallArgsDescriptor into this class instead of making it an
annotation on the machine instruction.

llvm-svn: 4398
2002-10-29 19:38:46 +00:00
Chris Lattner 07e26837a9 Move TargetInstrDescriptors extern to the one .cpp file that refers to it:
MachineInstr.cpp

llvm-svn: 4392
2002-10-29 17:40:30 +00:00
Chris Lattner 353b60a872 Rename opCodeString to Name, add new getName() method
llvm-svn: 4388
2002-10-29 17:35:09 +00:00
Chris Lattner b09c202cbc Rename MachineInstrInfo::getDescriptor to MachineInstrInfo::get
llvm-svn: 4387
2002-10-29 17:26:26 +00:00
Chris Lattner cc4df76576 Remove old entrypoint
llvm-svn: 4385
2002-10-29 17:15:01 +00:00
Chris Lattner 94f3fae994 Remove unneeded #include
llvm-svn: 4384
2002-10-29 17:14:10 +00:00
Chris Lattner 189c099a7f De-inline methods
llvm-svn: 4379
2002-10-29 16:50:33 +00:00
Chris Lattner e9bda57b87 Remove unneeded #include
llvm-svn: 4377
2002-10-29 16:50:06 +00:00
Chris Lattner 7ecc7af4bd Make assertIGNode be private to the InterferenceGraph.cpp file
llvm-svn: 4375
2002-10-29 16:42:34 +00:00
Chris Lattner d659ab3e66 Remove unneccesary #include
llvm-svn: 4374
2002-10-29 16:34:12 +00:00
Chris Lattner 247f3ee02d Delete unused header file
llvm-svn: 4373
2002-10-29 16:32:08 +00:00
Chris Lattner 64e0e8e0f8 MachineInstrInfo doesn't need a TargetMachine member
llvm-svn: 4371
2002-10-29 15:44:40 +00:00
Chris Lattner a44e68e532 Minor cleanups, remove noncopyable so dot doesn't cluster unrelated stuff
llvm-svn: 4365
2002-10-28 23:54:23 +00:00
Chris Lattner efef410839 Strip a bunch of #includes from the file, move some virtual functions to
.cpp file

llvm-svn: 4364
2002-10-28 23:53:56 +00:00
Chris Lattner ab9a2a93a2 Inline some code from the cpp file
llvm-svn: 4363
2002-10-28 23:53:32 +00:00
Chris Lattner 1c6e20aab6 Minor comment updates
llvm-svn: 4361
2002-10-28 21:43:42 +00:00
Chris Lattner 7af0432c10 Initial checkin of MachineInstrBuilder class
llvm-svn: 4360
2002-10-28 21:31:48 +00:00
Chris Lattner 5c7d638208 Remove all traces of the "Opcode Mask" field in the MachineInstr class
llvm-svn: 4359
2002-10-28 21:17:20 +00:00
Chris Lattner bee314fc94 Remove more default arguments that are never used
llvm-svn: 4358
2002-10-28 21:02:40 +00:00
Chris Lattner 307fb1a314 Remove default operands that are never used
llvm-svn: 4357
2002-10-28 20:59:49 +00:00
Chris Lattner ca4a9d20b8 * 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.

llvm-svn: 4356
2002-10-28 20:48:39 +00:00
Misha Brukman 0a304ce248 Iterator functions now line up together.
llvm-svn: 4350
2002-10-28 19:58:38 +00:00
Chris Lattner 864d279667 Remove two arguments that are never specified
llvm-svn: 4348
2002-10-28 19:46:59 +00:00
Chris Lattner ba3a8060ff s/method/function
llvm-svn: 4338
2002-10-28 05:58:46 +00:00
Chris Lattner 8c63b6897d 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!

llvm-svn: 4337
2002-10-28 05:30:46 +00:00
Chris Lattner 14926845fb * s/unsigned int/unsigned
* Make MachineInstrDescriptor only keep a const char * instead of a string
  for the opcode name.

llvm-svn: 4335
2002-10-28 04:55:56 +00:00
Chris Lattner dddf22c118 Make scheduling class variables be 'unsigned' instead of 'int'
llvm-svn: 4334
2002-10-28 04:53:18 +00:00
Chris Lattner b3dbd494eb Remove typedef that is unneccesary
llvm-svn: 4332
2002-10-28 04:50:01 +00:00
Chris Lattner 6a30b02b1d Rename the redundant MachineOperand::getOperandType() to MachineOperand::getType()
llvm-svn: 4331
2002-10-28 04:45:29 +00:00
Chris Lattner 411837979a Add new getOperandType(i) method to MachineInstr
llvm-svn: 4330
2002-10-28 04:30:20 +00:00
Chris Lattner 340bb96e64 Fairly major overhaul of MachineInstr & Operand classes
- Inline methods that are mostly a single line anyway
  - Eliminate several methods that were never called
  - Group methods a bit more consistently

llvm-svn: 4329
2002-10-28 04:24:49 +00:00
Chris Lattner bb49babe18 Make MachineInstr.h not #include MachineInstrInfo.h
llvm-svn: 4328
2002-10-28 02:29:46 +00:00
Chris Lattner 6fc6ab41fe Remvoe a bunch of unneeded forward decls
llvm-svn: 4326
2002-10-28 02:27:07 +00:00
Chris Lattner 94a4f22573 Don't #include <Support/*>, #include "Support/*"
llvm-svn: 4325
2002-10-28 02:11:53 +00:00
Chris Lattner defd415d01 Add BasicBlock list to MchineFunction that will eventually be the only
way to access MachineBasicBlocks.  For now, it is never filled.

llvm-svn: 4324
2002-10-28 02:08:43 +00:00
Chris Lattner fdbcbf57bb MachineFunction.h now includes MachineBasicBlock.h in preparation for
list changes.

llvm-svn: 4321
2002-10-28 02:01:06 +00:00
Chris Lattner 07c9059e72 Remvoe dead fixme and typedef
llvm-svn: 4320
2002-10-28 01:55:26 +00:00
Chris Lattner 1861eced0e MachineBasicBlock doesn't need basicblock.h, it needs Annotation.h
llvm-svn: 4319
2002-10-28 01:53:00 +00:00
Chris Lattner f6e3651498 Rename file to MachineBasicBlock.h
llvm-svn: 4316
2002-10-28 01:39:21 +00:00
Chris Lattner a94922983f Add note about state that should be removed when time permits
llvm-svn: 4315
2002-10-28 01:27:51 +00:00
Chris Lattner 3ade8929ef Fixes to previous checkin
llvm-svn: 4314
2002-10-28 01:27:30 +00:00
Chris Lattner 9baa9ad7c7 Inline some methods from .cpp files into .h files, minor cleanups
llvm-svn: 4313
2002-10-28 01:21:55 +00:00
Chris Lattner f200a3e251 Add prototypes for creation/destruction passes
llvm-svn: 4309
2002-10-28 01:11:58 +00:00
Chris Lattner 5827eeeb66 * Doxygenify comments
* Move addPassesToEmitAssembly back to Sparc.cpp because it really is
  sparc specific

llvm-svn: 4306
2002-10-28 01:02:24 +00:00
Chris Lattner eae4d0a9e7 This header is renamed to MachineFunction.h
llvm-svn: 4304
2002-10-28 00:45:06 +00:00
Chris Lattner 3b652a3968 We don't need the forwarding typedef
llvm-svn: 4303
2002-10-28 00:44:09 +00:00
Misha Brukman 7ae7f84cf3 Changed `MachineCodeForMethod' to `MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner 3baffd73a9 Add support or other operand types
llvm-svn: 4298
2002-10-27 21:17:45 +00:00
Chris Lattner 32a044b650 Prune #includes
llvm-svn: 4295
2002-10-27 20:49:47 +00:00
Chris Lattner b1f02f7f02 Add neccesary #include
llvm-svn: 4294
2002-10-27 19:16:27 +00:00
Chris Lattner d5112d71f3 Old GCC's don't have an <ostream>
llvm-svn: 4293
2002-10-27 19:12:37 +00:00
Chris Lattner c98c871617 Add #include
llvm-svn: 4291
2002-10-27 19:08:03 +00:00
Chris Lattner 348fcb5b17 Initial checkin of target support for X86 backend.
llvm-svn: 4287
2002-10-25 23:00:40 +00:00
Chris Lattner aed689d1aa Initial checkin of Machine Code representation for X86 backend. This will
eventually be merged with the sparc backend.

llvm-svn: 4286
2002-10-25 23:00:13 +00:00
Chris Lattner 75758af085 Fix typo
llvm-svn: 4281
2002-10-25 22:53:56 +00:00
Chris Lattner 48164f4398 * Remove unneccesary #includes
* Fix typeo in the (unused) MachineInstrInfo::isArith method

llvm-svn: 4275
2002-10-24 22:34:41 +00:00
Chris Lattner 45bb78fc06 Minor cleanups
llvm-svn: 4267
2002-10-23 01:11:51 +00:00
Chris Lattner ce64eddb71 - Two minor improvements to the MachineInstr class to reduce footprint and
overhead: Merge 3 parallel vectors into 1, change regsUsed hash_set to be a
    bitvector.  Sped up LLC a little less than 10% in a debug build!

llvm-svn: 4261
2002-10-22 23:16:21 +00:00
Chris Lattner 96c998fb19 We need to know the call sites each function hosts
llvm-svn: 4258
2002-10-22 15:58:23 +00:00
Chris Lattner ef09736481 Allow modification of callee
llvm-svn: 4257
2002-10-22 15:57:58 +00:00
Chris Lattner e50beac7ea Small space optimization: Make MachineOperands take 16 bytes instead of
20 on intel or 24 on sparc

llvm-svn: 4256
2002-10-22 00:15:13 +00:00
Chris Lattner 820d971233 - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.

llvm-svn: 4255
2002-10-21 20:00:28 +00:00
Chris Lattner 155fffd350 Delete unused arguments to DSGraph::cloneInto method
llvm-svn: 4253
2002-10-21 19:50:29 +00:00
Chris Lattner f76087336f - Add "ResolvingCaller" to the CallSite record. This keeps track of which
function was finally able to resolve the function call.  Adding this allows
    the TD pass to actually work right!
  - Temporarily disable dead node pruning.  This will be reenabled soon.

llvm-svn: 4252
2002-10-21 19:47:18 +00:00
Chris Lattner c6191df9af Add another copy ctor form
llvm-svn: 4251
2002-10-21 15:32:34 +00:00
Chris Lattner 78c1e7d83c As it turns out, we don't need a fully generic mapping copy ctor, we just need
something that maps through a std::map.  Since this simplified the client and
implementation code, do so now.

llvm-svn: 4250
2002-10-21 15:04:18 +00:00
Chris Lattner c5cb7a7dc0 Make sure to initialize isArray member
llvm-svn: 4247
2002-10-21 13:38:07 +00:00
Chris Lattner 295d3ed7b8 Remove a 'using' directives from a header file. Using directives cause
global changes, so aren't good for headers.

llvm-svn: 4245
2002-10-21 13:24:50 +00:00
Chris Lattner e4b24cc42c Add a missing std:: qualifier
llvm-svn: 4244
2002-10-21 13:23:42 +00:00
Chris Lattner a986a2ab86 Two callsites are equivalent even if they are from two completely different
call instructions

llvm-svn: 4241
2002-10-21 02:09:03 +00:00
Chris Lattner 5c3ce31e1f - Make DSCallSite not inherit from std::vector. Renamed methods slightly.
Make copy ctor have two versions to avoid dealing with conditional template
    argument.  DSCallSite ctor now takes all arguments instead of taking one
    and being populated later.

llvm-svn: 4240
2002-10-21 02:08:03 +00:00
Vikram S. Adve e85319693e Remove spurious caller pointer in DSCallSite.
Also add functions to access pointer argument nodes cleanly.

llvm-svn: 4235
2002-10-20 21:41:02 +00:00
Chris Lattner 2ff405c7e1 Add isArray flag
llvm-svn: 4230
2002-10-20 20:28:35 +00:00
Vikram S. Adve ee5fb32466 Added a first-class representation for each call site that can be
used in the DS graphs in DSGraph.h.  With that, the special-purpose
class BUDataStructure::CallSite is no longer needed here.

llvm-svn: 4229
2002-10-20 18:08:55 +00:00
Vikram S. Adve 2b68f2fbbc Added a first-class representation for each call site that can be used
in the DS graphs.

llvm-svn: 4227
2002-10-20 18:04:43 +00:00
Chris Lattner f931f6b5c7 Convert typerec to be a structure instead of a pair
llvm-svn: 4226
2002-10-18 18:22:46 +00:00
Chris Lattner e7c0293f1f Don't emit braces around something without outgoing edges
llvm-svn: 4225
2002-10-18 14:55:44 +00:00
Chris Lattner 3d1fddea22 Add interface for mod/ref info to be captures by dsgraphs
llvm-svn: 4222
2002-10-17 21:03:49 +00:00
Chris Lattner 6bbd3ba458 * Add data structures to BU pass to keep track of call sites for functions
* Reenable the TD analysis

llvm-svn: 4212
2002-10-17 04:23:05 +00:00
Chris Lattner d1b221c011 * Remove a lot of obsolete #if 0'd code
* Add a simple getNodeForValue method to access the ValueMap.

llvm-svn: 4211
2002-10-17 04:22:16 +00:00
Chris Lattner 5b1f684994 Use the forward declaration for GraphTraits instead of #including
the header

llvm-svn: 4210
2002-10-17 01:36:08 +00:00
Chris Lattner 5c7d1d2630 Be const correct. Handle both DSGraph* and const DSGraph*'s
llvm-svn: 4208
2002-10-17 01:01:06 +00:00
Chris Lattner aac0864f11 Break up the GraphWriter into smaller chunks to be used in different ways
llvm-svn: 4207
2002-10-17 00:59:59 +00:00
Chris Lattner d2122e26ce As wierd as it feels to type it, const void* is more generic than void*
llvm-svn: 4206
2002-10-17 00:16:39 +00:00
Joel Stanley f06e4acd32 Added partial specialization of GraphTraits for the DominatorTree class.
llvm-svn: 4205
2002-10-16 23:26:00 +00:00
Chris Lattner 6d44463ac2 Allow simple nodes to have outgoing edges
llvm-svn: 4202
2002-10-16 20:15:38 +00:00
Chris Lattner b2694db06e * Factor printing code again, add emitSimpleNode method
llvm-svn: 4198
2002-10-16 02:03:18 +00:00
Chris Lattner adfe59294d * Add new DOTGraphTraits::addCustomGraphFeatures method
llvm-svn: 4197
2002-10-16 01:44:59 +00:00
Chris Lattner 5274757b62 The second element of the iterator is really an offset, not a link
llvm-svn: 4196
2002-10-16 01:43:11 +00:00
Chris Lattner e515976a11 * Significantly refactor GraphWriter into a class.
llvm-svn: 4194
2002-10-16 01:34:18 +00:00
Chris Lattner cf5eb3317a - Generic graph printing infrastructure changes:
* Only print outgoing edges from a cell if the destination isn't null.
       This is important for DSGraphs, which have sources with no edges.
     * Allow Node attributes to override shape of the node

llvm-svn: 4192
2002-10-16 01:18:14 +00:00
Chris Lattner edd30e5bfa Allow direct access to mergemap for printing
llvm-svn: 4191
2002-10-16 01:17:16 +00:00
Chris Lattner 33100eddd2 - Eliminate SymbolTable::ParentSymTab, ST::localLookup, and
Function::ParentSymTab.  These aren't needed at all.

llvm-svn: 4186
2002-10-15 21:26:29 +00:00
Chris Lattner 5156bba4c7 - Add an endianness field to the TargetData datastructure
llvm-svn: 4174
2002-10-14 22:41:13 +00:00
Vikram S. Adve 4049a9a5de Removed misleading const keyword.
llvm-svn: 4169
2002-10-14 16:32:24 +00:00
Chris Lattner 163b890dfb - Dramatically simplify the Constant::mutateReferences implementation,
allowing it to be called on all constant types (structures/arrays)

llvm-svn: 4160
2002-10-14 03:30:23 +00:00
Chris Lattner 69ce8674b5 - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.

llvm-svn: 4147
2002-10-13 19:39:16 +00:00
Chris Lattner 894962baaf First crack at reimplementing graph traits for DSGraphs
llvm-svn: 4145
2002-10-13 19:31:34 +00:00
Chris Lattner 10bdae7c9e disable the unused "pointer" member
llvm-svn: 4144
2002-10-13 19:30:44 +00:00
Chris Lattner 0e0e32dea9 Add dummy entries to document what members can be added
llvm-svn: 4141
2002-10-13 17:12:05 +00:00
Vikram S. Adve d77030bd76 Use vectors instead of hash_maps for issueGaps and conflictLists.
These hash lookups were a major sink of time because they happen so often!

llvm-svn: 4136
2002-10-13 00:37:46 +00:00
Misha Brukman 33022f07bb Added capability to get execution count of a loop if it is a predictable
number of iterations.

llvm-svn: 4113
2002-10-11 05:34:32 +00:00
Misha Brukman 3845be203d Added helper functions in LoopInfo: isLoopExit and numBackEdges.
llvm-svn: 4112
2002-10-11 05:31:10 +00:00
Chris Lattner d484dd8da4 Expose API to graph library to allow iteration over all nodes, even unreachable ones
llvm-svn: 4111
2002-10-10 22:31:31 +00:00
Chris Lattner 27abebe1b6 Change reference
llvm-svn: 4110
2002-10-10 22:31:02 +00:00
Chris Lattner e3336c72c0 * Don't only print out reachable nodes in the graph.
* use new api to get all nodes in the graph
  * Allow custom graph traits

llvm-svn: 4109
2002-10-10 22:29:51 +00:00
Chris Lattner f43f410dfb Add new getGraphProperties that may be specialized by graphs
llvm-svn: 4108
2002-10-10 22:29:10 +00:00
Chris Lattner 513401821c Rename DataStructureGraph.h to DSGraphTraits.h
llvm-svn: 4107
2002-10-10 20:36:37 +00:00
Chris Lattner b1dd9bbc68 - Add new Constant::replaceUsesOfWithOnConstant which has an end result
similar to User::replaceUsesOfWith but actually does the right thing for
    constants.

llvm-svn: 4102
2002-10-09 23:12:25 +00:00
Chris Lattner 083a1f7890 Make isExtern() be a virtual function inherited from GlobalValue
llvm-svn: 4101
2002-10-09 23:11:33 +00:00
Chris Lattner 3d6c35b92e - Detemplatize UseTy<> in Value.h, because it's only instantiated for one
type!

llvm-svn: 4093
2002-10-09 00:42:03 +00:00
Chris Lattner 5cb6394287 - Remove Value::use_push_back & Value::use_remove
llvm-svn: 4089
2002-10-09 00:25:01 +00:00
Chris Lattner ed5fabe19b By default PHINode::removeIncomingValue will delete the phi node if the last
incoming value is deleted!

llvm-svn: 4076
2002-10-08 21:31:56 +00:00
Chris Lattner 5ac72defc9 Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass
llvm-svn: 4075
2002-10-08 21:06:27 +00:00
Chris Lattner acb038e5c7 Expose new "recalculate" method from dominatorset
llvm-svn: 4074
2002-10-08 19:12:08 +00:00
Chris Lattner 433604a5f5 Don't rotate paper.
llvm-svn: 4066
2002-10-07 22:37:03 +00:00
Chris Lattner 1484662c07 - Allow printing generic LLVM graphs to 'dot' files, so they can be
visualized easily.

llvm-svn: 4061
2002-10-07 18:37:10 +00:00
Chris Lattner 31ae011e43 Fix bug in last checkin
llvm-svn: 4058
2002-10-07 17:13:22 +00:00
Chris Lattner 6fa8a99101 Implement operator= for SuccIterators
llvm-svn: 4055
2002-10-07 16:53:22 +00:00
Chris Lattner 9e31c7ea8a - Add new isExternal() method to GlobalVariable to mirror Function.
- doxygenize comments and add new comments

llvm-svn: 4046
2002-10-06 22:29:58 +00:00
Chris Lattner 9a389b3cce The wall clock timer (implementing using the RTC or cycle counter on x86) is
so much more accurate than the per process timers that we get better results
(less noise) by sorting according to wall time than process time.

llvm-svn: 4034
2002-10-03 21:08:20 +00:00
Chris Lattner 7a525a94db Remove commented out stuff
DataStructure.h doesn't include DSGraph.h now

llvm-svn: 4028
2002-10-02 22:14:17 +00:00
Chris Lattner 10725d5341 Move GlobalDSGraph class defn to the end of the file
llvm-svn: 4027
2002-10-02 21:55:52 +00:00
Chris Lattner 9beee8590a This file doesn't need Pass.h
llvm-svn: 4026
2002-10-02 21:55:24 +00:00
Chris Lattner be9f70e342 * Implement fully general merging of array subscripts on demand! This
does not handle the initial pointer index case yet though.

llvm-svn: 4011
2002-10-02 06:24:29 +00:00
Chris Lattner c2222c8077 Checkin the "meat" of the Data structure graph itself. I forgot to check
this in before.  :(

llvm-svn: 4009
2002-10-02 04:58:12 +00:00
Chris Lattner 06f9532c8a - Remove the User::eraseOperand method which is never used, really
dangerous, and not something we want to expose.

llvm-svn: 4007
2002-10-01 23:41:17 +00:00
Chris Lattner c758fe6b72 - Rework Statistics:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.

llvm-svn: 3999
2002-10-01 22:35:45 +00:00
Chris Lattner 7c91242aef Check in DataStructure rewrite so far.
llvm-svn: 3998
2002-10-01 22:34:45 +00:00
Chris Lattner 6dad11f6c0 Checkin generic interval timer support
llvm-svn: 3992
2002-10-01 19:36:54 +00:00
Vikram S. Adve 6be99c4f23 Added several more helper functions for construction MachineInstrs.
llvm-svn: 3983
2002-09-29 22:55:45 +00:00
Vikram S. Adve 5b5dd671b2 Minor change to interface for Create{Zero,Sign}ExtensionsInstructions.
llvm-svn: 3979
2002-09-29 21:53:31 +00:00
Chris Lattner 85dd58c2cb Simplify code a bit, add an assertion
llvm-svn: 3974
2002-09-29 21:37:08 +00:00
Vikram S. Adve 8076fe87b7 Fixed method getReturnValue(): it should return NULL if the
callee does not return a value.

llvm-svn: 3968
2002-09-28 17:03:54 +00:00
Vikram S. Adve cce628aeaf Simplified code that handles call args and rets, so it no longer
needs the RegClass list to be passed in.

llvm-svn: 3964
2002-09-28 16:56:59 +00:00
Chris Lattner 647df647e1 First try at implementing the AliasSetTracker class. I'm sure it will need
revision as I start to use it though.

llvm-svn: 3954
2002-09-26 21:49:07 +00:00
Chris Lattner 9b4c1aa389 Checkin new loop-preheader insertion pass.
llvm-svn: 3943
2002-09-26 16:17:33 +00:00
Chris Lattner 0fcb61f2b7 - Fix bug in LoopInfo causing ParentLoop to be garbage
llvm-svn: 3940
2002-09-26 16:15:19 +00:00
Chris Lattner 6561db0c12 - Add methods to ImmediateDominators & DominatorTree to allow updates
- Make DominatorTree::Node not inherit from std::vector

llvm-svn: 3938
2002-09-26 16:14:37 +00:00
Chris Lattner 9ff37c5265 Add a new "DominatorSet::addDominator" method to allow updates
llvm-svn: 3937
2002-09-26 05:42:47 +00:00
Chris Lattner 0a96a521eb - Add new methods to LoopInfo: getLoopPreheader, addBasicBlockToLoop.
These allow extra information to be easily gathered, and loopinfo to be
    updated.

llvm-svn: 3935
2002-09-26 05:32:43 +00:00
Chris Lattner 506389a37f - Add new ctor to BasicBlock to allow insertion before any BB, not just at
the end of the function.

llvm-svn: 3933
2002-09-26 05:03:17 +00:00
Chris Lattner 7b5746bfcf Converted SimpleStructMutation to take TargetData as a required pass.
llvm-svn: 3931
2002-09-26 00:17:18 +00:00
Chris Lattner 79efacbb19 Change LowerAllocations pass to 'require' TargetData instead of it being
passed in.

llvm-svn: 3930
2002-09-25 23:47:49 +00:00
Chris Lattner fec6850f90 Convert TargetData to be an ImmutablePass
llvm-svn: 3928
2002-09-25 23:46:56 +00:00
Chris Lattner 635d8919a7 ImmutablePass's don't need a runOnFunction, nor do they need to explicitly say
that they preserve all xforms

llvm-svn: 3925
2002-09-25 22:27:54 +00:00
Chris Lattner 81f4eaab04 Convert BasicAA to be an immutable pass instead of a FunctionPass
llvm-svn: 3922
2002-09-25 22:00:18 +00:00
Chris Lattner ee0788d42d Add support for ImmutablePasses, which are not run, and cannot be
invalidated.

llvm-svn: 3921
2002-09-25 21:59:11 +00:00
Chris Lattner 7a6ce5a28c Checkin stub for Misha to implement
llvm-svn: 3919
2002-09-25 19:10:06 +00:00
Chris Lattner 068c681a84 - Do not expose Critical Edge breaking mechanics outside the BCE pass, thus
removing it from Transforms/Local.h and from Transforms/Utils/*

llvm-svn: 3909
2002-09-24 15:51:54 +00:00
Chris Lattner 13fea86b05 Expose passinfo from BreakCriticalEdges pass so that it may be "Required" by
other passes

llvm-svn: 3906
2002-09-24 15:42:27 +00:00
Chris Lattner 9f48a00e43 Add new BreakCriticalEdges pass
llvm-svn: 3902
2002-09-24 00:08:37 +00:00
Chris Lattner 34d39668f9 There are no implicit gep forms of load and store anymore
llvm-svn: 3901
2002-09-24 00:08:01 +00:00
Chris Lattner fc75a8552d Make users of FindUsedTypes not have problems with linkage. This fixes
cwriter.

llvm-svn: 3899
2002-09-24 00:07:17 +00:00
Chris Lattner 6b9be6f95a Group #includes better
llvm-svn: 3887
2002-09-23 17:45:52 +00:00
Anand Shukla ca15c99c4d Initial version: it adds 2 empty slots at the top of stack
llvm-svn: 3872
2002-09-21 04:58:26 +00:00
Vikram S. Adve 0a79c117ac Peephole optimization pass on final machine code.
llvm-svn: 3863
2002-09-20 16:33:03 +00:00
Vikram S. Adve c4869837dd Add erase() method for a single element.
llvm-svn: 3849
2002-09-20 00:55:57 +00:00
Vikram S. Adve bbf45f6960 Added class MachineOptInfo as interface to target-specific
routines supporting machine code optimization.
Also added method MachineInstrInfo::getNOPOpCode().

llvm-svn: 3845
2002-09-20 00:52:09 +00:00
Vikram S. Adve 302435b841 Interface to target-specific routines that support machine code optimization.
llvm-svn: 3844
2002-09-20 00:49:21 +00:00
Vikram S. Adve 97c348d9ec Add method MachineInstr::replace to rewrite a machine instruction in place.
llvm-svn: 3843
2002-09-20 00:47:49 +00:00
Chris Lattner 67b9d7f7a9 Workaround for bug in GCC 3.1.1 iostreams library on sparc. It apprarently
isn't flushing an ostream when it is deleted.

llvm-svn: 3834
2002-09-19 20:49:25 +00:00
Chris Lattner 3eeba80732 Fix ambiguity problem due to builtin log2(double) function
llvm-svn: 3800
2002-09-17 23:56:50 +00:00
Chris Lattner 5d15ed99a3 Fix namespace correctness bug
llvm-svn: 3798
2002-09-17 23:48:02 +00:00
Chris Lattner 011abb4a32 Add support for gcc 3.2
llvm-svn: 3795
2002-09-17 23:38:38 +00:00
Chris Lattner 95094782a1 Remove extra #include
llvm-svn: 3776
2002-09-17 17:18:12 +00:00
Vikram S. Adve a43a66fdc4 Fix typo in comment.
llvm-svn: 3773
2002-09-17 11:09:59 +00:00
Chris Lattner 8597d0e453 Fix compile problem on linux. Noone should ever #include <inttypes.h>
directly.  Instead, include Support/DataTypes.h

llvm-svn: 3766
2002-09-16 20:44:19 +00:00
Vikram S. Adve de72fca8a1 New preselection pass that specializes LLVM code for a target machine,
while remaining in legal portable LLVM form and preserving type
information and type safety.

llvm-svn: 3759
2002-09-16 18:08:17 +00:00
Vikram S. Adve 9d48fcaf1b Add ilist_iterator constructor from a node reference.
llvm-svn: 3756
2002-09-16 16:46:17 +00:00
Vikram S. Adve e3a75d6b33 Allow transformation DecomposeArrayRef(GetElementPtrInst* GEP) to
be invoked on a single instruction at a time, for use in other passes.

llvm-svn: 3751
2002-09-16 16:07:19 +00:00
Vikram S. Adve 5c363ba209 Add routines to update or erase operands (and to do so without external
assumptions about which operand number stores what operand).

llvm-svn: 3750
2002-09-16 16:06:12 +00:00
Vikram S. Adve 4b775b2763 *** empty log message ***
llvm-svn: 3749
2002-09-16 16:01:41 +00:00
Vikram S. Adve df7d0b5a9e Add support for passes that use a TargetMachine object.
llvm-svn: 3748
2002-09-16 16:01:39 +00:00
Vikram S. Adve 794cbb1e11 Add method MachineOperand::hasAllocatedReg().
llvm-svn: 3747
2002-09-16 15:58:54 +00:00
Vikram S. Adve 656e77d102 Add a version of ChooseRegOrImmed to handle numerical constants
introduced by InstrSelection.

llvm-svn: 3746
2002-09-16 15:58:34 +00:00
Vikram S. Adve 2d2fb24342 Add method adjustAlignment so that stack slot alignments can be computed
in a target-dependent manner (because of the dang OFFSET in Sparc v9).

llvm-svn: 3745
2002-09-16 15:57:43 +00:00
Vikram S. Adve fff5ffde27 Add methods to query about the representation of LLVM quantities (e.g.,
constants).  Useful for target-dependent LLVM transformations like
Preselection.

llvm-svn: 3743
2002-09-16 15:56:01 +00:00
Vikram S. Adve 4f5bad8d2e *** empty log message ***
llvm-svn: 3741
2002-09-16 15:39:35 +00:00
Vikram S. Adve d171a8c7c5 Remove unnecessary include.
llvm-svn: 3723
2002-09-14 23:04:52 +00:00
Vikram S. Adve c9f1e71360 Break RA_DEBUG option into several levels to get better output.
llvm-svn: 3722
2002-09-14 22:18:37 +00:00
Chris Lattner a4583fdafc Fix to work correctly under linux
llvm-svn: 3720
2002-09-14 19:52:49 +00:00
Vikram S. Adve a8f926c0c1 Moving to lib/CodeGen/RegAlloc.
llvm-svn: 3718
2002-09-14 11:57:17 +00:00
Vikram S. Adve 40a24e841e Add support for MacOS and (hopefully) other BSD derivatives.
llvm-svn: 3717
2002-09-14 10:42:59 +00:00
Chris Lattner fc91ee91e8 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.

llvm-svn: 3711
2002-09-13 22:28:50 +00:00
Chris Lattner 240f026d9a Tighten up sanity checking
llvm-svn: 3706
2002-09-13 22:18:26 +00:00
Chris Lattner 8c63fee2d9 Try to work well on multiple platforms.
llvm-svn: 3704
2002-09-13 21:51:25 +00:00
Chris Lattner e614665c1c Add better linux support by using the right macro. This still should be
autoconfiscated, but for now this is sufficient.

llvm-svn: 3701
2002-09-13 15:37:58 +00:00
Chris Lattner 5d40b83adf Checkin patch written by Casey Carter, enabling support for the redhat GCC 2.96
compiler.

llvm-svn: 3697
2002-09-13 14:33:39 +00:00
Chris Lattner 5e08e70f6c Add a new BasicBlockPass::doInitialization/Finalization(Function &) pair of
methods that may be useful for BasicBlockPasses.

llvm-svn: 3689
2002-09-12 17:06:43 +00:00