1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
Commit Graph

585 Commits

Author SHA1 Message Date
Alkis Evlogimenos
61db3621bd Use a list instead of a vector to store intervals. This will be needed
when we join intervals and one of the two will need to be removed.

llvm-svn: 10892
2004-01-16 16:06:59 +00:00
Alkis Evlogimenos
c73c31a496 Remove allocatable registers vector. It is already provided by
LiveVariables.

llvm-svn: 10830
2004-01-13 22:10:43 +00:00
Alkis Evlogimenos
ef7c077e63 Make LiveVariables::HandlePhysRegUse and
LiveVariables::HandlePhysRegDef private they use information that is
not in memory when LiveVariables finishes the analysis.

Also update the TwoAddressInstructionPass to not use this interface.

llvm-svn: 10755
2004-01-11 09:18:45 +00:00
Chris Lattner
c37577eb9f Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.

llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Alkis Evlogimenos
fc01aac4d8 Add coalescing to register allocator. A hint is added to each interval
which denotes the register we would like to be assigned to (virtual or
physical). In register allocation, if this hint exists and we can map
it to a physical register (it is either a physical register or it is a
virtual register that already got assigned to a physical one) we use
that register if it is available instead of a random one in the free
pool.

llvm-svn: 10634
2003-12-28 17:58:18 +00:00
Chris Lattner
215d4146fe add argument
llvm-svn: 10625
2003-12-28 09:42:49 +00:00
Chris Lattner
00a54b7c00 Move header into top-level llvm dir
llvm-svn: 10622
2003-12-28 08:30:07 +00:00
Chris Lattner
8bc92e92ee Add new interface that allows removal of some code from the code generators,
provides for future extensibility, might help the LLVA project avoid having to
hack their own LLI, and provides support required for the experimental Venus
project.

llvm-svn: 10620
2003-12-28 08:19:13 +00:00
Alkis Evlogimenos
4401d0a7a3 Change weight into a float so that we can take into account the
nesting level when computing it. Right now the allocator uses:

    w = sum_over_defs_uses( 10 ^ nesting level );

llvm-svn: 10569
2003-12-21 20:19:10 +00:00
Alkis Evlogimenos
4f98b79ef0 Add support for inactive intervals. This effectively reuses registers
for live ranges that fall into assigned registers' holes.

llvm-svn: 10566
2003-12-21 05:43:40 +00:00
Chris Lattner
58d2beb555 Rearrange code, indent for the namespace, add the createMachineFunctionPrinterPass
to passes.h, and add the machien destruction pass to Passes.h

llvm-svn: 10557
2003-12-20 10:18:58 +00:00
Chris Lattner
f987d900a4 Remove sparc specific passes from public headers
llvm-svn: 10552
2003-12-20 09:15:21 +00:00
Chris Lattner
1963b162db Remove a horrible API
llvm-svn: 10551
2003-12-20 09:15:01 +00:00
Alkis Evlogimenos
9181e0ab5b Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.

llvm-svn: 10520
2003-12-18 22:40:24 +00:00
Alkis Evlogimenos
90aeecae42 Add TwoAddressInstructionPass to handle instructions that have two or
more operands and the two first operands are constrained to be the
same. The pass takes an instruction of the form:

        a = b op c

and transforms it into:

        a = b
        a = a op c

and also preserves live variables.

llvm-svn: 10512
2003-12-18 13:06:04 +00:00
Alkis Evlogimenos
befef566f6 Rename LiveIntervals::expired() to LiveIntervals::expiredAt().
llvm-svn: 10511
2003-12-18 08:56:11 +00:00
Alkis Evlogimenos
8e2fcc7d79 Handle multiple virtual register definitions gracefully.
Move some of the longer LiveIntervals::Interval method out of the
header and add debug information to them. Fix bug and simplify range
merging code.

llvm-svn: 10509
2003-12-18 08:48:48 +00:00
Alkis Evlogimenos
ac4fe24ed8 I wonder how this didn't cause any tests to fail...
llvm-svn: 10462
2003-12-14 13:30:19 +00:00
Alkis Evlogimenos
29127b8825 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
f84f86137b Ignore non-allocatable physical registers in live interval analysis.
llvm-svn: 10449
2003-12-13 11:11:02 +00:00
Alkis Evlogimenos
229c2b9181 Move operator<<(std::ostream&, const LiveInterval&) out of the header file.
llvm-svn: 10290
2003-12-05 10:38:28 +00:00
Chris Lattner
e595976ed9 Add some "useful" methods
llvm-svn: 10277
2003-12-01 05:30:29 +00:00
Alkis Evlogimenos
6627a32ff9 Merging the linear scan register allocator in trunk. It currently passes most tests under test/Programs/SingleSource/Benchmarks/Shootout so development will continue on trunk. The allocator is not enabled by default. You will need to pass -regallo=linearscan to lli or llc to use it.
llvm-svn: 10103
2003-11-20 03:32:25 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
59ee30fa40 Actually share constants local to a function!
llvm-svn: 9417
2003-10-23 16:29:12 +00:00
Chris Lattner
a227bfeff3 Add a new map
llvm-svn: 9311
2003-10-20 20:55:13 +00:00
John Criswell
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Brian Gaeke
2a7cedb657 This file has funny include guards and funny extra whitespace.
Make this file less funny.

llvm-svn: 9186
2003-10-16 23:43:35 +00:00
Chris Lattner
9db0d011b4 We'll need this soon as well
llvm-svn: 9145
2003-10-15 22:09:46 +00:00
Alkis Evlogimenos
33a498f90c Forward declare class Type since it is used in this class and Type.h is not included
llvm-svn: 8958
2003-10-08 04:45:45 +00:00
Alkis Evlogimenos
a37b58ce09 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
llvm-svn: 8819
2003-10-02 16:57:49 +00:00
Alkis Evlogimenos
42a09316bb Change llc command line for register allocators
llvm-svn: 8815
2003-10-02 06:13:19 +00:00
Chris Lattner
c3767eab12 Forward declare a class
llvm-svn: 8797
2003-09-30 20:15:40 +00:00
Chris Lattner
d63bd276f0 This got merged into Passes.h
llvm-svn: 8796
2003-09-30 20:15:32 +00:00
Chris Lattner
08d6f140ab Include the sparc register in this file
llvm-svn: 8794
2003-09-30 20:14:43 +00:00
Chris Lattner
4e4c763dfc Standardize header file comments
llvm-svn: 8782
2003-09-30 18:37:50 +00:00
Chris Lattner
0c15a20712 Fix header comment
llvm-svn: 8779
2003-09-30 18:12:25 +00:00
Chris Lattner
1ea5d5a0c0 Fix header, remove dead decl
llvm-svn: 8777
2003-09-30 18:06:51 +00:00
Chris Lattner
7d059b8c3d Fix header file comment
llvm-svn: 8776
2003-09-30 18:05:30 +00:00
Chris Lattner
87d223c70e Remove header files that were privatized
llvm-svn: 8307
2003-09-01 20:33:38 +00:00
Chris Lattner
aeb98733eb This file is never #included
llvm-svn: 8300
2003-09-01 20:19:31 +00:00
Tanya Lattner
ff06e1a796 Moved index in BB to common graph class.
llvm-svn: 8175
2003-08-28 15:31:28 +00:00
Tanya Lattner
68f651356f *** empty log message ***
llvm-svn: 8161
2003-08-27 15:52:23 +00:00
Tanya Lattner
93162e16d6 Cleaned up the code (spacing, not needed headers) and changed ostream function. Also made some functions inline.
llvm-svn: 8154
2003-08-27 02:45:08 +00:00
Tanya Lattner
9353c099ac SchedGraphCommon header file. Contains class definition for SchedGraphCommon which is used by SchedGraph and ModuloSchedGraph (coming soon).
llvm-svn: 8149
2003-08-25 23:12:23 +00:00
Chris Lattner
8e9740071f Add missing #include
llvm-svn: 8063
2003-08-22 23:08:55 +00:00
Misha Brukman
cda7f97dbb The word dependent' has no a'.
llvm-svn: 8030
2003-08-21 22:14:26 +00:00
Chris Lattner
d929db2450 Add support for basic blocks, unary/binary unspecs, conditional branches, ...
llvm-svn: 7874
2003-08-15 04:52:51 +00:00
Brian Gaeke
4651096037 Factory methods for function passes now return type FunctionPass *.
llvm-svn: 7839
2003-08-14 06:09:32 +00:00
Brian Gaeke
77c65be59e Factory methods for FunctionPasses now return type FunctionPass *.
llvm-svn: 7823
2003-08-13 18:18:15 +00:00
Vikram S. Adve
1e41dd39ae Make MInst2LVSetBI and MInst2LVSetAI be hash_maps instead of maps.
Add some comments and non-const methods to fix constness problems.

llvm-svn: 7797
2003-08-12 23:39:08 +00:00
Chris Lattner
49f6244b56 Initial checkin of SelectionDAG header file
llvm-svn: 7716
2003-08-11 14:56:26 +00:00
Chris Lattner
142e03de74 There was no reason for these to be bit-fields, they just need to be unique.
Also, add an isVoid item

llvm-svn: 7659
2003-08-07 00:17:00 +00:00
Chris Lattner
138a3fc9ab Completely eliminate the per-machine-instruction regsUsed set.
This substantially shrinks the size of each machine instruction, which should
make allocation faster and the cache footprint of the machine code lighter.

Here are some timings for code generation of the larger benchmarks we have.
This are timings of code generation phases of the X86 JIT, when compiled in
debug mode:

		Before	After	Diff
164.gzip:
  InstSel	0.0878	0.0722	-21.6%
  RegAlloc	0.2031	0.1757	-15.6%
  TOTAL		0.5585	0.4999	-11.7%
Ptrdist-bc:
  InstSel	0.0878	0.0722	-21.6%
  RegAlloc	0.2070	0.1933	- 7.1%
  TOTAL		0.6972	0.6464	- 7.9%
197.parser:
  InstSel	0.2148	0.2148	- 0.0%
  RegAlloc	0.4941	0.4277	-15.5%
  TOTAL		1.3749	1.2851	- 7.0%
175.vpr:
  InstSel	0.2519	0.2109	-19.4%
  RegAlloc	0.5976	0.5663	- 5.5%
  TOTAL		1.6933	1.6347	- 3.5%
254.gap:
  InstSel	1.1328	0.9921	-14.2%
  RegAlloc	2.6933	2.4804	- 8.6%
  TOTAL		7.7871	7.2499	- 7.4%

llvm-svn: 7622
2003-08-05 22:39:13 +00:00
Chris Lattner
a826c8d485 Do not insert physical regsiters into the regsUsed set
llvm-svn: 7617
2003-08-05 21:55:20 +00:00
Chris Lattner
8da1b00db6 Remove unused method
llvm-svn: 7608
2003-08-05 17:09:08 +00:00
Chris Lattner
b047a0d449 All callers of these methods actually wanted them to preserve the flags,
so get rid of the def/use parameters that were getting passed in.

**** This now changes the semantics of these methods to preserve the flags,
     not clobber them!

llvm-svn: 7602
2003-08-05 16:58:46 +00:00
Vikram S. Adve
37047489b7 Don't require a BB to look-up live variables, unless they may need to
be recomputed.

llvm-svn: 7384
2003-07-29 19:32:04 +00:00
Chris Lattner
9b62a24451 Fix copy and paste-o
llvm-svn: 7378
2003-07-29 05:15:44 +00:00
Chris Lattner
337787e85b Define target value types in a form usable by target-independent code
llvm-svn: 7375
2003-07-29 05:13:09 +00:00
Chris Lattner
a522d0ebf9 Code generation phases are not allowed to modify the LLVM representation.
Because of this, we'll make the MBB->BB mapping const as it should be

llvm-svn: 7351
2003-07-26 23:30:37 +00:00
Chris Lattner
e99fa3f42e Whoops, this one was needed
llvm-svn: 7346
2003-07-26 23:18:11 +00:00
Chris Lattner
9224631d6b Remove extraneous #includes
llvm-svn: 7341
2003-07-26 23:00:29 +00:00
Vikram S. Adve
19309fca4b Add an assertion.
llvm-svn: 7326
2003-07-25 20:58:57 +00:00
Misha Brukman
5de3e14206 The word separate' only has one e'.
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
Vikram S. Adve
d8b600cb85 Values stored in CallArgsDescriptor cannot be const.
llvm-svn: 7156
2003-07-10 19:46:15 +00:00
Vikram S. Adve
6aa3abf7fa Change interface to MachineInstr::substituteValue to specify more precisely
which args can be substituted: defsOnly, defsAndUses or usesOnly.

llvm-svn: 7154
2003-07-10 19:45:07 +00:00
Vikram S. Adve
e133e7d852 Leak fix: delete old objects before reallocation in an assignment operator!
llvm-svn: 7055
2003-07-02 01:25:44 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
6c12776232 Remove a ton of extraneous #includes
llvm-svn: 6842
2003-06-22 03:08:05 +00:00
John Criswell
4781723de6 Included assert.h so that the code compiles under newer versions of GCC.
llvm-svn: 6682
2003-06-11 14:01:36 +00:00
Chris Lattner
7aaea42f1e Minor cleanups:
* Document the MOTy namespace correctly for doxygen
  * Eliminate usage of the MachineOpCode typedef, which should eventually
    be eliminated entirely.

llvm-svn: 6584
2003-06-03 15:42:53 +00:00
Chris Lattner
846c593142 Remove use of enum
llvm-svn: 6582
2003-06-03 15:41:45 +00:00
Chris Lattner
b1c22980b1 Remove noncopyable base class as it was making the doxygen docs harder to read
llvm-svn: 6576
2003-06-03 15:29:12 +00:00
Chris Lattner
68f1b02a60 Remove NonCopyable base class to clean up doxygen output
llvm-svn: 6551
2003-06-02 22:07:37 +00:00
Chris Lattner
d94534c537 Hack up MachineCodeEmitter to actually be target independent.
llvm-svn: 6514
2003-06-01 23:20:02 +00:00
Vikram S. Adve
2c9fc5ded3 Renamed a variable.
llvm-svn: 6472
2003-05-31 07:43:41 +00:00
Vikram S. Adve
c40874054e Support for annul/pred and other future flags on op codes.
Support for recording the physical register for implcit references.

llvm-svn: 6471
2003-05-31 07:43:01 +00:00
Vikram S. Adve
d43c10b583 Added MachineCodeForInstruction object as an argument to
TmpInstruction constructors because every TmpInstruction object has
to be registered with a MachineCodeForInstruction to prevent leaks.
This simplifies the user's code.

llvm-svn: 6469
2003-05-31 07:41:24 +00:00
Misha Brukman
c5a1e94883 Added saveBBreferences() for BasicBlock resolution.
llvm-svn: 6451
2003-05-30 20:32:45 +00:00
Misha Brukman
6e0ae68c05 Defines a pass-through debugging emitter -- it writes to a file for inspection
and to memory to test execution (using a passed-in code emitter).

llvm-svn: 6365
2003-05-27 21:46:56 +00:00
Vikram S. Adve
ab50c0aee5 Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags.  Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".

llvm-svn: 6342
2003-05-27 00:06:48 +00:00
Chris Lattner
afc685b278 Beef up interface, move getVarInfo out-of-line.
llvm-svn: 6114
2003-05-12 14:23:04 +00:00
Chris Lattner
d06c47110a Expand API for updating live var info.
Expose iterators, not const-iterators.
Rename method that was VERY misleading

llvm-svn: 6108
2003-05-12 03:51:30 +00:00
Chris Lattner
3160b1235e Allow const functions
llvm-svn: 6056
2003-05-09 03:27:41 +00:00
Chris Lattner
836e8c1f2a Fix bug in last checkin
llvm-svn: 6055
2003-05-08 22:00:52 +00:00
Chris Lattner
7c8bf633a5 Add new methods for stub generation
llvm-svn: 6053
2003-05-08 21:53:57 +00:00
Chris Lattner
d2fae9f27c Add comments, add a vector to keep track of which registers are allocatable
llvm-svn: 6014
2003-05-07 20:07:58 +00:00
Chris Lattner
1d35ac61ce Print machine frame objects with the frame offset intrinsic to the machine
llvm-svn: 5329
2003-01-16 18:35:57 +00:00
Chris Lattner
301e1307d2 Move sparc specific code into the Sparc backend
llvm-svn: 5317
2003-01-15 21:36:50 +00:00
Chris Lattner
30fbd2d1fe Move private headers into private regalloc directory
llvm-svn: 5308
2003-01-15 20:26:32 +00:00
Chris Lattner
7f85810349 Move private header to private dir
llvm-svn: 5304
2003-01-15 19:50:32 +00:00
Chris Lattner
cfa7a8f9a2 Remove obsolete ctor
llvm-svn: 5301
2003-01-15 19:47:02 +00:00
Chris Lattner
7a5291a0c9 Remove internal helper fn
llvm-svn: 5300
2003-01-15 19:46:39 +00:00
Chris Lattner
d06cd53a81 ADd support for CC registers for Sparc BE
llvm-svn: 5297
2003-01-15 19:22:23 +00:00
Chris Lattner
f254db43cd Add support for the CC registers for Sparc BE
llvm-svn: 5296
2003-01-15 19:22:06 +00:00
Chris Lattner
8c56dc23a5 Remove more unused methods
llvm-svn: 5295
2003-01-15 19:21:50 +00:00
Chris Lattner
e6fb373c01 Remove a ton of functions that are no longer used, instead using BuildMI
llvm-svn: 5290
2003-01-15 17:35:44 +00:00
Chris Lattner
856c3ad41c Add new helper method addRegDef
llvm-svn: 5289
2003-01-15 17:18:22 +00:00
Chris Lattner
14021140c0 * Eliminate a bunch of inline functions.
* Convert callers to use BuildMI instead

llvm-svn: 5286
2003-01-15 00:02:41 +00:00
Chris Lattner
57b5e8891e Move llvm/Analysis/LiveVar/ValueSet.h to CodeGen/ValueSet.h
llvm-svn: 5282
2003-01-14 22:56:37 +00:00
Chris Lattner
ab69d9da2f Move annotation to support library
llvm-svn: 5268
2003-01-14 21:29:58 +00:00
Chris Lattner
fb1bfc8cde Add new files
llvm-svn: 5259
2003-01-13 01:01:31 +00:00
Chris Lattner
2edf53b7c0 Simplify interface to creating a register
llvm-svn: 5211
2003-01-13 00:19:18 +00:00
Chris Lattner
9d9b72a2c2 * Add support for new types of operands
llvm-svn: 5210
2003-01-13 00:18:44 +00:00
Chris Lattner
1f29ca49c7 * Add 3 new types of MachineOperand: ConstantPoolIndex ExternalSymbol and GlobalAddress's
* Add new isPCRelative modifier flag which should be used in place of MO_PCRelativeDisp type.
* Fix a bug in isPhysicalRegister
* Add new setOpcode and RemoveOperand methods

llvm-svn: 5209
2003-01-13 00:18:17 +00:00
Chris Lattner
abdcdcb67c * Add a constant pool to hold per-function constants which must be spilled to memory
llvm-svn: 5208
2003-01-13 00:16:10 +00:00
Chris Lattner
4eda5395e8 * Add utility methods which make common cases easier
llvm-svn: 5207
2003-01-13 00:15:24 +00:00
Chris Lattner
a17e5baf63 * Add support for values in the constant pool
* Add support for functions referenced by name

llvm-svn: 5206
2003-01-13 00:14:55 +00:00
Chris Lattner
dfa3c21f1c More renamings of Target/Machine*Info to Target/Target*Info
llvm-svn: 5204
2002-12-29 03:13:05 +00:00
Chris Lattner
ea33ca1e96 Rename FunctionFrameInfo to MachineFrameInfo
llvm-svn: 5201
2002-12-28 21:08:28 +00:00
Chris Lattner
e1f68f8e08 Descriptor object used to manage abstract frame references
llvm-svn: 5166
2002-12-28 20:07:47 +00:00
Chris Lattner
6c1ee16321 State for frame and constant pool information pulled out of MachineFunction
llvm-svn: 5165
2002-12-28 20:07:33 +00:00
Chris Lattner
84cb1f5dbc * Frame indices are signed
* Cluster modification methods together

llvm-svn: 5164
2002-12-28 20:05:44 +00:00
Chris Lattner
59c301a15a * Pull a bunch of frame and constant pool state out into a new
MachineFunctionInfo class
* Add a new FunctionFrameInfo object

llvm-svn: 5163
2002-12-28 20:04:31 +00:00
Chris Lattner
db5cd8b071 Initial check in of MachineFunctionPass.h
llvm-svn: 5162
2002-12-28 20:03:01 +00:00
Chris Lattner
47e342f4bf Add abstract frame index capability
llvm-svn: 5140
2002-12-25 05:01:18 +00:00
Chris Lattner
b898c53b42 Remove default ctor
llvm-svn: 5139
2002-12-25 05:01:05 +00:00
Chris Lattner
aea2f8e9da *** empty log message ***
llvm-svn: 5138
2002-12-25 05:00:49 +00:00
Chris Lattner
a5ba3d9b3d Remove dependency on SSARegMap.h
llvm-svn: 5137
2002-12-25 05:00:16 +00:00
Chris Lattner
7ac77c761c Add new opIsUse method
llvm-svn: 5062
2002-12-15 22:05:02 +00:00
Chris Lattner
026fa9948b 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
Chris Lattner
74e9df0627 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
329956d9f9 Get rid of deprecated function
llvm-svn: 4997
2002-12-13 07:30:45 +00:00
Chris Lattner
d0a42dbe95 Add support for direct global references
llvm-svn: 4905
2002-12-04 06:44:27 +00:00
Chris Lattner
af812d279c Add virtual dtor, expose a debug impl
llvm-svn: 4892
2002-12-03 20:56:20 +00:00
Chris Lattner
2ebb6f1a57 More support
llvm-svn: 4873
2002-12-02 21:56:28 +00:00
Chris Lattner
ce514e232d Start adding to the meat of MachineCodeEmitter
llvm-svn: 4869
2002-12-02 21:44:13 +00:00
Chris Lattner
54d6377268 Initial version of MachineCodeEmitter interface: empty
llvm-svn: 4864
2002-12-02 21:21:36 +00:00
Misha Brukman
940cfa8597 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
0f0cc54805 Set SSARegMap to NULL after deleting it.
llvm-svn: 4822
2002-11-22 22:32:15 +00:00
Misha Brukman
fbaf9e7ad0 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
6315957999 Add helper method
llvm-svn: 4744
2002-11-18 06:57:05 +00:00
Chris Lattner
3afc487fba Print is const!
llvm-svn: 4737
2002-11-17 23:22:13 +00:00
Chris Lattner
b51a2857f2 Finish enumating code
llvm-svn: 4726
2002-11-17 22:33:54 +00:00
Chris Lattner
4bc444f503 Remove unused methods
llvm-svn: 4720
2002-11-17 22:14:22 +00:00
Chris Lattner
16b1ec97f0 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
dcfed3413d Return const refefrences to enable default construction
llvm-svn: 4713
2002-11-17 21:02:42 +00:00
Brian Gaeke
492e05ba01 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
Vikram S. Adve
d44e2577de Bug fix: need to initialize new CallArgsDescriptor pointer.
llvm-svn: 4453
2002-10-30 20:38:49 +00:00
Vikram S. Adve
beba0cd579 Bug fix in setting an implicit ref.
llvm-svn: 4452
2002-10-30 20:38:16 +00:00
Chris Lattner
be221c6013 Allow BuildMI that helps automate construction of SSA information
llvm-svn: 4443
2002-10-30 01:48:41 +00:00
Chris Lattner
55da33fe73 Add support for structured printing
llvm-svn: 4432
2002-10-30 00:46:48 +00:00
Chris Lattner
4430feb9b5 Improve comments, add methods for structured printing
llvm-svn: 4431
2002-10-30 00:46:31 +00:00
Chris Lattner
e78186b693 Add method
llvm-svn: 4428
2002-10-29 23:40:30 +00:00
Chris Lattner
82a3299cf1 Add capability to have machine instruction autoinsert when it is created
llvm-svn: 4424
2002-10-29 23:18:23 +00:00
Chris Lattner
fc88414ffd Merge with sparc backend
llvm-svn: 4403
2002-10-29 20:10:58 +00:00
Chris Lattner
fdbc0f40ce X86 merge complete, eliminate dead code
llvm-svn: 4401
2002-10-29 20:07:50 +00:00
Chris Lattner
0ac25d509c X86 merge is complete, eliminate unused code
llvm-svn: 4400
2002-10-29 20:07:16 +00:00
Vikram S. Adve
4acb69b4ea 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
1730a958ea 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
b4ee80190b Remove old entrypoint
llvm-svn: 4385
2002-10-29 17:15:01 +00:00
Chris Lattner
8feac53561 Remove unneeded #include
llvm-svn: 4384
2002-10-29 17:14:10 +00:00
Chris Lattner
0493b81eef De-inline methods
llvm-svn: 4379
2002-10-29 16:50:33 +00:00
Chris Lattner
4aba455989 Remove unneeded #include
llvm-svn: 4377
2002-10-29 16:50:06 +00:00
Chris Lattner
0cff6f7e16 Make assertIGNode be private to the InterferenceGraph.cpp file
llvm-svn: 4375
2002-10-29 16:42:34 +00:00
Chris Lattner
54eff4bcba Remove unneccesary #include
llvm-svn: 4374
2002-10-29 16:34:12 +00:00
Chris Lattner
0a2b3a9a7b Delete unused header file
llvm-svn: 4373
2002-10-29 16:32:08 +00:00
Chris Lattner
be89ca4b5a Minor comment updates
llvm-svn: 4361
2002-10-28 21:43:42 +00:00
Chris Lattner
8727a8f2d1 Initial checkin of MachineInstrBuilder class
llvm-svn: 4360
2002-10-28 21:31:48 +00:00
Chris Lattner
566b2147f9 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
11f52470a0 Remove more default arguments that are never used
llvm-svn: 4358
2002-10-28 21:02:40 +00:00
Chris Lattner
990e074c2e Remove default operands that are never used
llvm-svn: 4357
2002-10-28 20:59:49 +00:00
Chris Lattner
de6ac9b0ff * 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
0daac26c02 Iterator functions now line up together.
llvm-svn: 4350
2002-10-28 19:58:38 +00:00
Chris Lattner
74f9160190 Remove two arguments that are never specified
llvm-svn: 4348
2002-10-28 19:46:59 +00:00
Chris Lattner
f2cd0a8266 s/method/function
llvm-svn: 4338
2002-10-28 05:58:46 +00:00
Chris Lattner
7cdc2977f0 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
a215fe71ce Remove typedef that is unneccesary
llvm-svn: 4332
2002-10-28 04:50:01 +00:00
Chris Lattner
e309cdbc95 Rename the redundant MachineOperand::getOperandType() to MachineOperand::getType()
llvm-svn: 4331
2002-10-28 04:45:29 +00:00
Chris Lattner
a7cfe8ccb5 Add new getOperandType(i) method to MachineInstr
llvm-svn: 4330
2002-10-28 04:30:20 +00:00
Chris Lattner
7000bbb63f 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
824d112715 Make MachineInstr.h not #include MachineInstrInfo.h
llvm-svn: 4328
2002-10-28 02:29:46 +00:00
Chris Lattner
a7e9d3e90f Don't #include <Support/*>, #include "Support/*"
llvm-svn: 4325
2002-10-28 02:11:53 +00:00
Chris Lattner
daf162b45a 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
2b2fbdf33c MachineFunction.h now includes MachineBasicBlock.h in preparation for
list changes.

llvm-svn: 4321
2002-10-28 02:01:06 +00:00
Chris Lattner
85e7d46739 Remvoe dead fixme and typedef
llvm-svn: 4320
2002-10-28 01:55:26 +00:00
Chris Lattner
46509e42f8 MachineBasicBlock doesn't need basicblock.h, it needs Annotation.h
llvm-svn: 4319
2002-10-28 01:53:00 +00:00
Chris Lattner
cd476842d3 Rename file to MachineBasicBlock.h
llvm-svn: 4316
2002-10-28 01:39:21 +00:00
Chris Lattner
384e13e39c Add note about state that should be removed when time permits
llvm-svn: 4315
2002-10-28 01:27:51 +00:00
Chris Lattner
310d9124e3 Fixes to previous checkin
llvm-svn: 4314
2002-10-28 01:27:30 +00:00
Chris Lattner
4f2c612b21 Inline some methods from .cpp files into .h files, minor cleanups
llvm-svn: 4313
2002-10-28 01:21:55 +00:00
Chris Lattner
d711c00823 Add prototypes for creation/destruction passes
llvm-svn: 4309
2002-10-28 01:11:58 +00:00
Chris Lattner
ecbd9d640d This header is renamed to MachineFunction.h
llvm-svn: 4304
2002-10-28 00:45:06 +00:00
Chris Lattner
778ffa3786 We don't need the forwarding typedef
llvm-svn: 4303
2002-10-28 00:44:09 +00:00
Misha Brukman
142795fd17 Changed MachineCodeForMethod' to MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner
e9a1ab1e0a Add support or other operand types
llvm-svn: 4298
2002-10-27 21:17:45 +00:00
Chris Lattner
2bc0fd8115 Prune #includes
llvm-svn: 4295
2002-10-27 20:49:47 +00:00
Chris Lattner
65c82a0310 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
e68a9a15dd Minor cleanups
llvm-svn: 4267
2002-10-23 01:11:51 +00:00
Chris Lattner
dfc8fbf16b - 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
1fb6129889 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
eed53d4b81 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
cd13b5e27f Add a missing std:: qualifier
llvm-svn: 4244
2002-10-21 13:23:42 +00:00
Vikram S. Adve
3cb2d3379d Removed misleading const keyword.
llvm-svn: 4169
2002-10-14 16:32:24 +00:00
Vikram S. Adve
dddfcdc478 Added several more helper functions for construction MachineInstrs.
llvm-svn: 3983
2002-09-29 22:55:45 +00:00
Vikram S. Adve
7e39b876eb 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
Anand Shukla
508121e5d9 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
43881f46b0 Peephole optimization pass on final machine code.
llvm-svn: 3863
2002-09-20 16:33:03 +00:00
Vikram S. Adve
248e623726 Add erase() method for a single element.
llvm-svn: 3849
2002-09-20 00:55:57 +00:00
Vikram S. Adve
47303cde2d Add method MachineInstr::replace to rewrite a machine instruction in place.
llvm-svn: 3843
2002-09-20 00:47:49 +00:00
Vikram S. Adve
feebe5999b 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
37d1a733b1 Add method MachineOperand::hasAllocatedReg().
llvm-svn: 3747
2002-09-16 15:58:54 +00:00
Vikram S. Adve
ef1f7d3e42 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
8d2a9260ef Remove unnecessary include.
llvm-svn: 3723
2002-09-14 23:04:52 +00:00
Vikram S. Adve
263de0387d Break RA_DEBUG option into several levels to get better output.
llvm-svn: 3722
2002-09-14 22:18:37 +00:00
Vikram S. Adve
7cad54b354 Moving to lib/CodeGen/RegAlloc.
llvm-svn: 3718
2002-09-14 11:57:17 +00:00
Chris Lattner
2550723883 Move TmpInstruction ctor to InstrSelection.cpp file
llvm-svn: 3622
2002-09-08 21:07:51 +00:00
Vikram S. Adve
f699596601 Added function GetMemInstArgs and made FoldGetElemChain private.
llvm-svn: 3503
2002-08-24 21:03:10 +00:00
Vikram S. Adve
6fe717b03b Added support for type inquiry in subclasses of InstTreeNode.
llvm-svn: 3502
2002-08-24 21:02:42 +00:00
Vikram S. Adve
3567460977 Just some extra comments.
llvm-svn: 3446
2002-08-22 03:03:10 +00:00
Chris Lattner
6c83ee57c1 - Do not expose ::ID from any of the analyses anymore.
llvm-svn: 3417
2002-08-21 17:09:49 +00:00
Vikram S. Adve
227bd369e5 Change opLabel numbers for Not and BNot.
Also, these tree nodes are now binary, not unary.

llvm-svn: 3344
2002-08-15 14:20:45 +00:00
Vikram S. Adve
afb9cae44d Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.

Also add method MachineOperand::getVRegValueOrNull().

llvm-svn: 3307
2002-08-14 16:54:11 +00:00
Chris Lattner
9bcfec701d Do not add an extra vtable to EVERY machineinstr created.
llvm-svn: 3280
2002-08-09 21:49:21 +00:00
Chris Lattner
4d9fadc44a * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3277
2002-08-09 20:08:03 +00:00
Chris Lattner
eeb7564269 Change machinecode for instruction to not inherit from vector.
llvm-svn: 3274
2002-08-09 20:04:28 +00:00
Vikram S. Adve
34c7fef2d6 Add function GetConstantValueAsUnsignedInt.
llvm-svn: 3249
2002-08-04 20:55:59 +00:00
Chris Lattner
4b68cd0c61 Expose instruction selection as a pass instead of a global function
llvm-svn: 3145
2002-07-30 03:55:29 +00:00
Chris Lattner
b202b77aab * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.

llvm-svn: 3124
2002-07-29 21:03:33 +00:00
Chris Lattner
ea9fb2a20a *** empty log message ***
llvm-svn: 3111
2002-07-26 21:11:42 +00:00
Chris Lattner
e056a17a88 *** empty log message ***
llvm-svn: 3107
2002-07-26 19:19:31 +00:00
Chris Lattner
0ccf5689e3 *** empty log message ***
llvm-svn: 3077
2002-07-25 15:00:45 +00:00
Chris Lattner
743688359d *** empty log message ***
llvm-svn: 3067
2002-07-24 22:20:06 +00:00
Chris Lattner
ad8fc4ba3e Non-standard hash classes are not in the std:: namespace
llvm-svn: 3057
2002-07-24 21:21:33 +00:00
Chris Lattner
9860e64083 *** empty log message ***
llvm-svn: 3056
2002-07-24 21:21:32 +00:00
Mehwish Nagda
48d84fb234 Moved to Reoptimizer/Mapping directory
llvm-svn: 2991
2002-07-22 22:06:56 +00:00
Mehwish Nagda
c2f7ac0eec *** empty log message ***
llvm-svn: 2912
2002-07-15 23:56:27 +00:00
Vikram S. Adve
8967349e85 Bug fix: cast (bool) has higher precedence than %... who knew!
llvm-svn: 2864
2002-07-10 21:51:46 +00:00
Vikram S. Adve
36b62ee33a Add support for marking each operand as a %hh, %hm, %lm or %lo.
Represent previous bools and these ones with flags in a single byte
per operand.

llvm-svn: 2863
2002-07-10 21:50:57 +00:00
Vikram S. Adve
cd651d5577 Added a few more methods for creating instructions.
llvm-svn: 2862
2002-07-10 21:49:38 +00:00
Anand Shukla
b9a34f17ff added std:: to hash_set
llvm-svn: 2846
2002-07-09 19:18:16 +00:00
Chris Lattner
bc68100d59 Include header in the compiler-neutral location
llvm-svn: 2843
2002-07-09 16:50:24 +00:00
Vikram S. Adve
bacbe6b240 Interface to class MachineCodeForBasicBlock.
Moved here from MachineInstr.h to make it an annotation on BasicBlock.

llvm-svn: 2823
2002-07-08 22:40:34 +00:00
Vikram S. Adve
a110ccca19 Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.{cpp,h}.
An (explicit or implicit) operand may now be both a def and a use.
Also add a set of regs used by each instruction.
dump() no longer takes an optional argument, which doesn't work in gdb.

llvm-svn: 2821
2002-07-08 22:38:45 +00:00
Vikram S. Adve
4d696efa99 Added two more helper functions for instruction creation.
llvm-svn: 2819
2002-07-08 22:33:45 +00:00
Anand Shukla
bddcd163a1 changes to make it compatible with 64bit gcc
llvm-svn: 2786
2002-06-25 20:22:25 +00:00
Chris Lattner
cee706572b *** empty log message ***
llvm-svn: 2777
2002-06-25 16:12:52 +00:00
Chris Lattner
e61bc07952 Convert RegClass::IsColorUsedArr from a dynamically allocated array to
a vector.  This makes asserting on array bounds easier.

llvm-svn: 2731
2002-05-23 15:50:03 +00:00
Chris Lattner
07732a38b7 Avoid #including CommandLine.h
llvm-svn: 2710
2002-05-22 17:06:56 +00:00
Vikram S. Adve
2552231a8c Better interface to generating machine instr for common cases
(many places still need to be updated to use this interface).

llvm-svn: 2648
2002-05-19 15:40:41 +00:00
Vikram S. Adve
0cc9f53701 MachineInstr now inherits from Annotable.
llvm-svn: 2647
2002-05-19 15:39:59 +00:00
Vikram S. Adve
1f8badf623 Annotation class for MachineInstr.
llvm-svn: 2643
2002-05-19 15:30:21 +00:00
Chris Lattner
ca6c5955f4 remove deprecated getInstType() method
llvm-svn: 2595
2002-05-10 13:28:47 +00:00
Chris Lattner
96e0c48175 Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
589debc4ba Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.

llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner
2f0ee1833d s/Method/Function
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner
536cf1b13f * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Vikram S. Adve
ae709134c9 Optional args are no longer allocated as they are discovered.
(This can be improved to avoid making the initial pass over the method.)
Also, ensure automatic vars and reg. spills areas are not extended
if their sizes are used for computing some other offset.

llvm-svn: 2319
2002-04-25 04:47:26 +00:00
Chris Lattner
15d1c69edd Rewrite MachineCodeForBasicBlock in terms of containment rather than
inheritance.

llvm-svn: 2200
2002-04-09 18:00:49 +00:00