Commit Graph

1627 Commits

Author SHA1 Message Date
Chris Lattner
c34921dc6a Change comments into something that TableGen can read!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 21:08:29 +00:00
Chris Lattner
244883e4af Allow instructions to have a DAG pattern associated with them.
Define a few preliminary node types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7579 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 21:07:37 +00:00
Chris Lattner
6770aedf7f Rename register classes to be upper case to make it obvious that they are X86
specific in the tree patterns


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7578 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 20:58:29 +00:00
Chris Lattner
e5bb2d94d9 There is nothing special about noops anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7568 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 05:11:37 +00:00
Chris Lattner
17d4d147dd There is nothing special about noops now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 05:11:19 +00:00
Chris Lattner
7cc7d987a4 Transition to using 'let X = y' instead of 'set X = y'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 05:03:18 +00:00
Chris Lattner
c8f4587efd transition to using let instead of set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7564 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 04:59:56 +00:00
Chris Lattner
60e81db31c Transition to using let instead of set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7563 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 04:58:12 +00:00
Chris Lattner
5e2cb8b991 Fix Bug: test/Regression/Jello/2003-08-03-CallArgLiveRanges.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7558 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 02:12:48 +00:00
Chris Lattner
72feb15563 Simplify some constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7556 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 01:04:59 +00:00
Chris Lattner
d587a84197 Remove illegal, unsupported escapes. This fixes program: Ptrdist-bc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7552 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 23:42:17 +00:00
Chris Lattner
e012132028 * Sort #includes, remove dupliates
* Use .zero to emit padding between struct elements
* Emit .comm symbols when we can, this dramatically reduces the amount of gunk we have to print
* Print global variable identifiers next to initializer more nicely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7551 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 23:37:09 +00:00
Chris Lattner
7af9a38d0f Specify custom name for registers to get the ()'s in the name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7547 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 22:12:47 +00:00
Chris Lattner
76bf868ff3 Allow specifying custom names for registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7546 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 22:12:37 +00:00
Chris Lattner
8d44ba8c5c Start using tablegen'd instruction enum list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:57:05 +00:00
Chris Lattner
113455be9d Resort tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7541 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:56:36 +00:00
Chris Lattner
4d18d5ce1e Lump the base opcode in with the X86 TargetSpecific flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7540 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:56:22 +00:00
Chris Lattner
abf05b2dae * Start using tablegen'd instruction descriptions
* Fix bug in the createNOP method, which was not marking the operands of the
  generated XCHG as useanddef.  I don't think this method is actually used,
  so it wasn't breaking anything, but it should be fixed anyway...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7539 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:55:55 +00:00
Chris Lattner
c01f39307e Start using tablegenerated instruction descriptions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7538 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:54:59 +00:00
Chris Lattner
1cca5e3a29 Add new TableGen instruction definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7537 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:54:21 +00:00
Chris Lattner
5302e28adb Remove the old .def file, it is now obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7536 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:54:06 +00:00
Chris Lattner
34a2068cb2 Rearrange fields yet again: Don't instantiate these lists ONCE PER INSTRUCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7535 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:52:28 +00:00
Chris Lattner
cb53358778 Set debug types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7532 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 21:14:38 +00:00
Chris Lattner
b77eb78afc Add Target class for X86 target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7523 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 18:19:37 +00:00
Chris Lattner
9eab316528 The RegisterInfo class is obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7522 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 18:18:48 +00:00
Chris Lattner
a5100d91ef Remove the RegisterInfo class in favor of a general Target class. Add instrinfo stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7521 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 18:18:31 +00:00
Chris Lattner
a67697867d Tell CVS to ignore all .inc files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7513 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:50:17 +00:00
Chris Lattner
832003578e Switch over to tablegen generated header files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7512 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:48:55 +00:00
Chris Lattner
7ad3e063f5 Switch over to TableGen generated register file description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7511 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:48:14 +00:00
Chris Lattner
762fb5f704 Initial checkin of X86.td file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:47:49 +00:00
Chris Lattner
b76d6fc4d5 Initial checkin of X86 Register File description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7509 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 15:47:25 +00:00
Chris Lattner
09ce077a2d Fix typeos in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7505 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 13:50:14 +00:00
Chris Lattner
b889b693e4 Make it easier to debug by exposing a temporary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7504 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-03 13:49:25 +00:00
Chris Lattner
be84e3c87e Rename fields
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7498 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:21:49 +00:00
Chris Lattner
a11136b16c Move DEBUG to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7497 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:21:34 +00:00
Chris Lattner
556d89de58 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7495 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:19:03 +00:00
Chris Lattner
02f7fa482a Remove makefile complexity by always running tablegen with its final output
directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7485 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 20:34:56 +00:00
Vikram S. Adve
72666e6c30 Add all arithmetic operators to ConstantExprToString().
Note that some generated operators (like &, | or ^) may
not be supported by the assembler -- but if they've got
this far, it's better to generate them and let the assembler decide.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7476 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 15:55:53 +00:00
Vikram S. Adve
97e02ebd86 *Both* operands of divide need sign-extension before divide (if smaller
than machine register size), not just the second operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7475 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 15:54:38 +00:00
Vikram S. Adve
248932b08a Put back the separate pass to decompose multi-dimensional references
since it is *necessary* for correct code generation.  Only optional
transformations belong in the PreOpts pass (which needs to be renamed
from PreSelection to PreOpts).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7474 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 15:53:24 +00:00
Chris Lattner
de04dd746f encode size information into each ValueType
Add new RegisterInfo class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7469 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 05:18:03 +00:00
Chris Lattner
7296fb0421 This method is long dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 03:48:42 +00:00
Chris Lattner
b08f3dfe50 Remove more obsolete comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7455 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:56:05 +00:00
Misha Brukman
f31dc9841c Changed pointer to the JIT code to its current location, under LLI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7454 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:50:35 +00:00
Chris Lattner
f6b7ff92d6 Unbreak the CBE output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7453 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:47:24 +00:00
Brian Gaeke
002a50ac64 I think local symbols in X86 GAS have to start with .L, not just
.; so I have changed the basic block markers to start with .L.  I also
broke up a >80char line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7452 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 17:38:52 +00:00
John Criswell
506dad0664 Modified the code so that it generates (0) for setjmp() and abort() for
longjmp() (and does not include setjmp.h).
This is to fix some problems on Sparc while non-local jumps are still
unimplemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7449 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 15:11:08 +00:00
Chris Lattner
0ad1361837 Add comments
Make the register classes optionally take code fragments for allocation_order_*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7441 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 22:16:41 +00:00
Chris Lattner
942e7230e5 We no longer need to preprocess SparcV9.td before sending it through tablegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7437 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 21:00:37 +00:00
Vikram S. Adve
db68577691 When emitting a constant, check for ConstantExpr before
ordinary (primitive) types since ConstantExprs may be of primitive type!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7418 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 12:54:47 +00:00
Chris Lattner
7a3dd8651f Conform to the new interface for describing target registers... even though
it's currently not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7416 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:51:34 +00:00
Chris Lattner
7c28952e7a Add all of the necessary classes to describe the contents of the MRegister.h implementation
for a target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7415 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:50:12 +00:00
Chris Lattner
b4d3f46ba2 Only regenerate the .inc file if IT has changed, not just if the .td files
have changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7414 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:49:17 +00:00
Chris Lattner
7db1fa9802 Use target specific interface instead of forcing it to be target-generic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7413 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 05:33:48 +00:00
Chris Lattner
ee6b5f69bd No this file is not actually Sparc.td :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7405 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 23:07:13 +00:00
Chris Lattner
dbc1ab88ae Do not use 'cpp' directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7404 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 23:04:41 +00:00
Chris Lattner
84c40c1dce Add namespace specifier, add flags used by the X86 BE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7403 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 23:02:49 +00:00
Misha Brukman
92aa8ca9c5 * Cleaned up and corrected comments wrt instruction formats
* Enabled STXFSR instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7400 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 21:21:20 +00:00
Misha Brukman
a21b8e8213 Make emitFarCall() public, and add a few comments to functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7399 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 20:52:56 +00:00
Vikram S. Adve
e6124d3b7c Unify all constant evaluations that depend on register size
in ConvertConstantToIntType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7395 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:59:23 +00:00
Vikram S. Adve
deb9634f0e Rename 'dump-asm' to 'dump-input' and really print it just before code-gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7394 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:58:00 +00:00
Vikram S. Adve
00477cf26d Bug fix: don't unnecessarily pretty-print control-characters, some of
which were wrong (particularly, '\a' for '\007').


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7393 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:57:34 +00:00
Vikram S. Adve
ada280faa9 Add ConvertConstantToIntType() to unify all constant handling
that depends on machine register size.
Moved insertCallerSavingCode() to PhyRegAlloc and
moved isRegVolatile and modifiedByCall to TargetRegInfo: they are all
machine independent.  Remove several dead functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7392 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:54:41 +00:00
Vikram S. Adve
83d30c89e5 Add code to support stack spill/temp offsets that don't fit in the
immed. field.  Moved insertCallerSavingCode() to PhyRegAlloc: it is
now machine independent.  Remove all uses of PhyRegAlloc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7391 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:53:21 +00:00
Vikram S. Adve
b5161b60c2 All constant-evaluation code now unified into
TargetInstrInfo::ConvertConstantToIntType().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:50:12 +00:00
Vikram S. Adve
814030a0c5 1. Bug fix: Don't use branch operand reg. as temp. reg. when
spilling values used by an instruction in the delay slot of the branch
   (which will eventually be moved before the branch).
2. Bug fix:  Delete the delay slot instr, not the branch instr, when
   moving delay slot instr. out!!!!
3. Move code to insert caller-saves moved here from SparcRegInfo:
   it is now machine-independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7389 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:49:21 +00:00
Vikram S. Adve
7a81a0fd13 Don't require a BB to look-up live variables, unless they may need to
be recomputed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:42:32 +00:00
Vikram S. Adve
b403b2c019 Add const version of getLiveRangeForValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7386 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:38:22 +00:00
Vikram S. Adve
102f295114 Code to insert caller-saves moved here from SparcRegInfo: it is now
machine-independent.
Fix problem with using branch operand reg. as temp. reg. when
spilling values used by an instruction in the delay slot of the branch
(which will eventually be moved before the branch).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:37:41 +00:00
Misha Brukman
a1f1fea105 * Correctly emit a far call if the target address does not fit into 30 bits
instead of assert()ing
* Fixed a nasty bug where '07' was used instead of register 'o7'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7382 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 19:00:58 +00:00
Chris Lattner
c8c377d111 Move "register flags" definition the type of registers to be fully fledged
value types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7377 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 05:14:16 +00:00
Chris Lattner
38b8979da1 Specify the value type for the register, not just the size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 04:25:36 +00:00
Chris Lattner
b3aa319401 Instead of specifying the SIZE of the register, go so far as to specify
what value type it is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7356 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 04:24:59 +00:00
Chris Lattner
d281de2181 Rename function to be more consistent with filename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7352 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:49:58 +00:00
Chris Lattner
8d3f8e226d Making this code const-correct would be a pain, so I'll hack it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7350 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:29:51 +00:00
Chris Lattner
9cdaa63f57 Be const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:23:41 +00:00
Chris Lattner
e5a61ccdc5 Hrm, another necesary one :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7347 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:22:19 +00:00
Chris Lattner
dee1263c7c We don't modify the LLVM rep, remain const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7345 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:06:00 +00:00
Chris Lattner
2a865b015b If the pass changes _anything_ it must return true
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7344 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:05:37 +00:00
Chris Lattner
6856d11231 This code doesn't modify the LLVM structure, keep stuff const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7343 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:04:00 +00:00
Chris Lattner
1d598fa25a Remove #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7342 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:01:04 +00:00
Chris Lattner
bae47e5691 Remove extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:00:29 +00:00
Vikram S. Adve
7dc7de5391 (1) Major fix to the way unused regs. are marked and found for the FP
Single and FP double reg types (which share the same reg class).
    Now all methods marking/finding unused regs consider the regType
    within the reg class, and SparcFloatRegClass specializes this code.
(2) Remove machine-specific regalloc. methods that are no longer needed.
    In particular, arguments and return value from a call do not need
    machine-specific code for allocation.
(3) Rename TargetRegInfo::getRegType variants to avoid unintentional
    overloading when an include file is omitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7334 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:12:15 +00:00
Vikram S. Adve
e9a567cc77 1. Fix a case that was marking the invalid reg. num. (-1) as used,
causing a nasty array bound error later.
2. Fix silly typo causing logical shift of unsigned long to use
   SRL instead of SRLX.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7330 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:08:58 +00:00
Vikram S. Adve
bc001b24a1 (1) Change the way unused regs. are marked and found to consider regType
info (since multiple reg types may share the same reg class).
(2) Remove machine-specific regalloc. methods that are no longer needed.
    In particular, arguments and return value from a call do not need
    machine-specific code for allocation.
(3) Rename TargetRegInfo::getRegType variants to avoid unintentional
    overloading when an include file is omitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7329 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:06:09 +00:00
Vikram S. Adve
34a856749f Remove unused field. Change the way unused regs. are marked and
found to consider regType info (since multiple reg types may share
the same reg class, e.g., single and double on Sparc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7327 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:00:13 +00:00
Brian Gaeke
49a178b9fd Don't include llvm/SlotCalculator.h, or <set>.
Move up the inclusion of llvm/Support/Mangler.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:21:06 +00:00
Brian Gaeke
d9fb37ac98 Use unified CWriter-X86/Printer name mangler. Do not bother using
SlotCalculator in CWriter.  (Unfortunately, all this means a lot of
X86/Printer's methods have to be de-constified again.  Oh well.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 20:20:44 +00:00
Brian Gaeke
3d8d9f7e72 It doesn't appear that we need to #include these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:48:53 +00:00
Brian Gaeke
b3011a01b5 Constify most methods. We could have constified doInitialization and
doFinalization too except that would have made them shadow, not override,
the parent class :-P.

Allow *any* constant cast expression between pointers and longs,
or vice-versa, or any widening (not just same-size) conversion that
isLosslesslyConvertibleTo approves. This fixes oopack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:30:45 +00:00
Chris Lattner
d4e8d31e40 Fix program: SingleSource/UnitTests/2003-07-09-SignedArgs with the CBE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7276 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 20:45:31 +00:00
Brian Gaeke
de420aee32 Printer.cpp: Ditch addRequired/getAnalysis, because they leave
Printer::doFinalization() out in the cold.  Now we pass in a TargetMachine
  to Printer's constructor and get the TargetData from the TargetMachine.
 Don't pass TargetMachine or MRegisterInfo objects around in the Printer.
 Constify TargetData references.
X86.h: Update comment and prototype of createX86CodePrinterPass().
X86TargetMachine.cpp: Update callers of createX86CodePrinterPass().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7275 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 20:25:08 +00:00
Brian Gaeke
92bdfe6951 Add, rewrite, and/or reformat many comments.
Stop passing ostreams around: we already have one perfectly good ostream
and we can all share it.

Stop stashing a pointer to TargetData in the Pass object, because that will
lead to a crash if there are no functions in the module (ouch!)  Instead,
use addRequired() and getAnalysis(), like we always should have done.

Move the check for ConstantExpr up before the check for isPrimitiveType,
because we need to be able to catch e.g. ubyte (cast bool false to ubyte),
whose type is primitive but which is nevertheless a ConstantExpr, by calling
our specialized handler instead of the AsmWriter. This would result in
assembler errors when we would try to output something like ".byte (cast
bool false to ubyte)".

GC some unused variable declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7265 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 18:37:06 +00:00
Chris Lattner
949a362802 Remove redundant const qualifiers from cast<> expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:06 +00:00
Chris Lattner
c07736a397 Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:22:26 +00:00
Chris Lattner
c8bf87af3e Remove unnecessary casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7250 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:17:51 +00:00
Chris Lattner
9daa8a12d3 Random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7247 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 14:59:40 +00:00
Chris Lattner
1815383276 Remove using decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7246 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 14:55:59 +00:00
Chris Lattner
43234493de Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7217 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-21 19:56:49 +00:00
Misha Brukman
8f9f9a2901 Eliminated dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7209 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-21 16:34:35 +00:00
Anand Shukla
6da69e75ec Added special consideration for instrumentation strategy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7208 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-20 15:39:30 +00:00
Brian Gaeke
d461505efd Please, save your applause^H^H^H^H^H^H^H^Hflames for the end...
Avoid a fall-through in the (stubby) treatment of the longjmp intrinsic
call which causes llc & lli to core-dump.

Add a sort-of treatment of cast double to ulong. I am not really sure
what a user should expect to see upon casting a negative FP value to
unsigned long long. But with what is given here, I was able to write
a program that could cast -123.456 to ulong and back and get -123.0,
which seems like a step in the right direction.  GCC seems to give you
0. I don't know if I'd consider that useful.

These cases were coming up in GNU coreutils-5.0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7205 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-18 20:23:43 +00:00
Brian Gaeke
bfedb912cd Use getClassB for load and store; we don't want to abort when we
try to load or store through a bool*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7195 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-17 21:30:06 +00:00
Misha Brukman
dfbfc57d78 Fixed the number translation scheme for the integer condition code registers: it
now works in instructions which require a 2-bit or 3-bit INTcc code.

Incidentally, that means that the representation of INTcc registers is now the
same in both integer and FP instructions. Thus, code became much simpler and
cleaner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7185 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 20:30:40 +00:00
Misha Brukman
cf7ec875ba The name should really be `simm11' to follow the naming convention, but this has
no change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7184 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 20:27:44 +00:00
Misha Brukman
2c4fe5813c No need for a second immediate field if the class already inherits one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7182 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 21:27:14 +00:00
Misha Brukman
a34b619f67 Encode predict = 1 by default, because the Sparc assembler does this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7181 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 21:26:49 +00:00
Misha Brukman
07d4516f92 Correctly handle calls to functions which are further away than 2**32 bits will
allow, i.e. make a sequence of instructions to enable an indirect call using
jump-and-link and 2 temporary registers (which we save and ultimately restore).

Warning: if the delay slot of a function call is used to do meaningful work and
not just a NOP, this behavior is incorrect. However, the Sparc backend does not
yet utilize the delay slots effectively, so it is not necessary to make an
overly complicated algorithm for something that's not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7178 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 19:09:43 +00:00
Misha Brukman
173e250548 * Added support for the %ccr register
* FP double registers are now coded correctly
* Removed function which converted registers based on register types, it was
  broken (because regTypes are broken)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7175 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 23:26:03 +00:00
Misha Brukman
bc0e998c49 The word separate' only has one e'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7173 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 17:20:40 +00:00
Brian Gaeke
0517c5ac92 If we have a constant pointer reference to a function, we were printing
out the entire llvm disassembly for the function at global constant-output
time, which caused the assembler to barf in 164.gzip. This fixes that
particular problem (though 164.gzip has other problems with X86 llc.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7168 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-11 21:57:01 +00:00
Brian Gaeke
1aa476edf0 Fix some serious floating-point bugs (fixes test cases such as Oscar,
Fhourstones, McCat-vor, and many others...)

Printer.cpp: Print implicit uses for AddRegFrm instructions.  Break gas
bug workarounds up into separate stanzas of code for each bug.  Add new
workarounds for fild and fistp.

X86InstrInfo.def: Add O_ST0 implicit uses for more FP instrs where they
obviously apply. Also add PrintImplUses flags for FP instrs where they
are necessary for gas to understand the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7165 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-11 18:18:35 +00:00
Vikram S. Adve
951df2b1bd Several important bug fixes:
(1) Cannot use ANDN(ot), ORN, and XORN for boolean ops, only bitwise ops.

(2) Conditional move instructions must distinguish signed and unsigned
    condition codes, e.g., MOVLE vs. MOVLEU.

(3) Conditional-move-on-register was using the cond-move-on-cc opcodes,
    which produces a valid-looking instruction with bogus registers!

(4) Here's a really cute one: dividing-by-2^k for negative numbers needs to
    add 2^k-1 before shifting, not add 1 after shifting.  Sadly, these
    are the same when k=0 so our poor test case worked fine.

(5) Casting between signed and unsigned values was not correct:
    completely reimplemented.

(6) Zero-extension on unsigned values was bogus: I was only doing the
    SRL and not the SLLX before it.  Don't know WHAT I was thinking!

(7) And the most important class of changes: Sign-extensions on signed values.
    Signed values are not sign-extended after ordinary operations,
    so they must be sign-extended before the following cases:
	-- passing to an external or unknown function
	-- returning from a function
	-- using as operand 2 of DIV or REM
	-- using as either operand of condition-code setting operation
           (currently only SUBCC), with smaller than 32-bit operands


Also, a couple of improvements:

(1) Fold cast-to-bool into Not(bool).  Need to do this for And, Or, XOR also.

(2) Convert SetCC-Const into a conditional-move-on-register (case 41)
    if the constant is 0.  This was only being done for branch-on-SetCC-Const
    when the branch is folded with the SetCC-Const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7159 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 20:07:54 +00:00
Vikram S. Adve
940a3a47b0 Bug fix in creating constants: need 1U << 31, not 1 << 31.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7158 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:48:19 +00:00
Vikram S. Adve
ad80db6d7d Fold cast-to-bool into not. Later, this should also be folded into other
boolean operations: AND, OR, XOR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7157 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:47:42 +00:00
Vikram S. Adve
4d2faf6307 Values stored in CallArgsDescriptor cannot be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7156 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:46:15 +00:00
Vikram S. Adve
24d0410db0 isMarkedForSpill() should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7155 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:45:28 +00:00
Vikram S. Adve
51bda6fccb Print out all neighbors in interference graph, not just higher-numbered ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:43:33 +00:00
Vikram S. Adve
3bf089227b Several fixes to handling of int CC register:
(1) An int CC live range must be spilled if there are any interferences,
    even if no other "neighbour" in the interf. graph has been allocated
    that reg. yet.  This is actually true of any class with only one reg!

(2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must
    be spilled so that the machine-independent spill code doesn't have to
    make the machine-dependent decision of which CC name to use based on
    operand type: %xcc or %icc.  (These are two halves of the same
register.)

(3) LR->isMarkedForSpill() is no longer the same as LR->hasColor().
    These should never have been the same, and this is necessary now for #2.

(4) All RDCCR and WRCCR instructions are directly generated with the
    phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to
    deal with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7152 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:42:55 +00:00
Vikram S. Adve
b15f8d446a Several fixes to handling of int CC register:
(1) An int CC live range must be spilled if there are any interferences,
    even if no other "neighbour" in the interf. graph has been allocated
    that reg. yet.  This is actually true of any class with only one reg!

(2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must
    be spilled so that the machine-independent spill code doesn't have to
    make the machine-dependent decision of which CC name to use based on
    operand type: %xcc or %icc.  (These are two halves of the same register.)

(3) LR->isMarkedForSpill() is no longer the same as LR->hasColor().
    These should never have been the same, and this is necessary now for #2.

(4) All RDCCR and WRCCR instructions are directly generated with the
    phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to
    deal with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7151 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 19:42:11 +00:00
Misha Brukman
ac25de3bf0 Some beautification changes (tabs to spaces, removed extra blank lines);
no functionality changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7138 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-09 17:33:50 +00:00
John Criswell
cf6d7b0353 Removed size_t from the parameter list of the malloc() prototype in generated C
code.  This prevents a compiler warning on Sparc that causes the tests to fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7125 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-08 14:52:09 +00:00
Misha Brukman
2988612f1b Elaborated assembly syntax of instructions in the comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7120 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:18:42 +00:00
Misha Brukman
35f19cc7b2 Removed unnecessary assignment (it was taken care by a superclass) and clarified
some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7119 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:18:06 +00:00
Brian Gaeke
b44210d768 Insert workaround for GAS bug in assembling FLD/FSTP XWORD PTR [...]
instructions, by outputting them as bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7115 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 18:34:20 +00:00
Misha Brukman
de11f2d038 Moved RegClassIDs enum to be next to the RegTypes enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7114 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 16:52:39 +00:00
Vikram S. Adve
9c570ee129 Correction to last fix: Pointer types do not return true in Type::IsIntegral().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7113 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 22:50:31 +00:00
Vikram S. Adve
97539fc4b6 Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7112 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:33:21 +00:00
Vikram S. Adve
786833ad34 Major bug fix though it happened rarely (only on a compare after an
integer overflow):
We need to use %icc and not %xcc for comparisons on 32-bit or smaller
integer values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7111 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:13:59 +00:00
Vikram S. Adve
46d3f8e34c Make the RegClassID values public -- there is no other way to get them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 19:53:59 +00:00
Misha Brukman
9cedd433eb Apparently, the "regType" and "regClass" used in the Sparc backend are not both
correct: empirically, "regType" is wrong for a number of registers. Thus, one
can only rely on the "regClass" to figure out what kind of register one is
dealing with.

This change switches to using only "regClass" and adds a few extra DEBUG() print
statements and a few clean-ups in comments and code, mostly minor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7103 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 18:36:47 +00:00
Misha Brukman
ce14ec3901 * Force all "don't care" bits to 0 so that there are absolutely no unset bits in
the TableGen descriptions; all unset bits are thus errors.
* As a result, found and fixed instructions where some operands were not
  actually assigned into the right portion of the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7074 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 19:37:48 +00:00
Misha Brukman
bd272999dd The classes F4_3 and F4_4 have an `rd' operand that needs to be set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7073 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:27:47 +00:00
Misha Brukman
a8fcdd8d04 Properly fix instruction syntax in comments, using `imm' for instructions that
use an immediate value instead of a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7072 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:15:43 +00:00
Misha Brukman
69bf93081f Fixed instruction syntax in the comments (specifies how instr is used).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:02:58 +00:00
Vikram S. Adve
ea28dd3392 Force fixed-size but large alloca objects to the dynamically allocated
area to avoid using up precious stack space within the 4095 offset limit
from %fp.  Such objects that would themselves live at a large offset
were being put there already so this is a simple change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 06:59:22 +00:00
Vikram S. Adve
65b2f401af Minor beautification: fold a couple of lines of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7054 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:24:00 +00:00
Vikram S. Adve
799ffeede1 (1) Major bug fix: DecomposeArrayRef() replaces its argument instr. and
deletes it, but we were merrily trying to fix the operands of that
    instruction anyway!  Instead, fix the replacement instruction.

(2) An Improvement: Check for and extract global values in all operands,
    not just in known pointer operands.  For example, they can occur in
    call arguments, and probably other unforeseeable places as well.
    This also eliminates the special-case handling of Load and Store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7053 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:23:15 +00:00
Vikram S. Adve
74d15d36f5 A def. operand of a machine instruction may be an ordinary Value*,
not just an Instruction*, at least in one unfortunate case:
the first operand to the va_arg instruction.
Modify ValueToDefVecMap to map from Value*, not Instruction*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:16:01 +00:00
Vikram S. Adve
784a18b8ba Bug/case fixes:
(1) select: Ok to convert a pointer to a float or double.
(2) regalloc: Some MachineInstr* for caller-saving code before a call
    were being inserted before and after the call!
(3) Don't insert the caller-saving instructions in the
    MachineCodeForInstruction for the Call instruction.
    *All* instructions generated by register allocation need to be
    recorded in those maps, but it needs to be done uniformly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:13:57 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Chris Lattner
eb093fbf6f Setjmp should always return zero if we don't implement longjmp. This avoids
leaving trash in the register, fixing anagram


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7013 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 19:35:54 +00:00
Chris Lattner
c151e4f415 Until there is a setjmp/longjmp transformation pass, codegen setjmp as a noop
and longjmp as an abort!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6977 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 16:42:32 +00:00
Chris Lattner
2fa42a816d jmp_buf is really a pointer type that is passed around...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6935 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 19:29:34 +00:00
Chris Lattner
9bda5f52bd Add support for the Invoke instruction!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6934 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 17:53:05 +00:00
Chris Lattner
4148819f0f Preserve compatibility with non-gcc compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6932 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 17:15:12 +00:00
Chris Lattner
76d9f1b467 Fix bug: CBackend/2003-06-28-LinkOnceGlobalVars.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6931 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 17:08:36 +00:00
Brian Gaeke
d7908f679e Nice tasty llc fixes. These should fix LLC for x86 for everything in
SingleSource except oopack and Oscar.  (Sorry, Oscar.)

include/llvm/Target/TargetInstrInfo.h: Remove virtual print method. Add
 accessors for ImplicitUses/Defs.
lib/Target/TargetInstrInfo.cpp: Remove virtual print method. If you
 really wanted this, just use MI->print(O, TM); instead...
lib/Target/X86:
FloatingPoint.cpp: ...like this.
X86InstrInfo.h: Remove virtual print method. Define the PrintImplUses
 target-specific flag bit.
X86InstrInfo.def: Add the PrintImplUses flag to all the instructions
 which implicitly use CL, because the assembler needs to see the CL in
 order to generate the right instruction.
Printer.cpp: Ditch fnIndex at Chris's request. Now we use CurrentFnName
  to name constants in the constant pool for each function instead. This
  avoids keeping state between runOnMachineFunction() invocations, which
  is a no-no. Having MangledGlobals be global is a bogon I'd like to get
  rid of too, but making it a static member of Printer causes link errors
  (why???).
 Make NumberForBB into a member of Printer instead of a global, too.
 Make printOp and printMemReference into methods of Printer.
 X86InstrInfo::print is now Printer::printMachineInstruction, because
  TargetInstrInfo::print is history. (Because of this, we have to qualify
  the names of some TargetInstrInfo methods we call.)
 Print out the ImplicitUses field of any instruction we print that has
  the PrintImplUses bit set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6924 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-27 00:00:48 +00:00
Brian Gaeke
5e00157c5a Number constants from constant pool as CPIf_i where f is the function index
and i is the constant pool index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6920 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 18:02:30 +00:00
Brian Gaeke
bc601fe3e7 Integrate the C writer's name mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6908 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 22:00:39 +00:00
Brian Gaeke
01d79ff86d First draft of X86 LLC backend. This should be OK for small programs like
Shootout, but it has some issues with bigger programs. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6907 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 18:01:07 +00:00
Joel Stanley
54f6032dae - Fixed name mangling conditions to handle 'linkonce' linkage type. In
particular, name mangling for GlobalValues only occurs when the linkage type is
internal or when the name must be mangled to avoid a collision.  See comments in
CWriter::getValueName for more information.

- 'inline' keyword is now emitted for functions with 'linkonce' linkage type.

- Fixed typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6898 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 04:52:09 +00:00
Brian Gaeke
e99f4cf4ac It seems likely that floats would need a cast too, because they are
ordinarily promoted to doubles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6894 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 03:05:33 +00:00
Brian Gaeke
031a112747 Fix 2003-06-23-PromotedExprs.llx -- if we are adding two bytes we better
explicitly cast the result to be a byte, or C will gleefully promote it
to int.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6869 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 20:00:51 +00:00
Vikram S. Adve
80544444a3 Add the padding needed for variable-size alloca's, which should work now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6859 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 02:13:57 +00:00
Chris Lattner
7b52c036f4 Do not use the inefficient, fixed function, CBW, CDQ, ... instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6844 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:31:18 +00:00
Chris Lattner
3889a2cb05 Remove a ton of extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:08:05 +00:00
Chris Lattner
034acf0a3d Minor simplification to 64-bit instsel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6831 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 18:15:27 +00:00
Chris Lattner
0f1c461423 For 16 and 32-bit multiplies, use the IMUL instruction instead of the MUL instruction.
This allows us to not force the use of the EAX/AX registers!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6830 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 17:16:58 +00:00
Chris Lattner
a8cb100706 Add IMULr16 & IMULr32 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6829 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 17:13:35 +00:00
Chris Lattner
f58544712b Generate code for LONG indexes to getelementptr instructions more efficiently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 16:01:24 +00:00
Chris Lattner
c901e8bd9e Some preprocessors doen't support // comments and get confused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6821 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 23:14:50 +00:00
Vikram S. Adve
ddafa49edc RDCCR defines arg. #1, not arg. #2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6796 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 11:32:11 +00:00
Brian Gaeke
3387e7f7a2 Fix output bug: Intel asm comment character is #, not ;.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6792 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:58:32 +00:00
Brian Gaeke
088fa1162d RECAPITALIZE all the names of pseudo-instructions, and add a comment explaining
the convention.

:-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6791 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:41:13 +00:00
Brian Gaeke
96b07e54dd Rename many instructions to their Intel asm-compatible names. This
involves removing the [bwl] suffixes from instruction names, as well
as some other distinguishing marks (32/64/80 on fp insns, _i suffixes, etc.)

Lowercase all instr. names as well for consistency's sake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6790 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:34:44 +00:00
Brian Gaeke
9e474c4ec8 Add Initialization and Finalization methods for the Printer pass,
to print various things on a module-by-module basis (currently, only the
former is used).

Don't print < > around names. The assembler can't take it.

Print pseudoinstructions only as comments. The poor little assembler can't
take that, either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6789 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:32:32 +00:00
Brian Gaeke
de3aa4f77f lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version
(non-working) of llc guts for X86, and add a prototype for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6779 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 21:43:21 +00:00
Brian Gaeke
2e2f2dcd6a lib/Target/Sparc/Sparc.cpp:
Move LowerAllocations, PrintFunction, and SymbolStripping passes, and
  the corresponding -disable-strip and -d options, over here to the SPARC
  target-specific bits of llc. Rename -d to -dump-asm.

tools/llc/Makefile:
 Reindent. Add x86 library so that llc compiles again.

tools/llc/llc.cpp:
 Remove support for running arbitrary optimization passes. Use opt instead.
 Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted
  above.
 Allow user to select a backend (x86 or SPARC); default to guessing from
  the endianness/pointer size of the input bytecode file.
 Fix typos.
 Delete empty .s file and exit with error status if target does not support
  static compilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6776 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 21:14:23 +00:00
Chris Lattner
c8621e6f28 These instructions really take three operands. This fixes some assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6765 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 15:09:02 +00:00
Brian Gaeke
b471a23a85 lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here
into a new function FPCSafeToPrint(), and use it in printConstant()
and printFunction() to decide whether we should output ConstantFPs as
floating-point constants or as references to stack-allocated variables.

lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6762 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:55:35 +00:00
Chris Lattner
a8ab89e3da Fairly major change: emit fixed sized allocas in the entry block as a variable,
instead of a variable pointer and an alloca.  All accesses to the variable then
use the address-of operator to access it.  This plays better with the internal
GCC code generation phases, which bail early on functions which contain allocas.
It also makes the code a bit easier to read.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6734 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 04:39:14 +00:00
Brian Gaeke
a0145ccb20 Don't include alloca.h on FreeBSD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6728 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 23:57:13 +00:00
Chris Lattner
2eb9a257c8 Actually, change it to use explicit new/delete, which is more likely to be
optimized INTO an alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6727 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 22:29:09 +00:00
Chris Lattner
0bf9476701 Remove two using decls
Remove usage of alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6725 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 22:18:28 +00:00
Brian Gaeke
ad95d9ef50 Isolate machine-dependent use of <alloca.h> in "Support/Alloca.h",
so that we can easily change its use to be conditional on the result of
an autoconf test later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6723 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 21:54:01 +00:00
Chris Lattner
ff97fbc527 Rename FInfo.cpp to FunctionInfo.cpp, eliminate FInfo.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6712 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 15:31:52 +00:00
Chris Lattner
fb4d20bad8 move contents of include/llvm/Reoptimizer/Mapping/FInfo.h into here, it is sparc internal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6711 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 15:31:09 +00:00
Chris Lattner
da92090f0e Fix typeo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6704 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:21:19 +00:00
Chris Lattner
02da6c0f08 Fix bug: CBackend/2003-06-11-HexConstant.ll
Fix bug: CBackend/2003-06-11-LiteralStringProblem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6697 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:09:09 +00:00
Chris Lattner
84c9d5c3c0 Fix invalid number of arguments problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6692 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:03:00 +00:00
John Criswell
be583b914d Included assert.h so that the code compiles under newer versions of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 14:01:36 +00:00
John Criswell
9aa2639370 Updated for the new projects Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6678 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 13:49:11 +00:00
Guochun Shi
0e93687cca add some comments
add a function ModuloScheduling::dumpFinalSchedule() to print out final schedule


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6677 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:04:30 +00:00
Guochun Shi
e95b827db2 add an brief instruction what this pass is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6676 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:03:39 +00:00
Guochun Shi
0b970dad72 a simple introduction to this pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6675 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 20:02:16 +00:00
Guochun Shi
f325261856 cleaned code
add some comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-10 19:09:00 +00:00
Guochun Shi
8f1d4ab409 delete useless functions
add comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 23:16:07 +00:00
Guochun Shi
33280524f4 change DEBUG to DEBUG_PRINT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6672 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 20:40:47 +00:00
Misha Brukman
6fe6905df2 Do not hastily change the Opcode from 'r' to 'i' type if we're not actually
SETTING the operand to be an immediate or have verified that one of the operands
is really a SignExtended or Unextended immediate value already, which warrants
an 'i' opcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-07 02:34:43 +00:00
Chris Lattner
30d002bd66 Fix warnings on Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6658 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 18:25:33 +00:00
Misha Brukman
8631ac4b76 Print address out as hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6657 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 09:53:28 +00:00
Misha Brukman
f75bab7756 Added 'r' and 'i' versions to WRCCR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6656 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 09:52:58 +00:00
Misha Brukman
d36e30e623 * Changed Bcc instructions to behave like BPcc instructions
* BPA and BPN do not take a %cc register as a parameter
* SLL/SRL/SRA{r,i}5 are there for a reason - they are ONLY 32-bit instructions
* Likewise, SLL/SRL/SRAX{r,i}6 are only 64-bit
* Added WRCCR{r,i} opcodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6655 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 09:52:23 +00:00
Misha Brukman
a51245036e * Removed PreSelection pass because that is now done in the JIT
* Removed instruction scheduling as it is too slow to run in a JIT environment
* Removed other passes because they aren't necessary and can slow JIT down


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6652 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 07:11:16 +00:00
Chris Lattner
940b08dd1e Don't output explicit initializers for globals that are zero initialized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6651 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 07:10:24 +00:00
Misha Brukman
de07be3b78 Fixed a bunch of test cases in test/Regression/Jello which could not get the
address of a floating-point (allocated via ConstantPool) correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6647 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 04:41:22 +00:00
Chris Lattner
302de59001 Add statistic for # machine instrs emitted
Add GROSS HACK to get CompilationCallback to work when compiled in release mode


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6646 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 04:00:05 +00:00
Misha Brukman
3339459e48 * If a global is not a function, just ask the MachineCodeEmitter for the addr
* Do not block a print statement with a DEBUG() guard if we're going to abort()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6645 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 03:35:37 +00:00
Misha Brukman
82c9e55913 The SUB*i instructions belong to a different class than their SUB*r brethren.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6644 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 03:34:47 +00:00