Commit Graph

914 Commits

Author SHA1 Message Date
Chris Lattner
7893f13ad6 Emit an error instead of an assertion if trying to do bogus things in result patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25194 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 01:33:49 +00:00
Robert Bocchino
b52ee7f5ff Added support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25181 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 19:05:34 +00:00
Evan Cheng
51fecc80f7 * Remove instruction fields hasInFlag / hasOutFlag and added SNDPInFlag and
SNDPOutFlag to DAG nodes. These properties do not belong to target specific
instructions.
* Added DAG node property SNDPOptInFlag. It's same as SNDPInFlag except it's
optional. Used by ret / call, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25154 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-09 18:27:06 +00:00
Evan Cheng
4a7c284b35 Pattern complexity calculation fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25133 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-06 22:19:44 +00:00
Evan Cheng
e1050d616b Tweak pattern complexity calc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25122 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-06 02:30:23 +00:00
Evan Cheng
1cf6db2d3b Bug fix wrt chain operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25115 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-06 00:41:12 +00:00
Jeff Cohen
60e9187a90 Replace fix with one less disruptive to the original code.
Also note that GCC 4.1 also correctly flags the syntax error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25076 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 03:23:30 +00:00
Jeff Cohen
f356d70ec3 Tblgen was generating syntactically illegal C++ code like:
SDOperand Tmp0,Tmp1,Tmp2,Tmp3,;

GCC has a bug (24907) in which is fails to catch this, but VC++ correctly
notes its illegality, so tblgen must be taught to only generate legal C++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25075 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 03:15:19 +00:00
Chris Lattner
11966a0179 Remove obsolete comment, make things look a bit nicer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25070 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 00:32:01 +00:00
Chris Lattner
602f692461 reduce stack usage of the recursive SelectCode function by out-lining each
case of the switch statement into its own method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25069 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 00:25:00 +00:00
Chris Lattner
4e3c8e516f Remove my previous ugly hack that tries to reduce the stack space usage
of SelectCode to make way for a better solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25068 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-03 22:55:16 +00:00
Duraid Madina
d47ae09dab HP-UX DVDs are crunchy and good to eat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25052 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-30 16:41:48 +00:00
Duraid Madina
42d24c71df almost got the HP-UX tester up.. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25051 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-30 14:56:37 +00:00
Nate Begeman
b73628b5ab Add support for generating v4i32 altivec code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25046 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-30 00:12:56 +00:00
Duraid Madina
12f7578214 This gets most of the backends building with HP HappyC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25029 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-27 10:56:22 +00:00
Evan Cheng
2b4ea795a2 Added field noResults to Instruction.
Currently tblgen cannot tell which operands in the operand list are results so
it assumes the first one is a result. This is bad. Ideally we would fix this
by separating results from inputs, e.g. (res R32:$dst),
(ops R32:$src1, R32:$src2). But that's a more distruptive change. Adding
'let noResults = 1' is the workaround to tell tblgen that the instruction does
not produces a result. It works for now since tblgen does not support
instructions which produce multiple results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25017 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 09:11:45 +00:00
Duraid Madina
6fb9a84e79 more standards-compliance stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25014 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 05:08:55 +00:00
Andrew Lenharth
330851a8f6 support targetexternalsym
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25005 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-24 23:36:59 +00:00
Evan Cheng
7b05bd5814 * Support for hasInFlag and hasOutFlag (on instructions). Remove nameless FLAG
support which is fragile.
* Fixed a number of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24996 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-23 22:11:47 +00:00
Chris Lattner
7a8054f5f2 silence some bogus gcc warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24962 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 20:37:36 +00:00
Evan Cheng
3a217f3e53 Attempt to fix a crash on WIN32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24936 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 02:35:21 +00:00
Evan Cheng
9793888be8 * Added support for FLAG - a special nameless flag register. Can be used as
either an operand or a result.
* Fixed some more flag / chain bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24933 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 02:24:50 +00:00
Evan Cheng
87bddeb2af Allows instructions which no explicit operands. e.g. X86 RET which has but
an implicit flag operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24916 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 20:20:49 +00:00
Chris Lattner
4e6a1d2433 Eliminate some GCC warnings from the generated code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24897 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 05:31:05 +00:00
Evan Cheng
5fb5e10cdc Fix the semantic of Requires<[cond]> to mean if (!cond) goto PXXFail;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24883 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 20:08:01 +00:00
Chris Lattner
2f0f9a6973 This ugly patch works around a GCC bug where it is compiling SelectCode to
use too much stack space, overflowing the stack for large functions.  Instead
of emitting new SDOperands in each match block, we emit some common ones at
the top of SelectCode then reuse them when possible.

This reduces the stack size of SelectCode from 28K to 21K.  Note that GCC
compiles it to 512 bytes :-/

I've filed GCC PR 25505 to track this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24882 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 19:41:03 +00:00
Evan Cheng
4fba28116c Now support instructions with implicit write to non-flag registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24878 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 07:37:41 +00:00
Patrick Meredith
dae87b6536 Added a break that I meant to include originally, for efficiency. Basically
it keeps it from trying to add the same node to the node set
over and over if it matches multiple given patterns.  Also in cases where there
are a lot of patterns to be matched, and it matches an early one, this
will make the script run slightly faster.  It's more there because it logically
should be, than anything else, I mean, Python is never going to be fast ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24876 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 02:03:23 +00:00
Evan Cheng
e08705134f Lefted out a fix in the previous check in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24873 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-20 00:06:17 +00:00
Evan Cheng
f9fc25db32 Fix another bug related to chain / flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24868 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 22:40:04 +00:00
Evan Cheng
1b80f4d2c6 Fixes for a number of bugs: save flag results in CodeGenMap, folded chains
may not all have ResNo == 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24858 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 07:18:51 +00:00
Patrick Meredith
7e1cf1c8f4 This is a script to extract nodes and edges associated with those nodes
from a dot file that is the output of DSA.  Nodes to extract
are specified by giving the name of the node seen in the graphical
representation, i.e. in the .ps if the node is specified %xyz
asking for just x, xy, or xyz will retain it in the output file.
Because it operates on substrings underspecifying may result
in additional unexpected nodes.  Be as specific as possible.
Obviously, however, if you ask for %xyz and there is a
getelementptr of %xyz you will get both nodes.  Some manual
editing may still be necessary because of this, but this script
can pare down 10,000 line files to 20 line files, making like easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24851 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-19 01:23:31 +00:00
Chris Lattner
5216c698de Handle basic block nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24833 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 21:05:44 +00:00
Chris Lattner
dc464de9b0 More fixes for Selection of copyto/fromreg with a flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24829 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 15:45:51 +00:00
Chris Lattner
755dd09815 Select copytoreg and copyfromreg nodes that have flag operands correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24827 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-18 15:28:25 +00:00
Evan Cheng
bcecf33dc2 Support for read / write from explicit registers with FlagVT type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24753 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 01:19:28 +00:00
Evan Cheng
58e84a69f5 Added support to specify predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24715 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-14 22:02:59 +00:00
Evan Cheng
01f318bfca Skip over srcvalue nodes when generating ISEL code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-14 02:21:57 +00:00
Evan Cheng
0e65b27e28 Bug fix: CodeGenMap[N] = ... -> CodeGenMap[N.getValue(0)] = ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24680 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-12 23:45:21 +00:00
Evan Cheng
481c8e0501 At top of generated isel SelectCode() is this:
if (!N.Val->hasOneUse()) {
    std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N);
    if (CGMI != CodeGenMap.end()) return CGMI->second;
  }

Suppose a DAG like this:

           X
         ^   ^
        /     \
      USE1    USE2

Suppose USE1 is being selected first and during which X is selected and
returned a new node. After this, USE1 is no longer an use of X. During USE2
selection, X will be selected again since it has only one use!

The fix is to always query CodeGenMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24679 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-12 23:22:48 +00:00
Evan Cheng
8621789fcc Bug fix: finding the correct incoming chain for pattern with nested src operand. And a minor change to make output code slightly more readible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24669 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-12 19:37:43 +00:00
Chris Lattner
0831310441 Send an indicator to llvm-testresults if the build failed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-11 19:55:39 +00:00
Nate Begeman
28a6b02626 Add support for TargetConstantPool nodes to the dag isel emitter, and use
them in the PPC backend, to simplify some logic out of Select and
SelectAddr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24657 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-10 02:36:00 +00:00
Evan Cheng
ba7fa0b5d4 Stop emitting a redudant type check for complex pattern node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-10 01:57:33 +00:00
Evan Cheng
1129e87ff4 For instructions which produce no result, e.g. store, chain's Resno == 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24652 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-10 00:09:17 +00:00
Chris Lattner
5b21be76e1 Add a new SDTCisPtrTy constraint, which indicates that an operand must have
the same type as the pointer type for a target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-09 22:57:42 +00:00
Evan Cheng
b915f3110d * Do not allow nodes which produce chain results (e.g. loads) to be folded if
it has more than one real use (non-chain uses).
* Record folded chain producing node in CodeGenMap.
* Do not fold a chain producing node if it has already been selected as an
  operand of a chain use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24647 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-09 22:45:35 +00:00
Evan Cheng
cbc09c8eaa Prevent folding of instructions which produce chains that have more than 1 real use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24643 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-09 06:06:08 +00:00
Evan Cheng
c45146ace5 * Make sure complex pattern operands are selected first since their select
functions can return false and causing the instruction pattern match to fail.
* Code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24642 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-09 00:48:42 +00:00
Evan Cheng
3aa39f439a * Added an explicit type field to ComplexPattern.
* Renamed MatchingNodes to RootNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24636 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-08 02:14:08 +00:00
Evan Cheng
0fc7198890 Added support for ComplexPattern. These are patterns that require C++ pattern
matching code that is not currently auto-generated by tblgen, e.g. X86
addressing mode. Selection routines for complex patterns can return multiple operands, e.g. X86 addressing mode returns 4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24634 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-08 02:00:36 +00:00
Evan Cheng
dd304dd4bd * Infer instruction property hasCtrlDep from pattern if it has one.
* Fixed a bug related to hasCtrlDep property use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24610 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-05 23:08:55 +00:00
Chris Lattner
22faeabb3a Implement PR673: for explicit register references, use type information
if available


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-05 02:36:37 +00:00
Chris Lattner
5c4736a3da Add some methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24596 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-05 02:35:08 +00:00
Chris Lattner
7292c5ee32 Generate code to silence bogus GCC warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-05 00:48:51 +00:00
Evan Cheng
1c3d19eb15 * Commit the fix (by Chris) for a tblgen type inferencing bug.
* Enhanced tblgen to handle instructions which have chain operand and writes a
chain result.
* Enhanced tblgen to handle instructions which produces no results. Part of
the change is a temporary hack which relies on instruction property (e.g.
isReturn, isBranch). The proper fix would be to change the .td syntax to
separate results dag from ops dag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24587 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-04 08:18:16 +00:00
Nate Begeman
6510b22cec Support multiple ValueTypes per RegisterClass, needed for upcoming vector
work.  This change has no effect on generated code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24563 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-01 04:51:06 +00:00
Evan Cheng
66a48bbc35 Teach tblgen to accept register source operands in patterns, e.g.
def SHL8rCL  : I<0xD2, MRM4r, (ops R8 :$dst, R8 :$src),
                 "shl{b} {%cl, $dst|$dst, %CL}",
                 [(set R8:$dst, (shl R8:$src, CL))]>, Imp<[CL],[]>;

This generates a CopyToReg operand and added its 2nd result to the shl as
a flag operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-01 00:18:45 +00:00
Nate Begeman
86193d1190 Nuke CodeGenInstruction's ValueType member, it is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24556 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-01 00:12:04 +00:00
Nate Begeman
ddb395463c Stop checking the ValueType of the CodeGenInstruction. Instead, use the
ValueType from the RegisterClass or Operands.  This step is necessary to
allow RegisterClasses to have multiple ValueTypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24555 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-01 00:06:14 +00:00
Nate Begeman
8ef9d16d39 fit into 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24554 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 23:58:18 +00:00
Chris Lattner
5d28ffdfec Make the code generated by tblgen return the result of SelectNodeTo, to
permit future changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24553 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 23:08:45 +00:00
Nate Begeman
391c5d231a No longer track value types for asm printer operands, and remove them as
an argument to every operand printing function.  Requires some slight
tweaks to x86, the only user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24541 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 18:54:35 +00:00
Nate Begeman
004a833ab8 Fix some copy and paste typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24540 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 18:37:14 +00:00
Evan Cheng
76021f010b Better error message when unrecognized opcode is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24519 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 18:44:58 +00:00
Nate Begeman
02fc8ff800 Add the new vector types to tablegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24514 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-29 06:19:38 +00:00
Chris Lattner
3367079b0b Initialize this variable on all paths, fixing a crasher in windows. Thanks
to JeffC for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24426 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 07:48:33 +00:00
Chris Lattner
65303d6bd7 Teach tblgen about instruction operands that have multiple MachineInstr
operands, digging into them to find register values (used on X86).  Patch
by Evan Cheng!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24424 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 07:05:57 +00:00
Chris Lattner
09c033962b Validate that the input to 'Pat' patterns is sane.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24393 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 17:43:52 +00:00
Chris Lattner
b120a64e13 teach tblgen to be smart enough to handle tglobaladdr nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24391 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 07:39:45 +00:00
Chris Lattner
12cf9090a4 fix a tblgen bug that Evan ran into, where we would lose the '$src' name
on patterns like "(set R32:$dst, (i32 imm:$src))"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24383 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 23:14:54 +00:00
Chris Lattner
811da6d889 remove these labels, there are now bigger jumps in the graph that are unlabeled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24365 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 06:44:15 +00:00
Jim Laskey
7f39c14f52 1. Remove ranges from itinerary data.
2. Tidy up the subtarget emittined code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24172 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-03 22:47:41 +00:00
Chris Lattner
465c737467 Reject integer literals that are out of range for their type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24162 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-03 05:46:11 +00:00
Chris Lattner
0614b628cf Add support for immediates directly in the pattern, this allows itanium to
define:

def : Pat<(i1 1), (CMPEQ r0, r0)>;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24149 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-02 06:49:14 +00:00
Jim Laskey
6cee630070 Allow itineraries to be passed through the Target Machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24139 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-01 20:06:59 +00:00
Jeff Cohen
cb366d980a Keep VC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24137 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-01 18:04:06 +00:00
Chris Lattner
b0ddb49419 Let people who run the nightly tester specify paths to external tests, instead
of having to hack the nightly tester script itself.

as an example, I use the following for my machine:

$HOME/llvm/utils/NightlyTest.pl -parallel -release -enable-llcbeta \
     -spec2000path /Volumes/ProjectsDisk/cvs/benchmarks/speccpu2000-llvm/benchspec/ \
     -povraypath /Volumes/ProjectsDisk/cvs/benchmarks/povray31 \
     -namdpath /Volumes/ProjectsDisk/cvs/benchmarks/namd


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24136 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-01 17:59:42 +00:00
Jim Laskey
b5a0c0ee05 Emit itinerary class in instruction info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24122 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-31 17:16:46 +00:00
Jim Laskey
10b1dd99f3 Generate cpu to itinerary map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24121 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-31 17:16:01 +00:00
Chris Lattner
4734630576 Revert an accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24098 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-29 17:01:41 +00:00
Chris Lattner
9d1a02345c Make negative immediates in patterns work correctly, silence some warnings
building the itanium backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24095 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-29 16:39:40 +00:00
Chris Lattner
366080c5e6 Switch more code over to using getValueAsListOfDefs. Look at all the -'s. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24074 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 22:59:53 +00:00
Chris Lattner
b0e103d46b Rename Record::getValueAsListDef to getValueAsListOfDefs, to more accurately
reflect what it is.
Convert some more code over to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24072 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 22:49:02 +00:00
Chris Lattner
6bc0d742c2 Use the new interface Jim added
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24071 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 22:43:25 +00:00
Jim Laskey
f7bcde0854 Removed Mr. Smith from the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24070 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 21:47:29 +00:00
Jim Laskey
fd306bfdd2 Added method to return a vector of records for a ListInit of Def field. This
simplifies using list of records.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24069 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 21:46:31 +00:00
Chris Lattner
e50caac6b0 The nightly tester report doesn't report JIT code size anymore, remove it
from the olden graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24057 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 16:35:18 +00:00
Jim Laskey
908ae27a90 Add some commentary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24055 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 15:20:43 +00:00
Jeff Cohen
9489c04efc Keep Visual Studio happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24052 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-28 01:43:09 +00:00
Jim Laskey
0d841e0567 Now generating instruction itineraries for scheduling. Not my best work, but...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24050 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 19:47:21 +00:00
Jim Laskey
6c302fc075 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 17:49:21 +00:00
Jim Laskey
581a8f79bc Give full control of subtarget features over to table generated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24013 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 17:30:34 +00:00
Chris Lattner
a7ad198f89 Condcodes are in the ISD namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24010 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 17:02:02 +00:00
Chris Lattner
1531f2025c Add support for CondCode's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24008 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 16:59:37 +00:00
Chris Lattner
f071bb5b87 Emit some boilerplate for targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23983 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 20:35:14 +00:00
Jim Laskey
b3b1d5f097 Refactored to make room for more stuff (scheduling info.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23975 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-25 15:16:36 +00:00
Chris Lattner
dc93efe30e Fix an incompatibility with GCC 4.1, thanks to Vladimir Merzliakov
for pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23963 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 15:04:15 +00:00
Chris Lattner
d4d0797851 Add the needed #include, emit enums with the sizes of tables, remove
definitions from the LLVM namespace, since they are all static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 22:33:08 +00:00
Chris Lattner
2dc74dd831 Remove the obsolete instr selector emitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23894 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 05:47:52 +00:00
Jim Laskey
7dc02047fb Sort the features and processor lists for the sake of search (and maintainers.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23879 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-22 07:59:56 +00:00
Jim Laskey
f5fc2cbd6b Plugin new subtarget backend into the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23870 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 19:05:19 +00:00
Jim Laskey
4bb9cbb730 New TableGen backends for subtarget information. Only command line stuff
active now.  Scheduling itinerary next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23869 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 19:00:04 +00:00
Chris Lattner
edbd8711de Make tblgen emit:
tblgen: In ZAPNOTi: Cannot use 'IZAPX' in an input pattern!
for a bad pattern, instead of an ugly assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23854 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-21 01:19:59 +00:00
Chris Lattner
2f041d49a9 add support for literal immediates in patterns to match, allowing us to
write things like this:

def : Pat<(add GPRC:$in, 12),
          (ADD12 GPRC:$in)>;

Andrew: if this isn't enough or doesn't work for you, please lemme know.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23819 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 04:41:05 +00:00
Chris Lattner
5d5a056092 Add basic support for integer constants in pattern results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23817 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 04:30:56 +00:00
Chris Lattner
2ac8510d68 Fix some checking that was causing duraid to get a perplexing assertion
instead of a happy error message


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23816 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 04:12:14 +00:00
Chris Lattner
4c59309f59 Add support for patterns that have physical registers in them. Testcase:
def : Pat<(trunc G8RC:$in),
          (OR8To4 G8RC:$in, X0)>;

Even though this doesn't make any sense on PPC :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23815 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 02:07:26 +00:00
Chris Lattner
ab1bf27be5 Asserting here is to violent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23814 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 01:55:23 +00:00
Chris Lattner
0c0cfa741f Nate wants to define 'Pat's which turn into instructions that don't have
patterns.  Certainly a logical request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-19 01:27:22 +00:00
Chris Lattner
b277cbc087 Duraid pointed out that it is impolite to emit PPC:: into the IA64 backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23780 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-18 04:41:01 +00:00
Chris Lattner
5024d93c8b Make the generated code significantly more memory efficient, by using
SelectNodeTo instead of getTargetNode when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23758 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-16 01:41:58 +00:00
Chris Lattner
7e82f1322c Implement the last major missing piece in the DAG isel generator: when emitting
a pattern match, make sure to emit the (minimal number of) type checks that
verify the pattern matches this specific instruction.  This allows FMA32
patterns to not match double expressions for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23748 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-15 21:34:21 +00:00
Chris Lattner
603d78c9de Now that we have int/fp lattice values, implement the SDTCisOpSmallerThanOp
type constraint.  This lets tblgen realize that it doesn't need any dynamic
type checks for fextend/fround on PPC (and many other targets), because there
are only two fp types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23730 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 06:25:00 +00:00
Chris Lattner
3c7e18d690 Fairly serious rework of the typing code to add new int/fp lattice values.
Overall, no functionality change yet though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23729 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 06:12:03 +00:00
Chris Lattner
e0583b1b92 simplify the code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23728 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 05:08:37 +00:00
Chris Lattner
03ebd802c7 Add basic support for recognizing a new SDTCisOpSmallerThanOp type constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23725 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 04:53:53 +00:00
Chris Lattner
0ee7cff4fb Implement a couple of new (important) features.
1. If an operation has to be int or fp and the target only supports one
   int or fp type, relize that the op has to have that type.
2. If a target has operations on multiple types, do not emit matching code
   for patterns involving those operators, since we do not emit the code to
   check for them yet.  This prevents PPC from generating FP ops currently.

Also move some code around into more logical places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23724 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 04:11:13 +00:00
Chris Lattner
75ee2eb4e2 Do not let getLegalValueTypes return a list with duplicates in it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23723 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-14 03:54:49 +00:00
Patrick Meredith
d223f5ee78 Updated to be less restrictive on what is matched
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23712 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 17:31:30 +00:00
Chris Lattner
e08fe8d7e5 apparently one of the makefile changes changed libprofile.so to profile.so
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23709 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 16:34:24 +00:00
Patrick Meredith
b89dd23b43 This script is used to remove nodes with the label %tmp(.#)* and all
edges associated with said node from the dot files produced by
DSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23708 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 16:26:50 +00:00
Chris Lattner
80bec12f96 put the right labels on the data
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23599 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 21:51:38 +00:00
Chris Lattner
4b2e5a680f Emit the value type for each register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23584 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 06:23:37 +00:00
Chris Lattner
0f21fd5204 Rename MRegisterDesc -> TargetRegisterDesc for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23564 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:49:27 +00:00
Chris Lattner
22842105de remove some more initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23562 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:41:05 +00:00
Chris Lattner
2f02ed9a1f trim down the target info structs now that we have a preferred spill register class for each callee save register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23560 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:35:22 +00:00
Chris Lattner
4794797f12 Compute a preferred spill register class for each callee-save register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23553 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:44:45 +00:00
Chris Lattner
88b7e6e304 Fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23550 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:09:50 +00:00
Chris Lattner
946ac939c6 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23549 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:53:25 +00:00
Chris Lattner
c3bec0e401 Refactor this a bit to move ParsingTemplateArgs to only apply to classes,
not defs.

Implement support for forward definitions of classes.  This implements
TableGen/ForwardRef.td.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23548 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:53:04 +00:00
Chris Lattner
0a28405089 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23546 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:42:56 +00:00
Chris Lattner
583a0249b6 Generate a parse error instead of a checked exception if template args are
used on a def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23545 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:42:31 +00:00
Chris Lattner
8d354e901f regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23543 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:11:27 +00:00
Chris Lattner
be88b50c01 Refactor the grammar a bit to implement TableGen/ForwardRef.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23542 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:10:49 +00:00
Chris Lattner
0d0b73e9f8 allow regs to be in multiple reg classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23540 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:33:48 +00:00
Chris Lattner
af302914d1 Teach tablegen to reassociate operators when possible. This allows it to
find all of teh pattern matches for EQV from one definition


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23529 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 22:36:54 +00:00
Chris Lattner
e46e17b7fb Teach tblgen to build permutations of instructions, so that the target author
doesn't have to specify them manually.  It currently handles associativity,
e.g. knowing that (X*Y)+Z  also matches  X+(Y*Z)  and will be extended in
the future.

It is smart enough to not introduce duplicate patterns or patterns that can
never match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23526 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 19:28:10 +00:00
Chris Lattner
7cf2fe6c48 add support for an associative marker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23502 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 20:58:06 +00:00
Chris Lattner
e97603f1bd Emit an error if instructions or patterns are defined but can never match.
Currently we check that immediate values live on the RHS of commutative
operators.  Defining ORI like this, for example:

def ORI   : DForm_4<24, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2),
                    "ori $dst, $src1, $src2",
                    [(set GPRC:$dst, (or immZExt16:$src2, GPRC:$src1))]>;

results in:

tblgen: In ORI: Instruction can never match: Immediate values must be on the RHS of commutative operators!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23501 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 19:27:25 +00:00
Chris Lattner
a1a68ae061 collect commutativity information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23499 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 18:28:29 +00:00
Chris Lattner
05814af29f Prefer cheaper patterns to more expensive ones. Print the costs to the generated
file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23492 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 17:57:56 +00:00
Chris Lattner
f6f9416363 Select Constant nodes to TargetConstant nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23488 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 16:58:06 +00:00
Chris Lattner
fab3728801 memoize the assert results
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23457 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 22:10:24 +00:00
Chris Lattner
3748147aaf Emit the switch stmt cases in alphabetical order instead of pointer order,
which is not stable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23456 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 21:59:35 +00:00
Chris Lattner
6bc7e513d5 implement a fixme: only select values once, even if used multiple times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23454 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 21:53:26 +00:00
Jeff Cohen
a48283baa3 Fix VC++ build errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23431 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-25 19:04:43 +00:00
Chris Lattner
296dfe3b8a memoize translations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23419 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 00:50:51 +00:00
Chris Lattner
72fe91c4dd Teach the DAG isel generator to emit code that creates nodes.
Fix a few corner cases parsing things like (i32 imm:$foo)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23417 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 00:40:24 +00:00
Chris Lattner
8fc3568d98 Emit better code (no more copies for var references), and support DAG patterns
(e.g. things like rotates).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23416 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 23:16:51 +00:00