Commit Graph

418 Commits

Author SHA1 Message Date
Chris Lattner 3d38031bef Remove obsolete comment, make things look a bit nicer
llvm-svn: 25070
2006-01-04 00:32:01 +00:00
Chris Lattner c29793a077 reduce stack usage of the recursive SelectCode function by out-lining each
case of the switch statement into its own method.

llvm-svn: 25069
2006-01-04 00:25:00 +00:00
Chris Lattner 81e4dbc6a1 Remove my previous ugly hack that tries to reduce the stack space usage
of SelectCode to make way for a better solution.

llvm-svn: 25068
2006-01-03 22:55:16 +00:00
Duraid Madina def44bec82 HP-UX DVDs are crunchy and good to eat
llvm-svn: 25052
2005-12-30 16:41:48 +00:00
Duraid Madina 018da4f5ef almost got the HP-UX tester up.. :)
llvm-svn: 25051
2005-12-30 14:56:37 +00:00
Nate Begeman 336dba6fb1 Add support for generating v4i32 altivec code
llvm-svn: 25046
2005-12-30 00:12:56 +00:00
Duraid Madina ccb1aebcd3 This gets most of the backends building with HP HappyC++.
llvm-svn: 25029
2005-12-27 10:56:22 +00:00
Evan Cheng 14c53b45f5 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.

llvm-svn: 25017
2005-12-26 09:11:45 +00:00
Duraid Madina 14492afc23 more standards-compliance stuff
llvm-svn: 25014
2005-12-26 05:08:55 +00:00
Andrew Lenharth 0dc12c38e5 support targetexternalsym
llvm-svn: 25005
2005-12-24 23:36:59 +00:00
Evan Cheng 72aaf8e374 * Support for hasInFlag and hasOutFlag (on instructions). Remove nameless FLAG
support which is fragile.
* Fixed a number of bugs.

llvm-svn: 24996
2005-12-23 22:11:47 +00:00
Chris Lattner d834d495b2 silence some bogus gcc warnings
llvm-svn: 24962
2005-12-22 20:37:36 +00:00
Evan Cheng a87d743912 Attempt to fix a crash on WIN32.
llvm-svn: 24936
2005-12-22 02:35:21 +00:00
Evan Cheng 991bc6d6ba * 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.

llvm-svn: 24933
2005-12-22 02:24:50 +00:00
Evan Cheng f646926ecf Allows instructions which no explicit operands. e.g. X86 RET which has but
an implicit flag operand.

llvm-svn: 24916
2005-12-21 20:20:49 +00:00
Chris Lattner 812a56e888 Eliminate some GCC warnings from the generated code
llvm-svn: 24897
2005-12-21 05:31:05 +00:00
Evan Cheng 4bf64a8ba4 Fix the semantic of Requires<[cond]> to mean if (!cond) goto PXXFail;
llvm-svn: 24883
2005-12-20 20:08:01 +00:00
Chris Lattner 777bb6eb45 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.

llvm-svn: 24882
2005-12-20 19:41:03 +00:00
Evan Cheng 9696f63d3e Now support instructions with implicit write to non-flag registers.
llvm-svn: 24878
2005-12-20 07:37:41 +00:00
Evan Cheng fe90b604a4 Lefted out a fix in the previous check in.
llvm-svn: 24873
2005-12-20 00:06:17 +00:00
Evan Cheng 19b9f15377 Fix another bug related to chain / flag.
llvm-svn: 24868
2005-12-19 22:40:04 +00:00
Evan Cheng 9bd85c2f19 Fixes for a number of bugs: save flag results in CodeGenMap, folded chains
may not all have ResNo == 0.

llvm-svn: 24858
2005-12-19 07:18:51 +00:00
Chris Lattner f7ae0a95fe Handle basic block nodes
llvm-svn: 24833
2005-12-18 21:05:44 +00:00
Chris Lattner abb11cc83e More fixes for Selection of copyto/fromreg with a flag
llvm-svn: 24829
2005-12-18 15:45:51 +00:00
Chris Lattner fc3d4f8fd8 Select copytoreg and copyfromreg nodes that have flag operands correctly.
llvm-svn: 24827
2005-12-18 15:28:25 +00:00
Evan Cheng e22f9181f7 Support for read / write from explicit registers with FlagVT type.
llvm-svn: 24753
2005-12-17 01:19:28 +00:00
Evan Cheng d296a43f96 Added support to specify predicates.
llvm-svn: 24715
2005-12-14 22:02:59 +00:00
Evan Cheng 6a31777c8e Skip over srcvalue nodes when generating ISEL code.
llvm-svn: 24704
2005-12-14 02:21:57 +00:00
Evan Cheng 6148153230 Bug fix: CodeGenMap[N] = ... -> CodeGenMap[N.getValue(0)] = ...
llvm-svn: 24680
2005-12-12 23:45:21 +00:00
Evan Cheng 7e4c01eee3 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.

llvm-svn: 24679
2005-12-12 23:22:48 +00:00
Evan Cheng cdb16ef6f3 Bug fix: finding the correct incoming chain for pattern with nested src operand. And a minor change to make output code slightly more readible.
llvm-svn: 24669
2005-12-12 19:37:43 +00:00
Nate Begeman 4e56db674c 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.

llvm-svn: 24657
2005-12-10 02:36:00 +00:00
Evan Cheng 0da396ffe2 Stop emitting a redudant type check for complex pattern node.
llvm-svn: 24655
2005-12-10 01:57:33 +00:00
Evan Cheng bac252c289 For instructions which produce no result, e.g. store, chain's Resno == 0.
llvm-svn: 24652
2005-12-10 00:09:17 +00:00
Chris Lattner 433573f4c6 Add a new SDTCisPtrTy constraint, which indicates that an operand must have
the same type as the pointer type for a target.

llvm-svn: 24649
2005-12-09 22:57:42 +00:00
Evan Cheng 499ab2a9fa * 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.

llvm-svn: 24647
2005-12-09 22:45:35 +00:00
Evan Cheng c1f911a238 Prevent folding of instructions which produce chains that have more than 1 real use
llvm-svn: 24643
2005-12-09 06:06:08 +00:00
Evan Cheng f423a17e33 * 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.

llvm-svn: 24642
2005-12-09 00:48:42 +00:00
Evan Cheng c9a620060b * Added an explicit type field to ComplexPattern.
* Renamed MatchingNodes to RootNodes.

llvm-svn: 24636
2005-12-08 02:14:08 +00:00
Evan Cheng 9b9567bfb5 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.

llvm-svn: 24634
2005-12-08 02:00:36 +00:00
Evan Cheng 0fe76d1585 * Infer instruction property hasCtrlDep from pattern if it has one.
* Fixed a bug related to hasCtrlDep property use.

llvm-svn: 24610
2005-12-05 23:08:55 +00:00
Chris Lattner ba369ae8f1 Implement PR673: for explicit register references, use type information
if available

llvm-svn: 24597
2005-12-05 02:36:37 +00:00
Chris Lattner 3717b4c830 Add some methods
llvm-svn: 24596
2005-12-05 02:35:08 +00:00
Chris Lattner d49489f01e Generate code to silence bogus GCC warnings.
llvm-svn: 24593
2005-12-05 00:48:51 +00:00
Evan Cheng f02bb9af8b * 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.

llvm-svn: 24587
2005-12-04 08:18:16 +00:00
Nate Begeman 006bb04f3a Support multiple ValueTypes per RegisterClass, needed for upcoming vector
work.  This change has no effect on generated code.

llvm-svn: 24563
2005-12-01 04:51:06 +00:00
Evan Cheng fed83adbe3 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.

llvm-svn: 24557
2005-12-01 00:18:45 +00:00
Nate Begeman faad542d24 Nuke CodeGenInstruction's ValueType member, it is no longer used.
llvm-svn: 24556
2005-12-01 00:12:04 +00:00
Nate Begeman cdf2c67888 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.

llvm-svn: 24555
2005-12-01 00:06:14 +00:00
Nate Begeman e479ccb27b fit into 80 columns
llvm-svn: 24554
2005-11-30 23:58:18 +00:00
Chris Lattner 3e63dc00da Make the code generated by tblgen return the result of SelectNodeTo, to
permit future changes.

llvm-svn: 24553
2005-11-30 23:08:45 +00:00
Nate Begeman 6f8c1ace6e 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.

llvm-svn: 24541
2005-11-30 18:54:35 +00:00
Nate Begeman f621b333f3 Fix some copy and paste typos.
llvm-svn: 24540
2005-11-30 18:37:14 +00:00
Evan Cheng c8af0cb893 Better error message when unrecognized opcode is seen.
llvm-svn: 24519
2005-11-29 18:44:58 +00:00
Nate Begeman 4d0251ad55 Add the new vector types to tablegen
llvm-svn: 24514
2005-11-29 06:19:38 +00:00
Chris Lattner f2807be3da Initialize this variable on all paths, fixing a crasher in windows. Thanks
to JeffC for pointing this out.

llvm-svn: 24426
2005-11-19 07:48:33 +00:00
Chris Lattner 6bc0304c91 Teach tblgen about instruction operands that have multiple MachineInstr
operands, digging into them to find register values (used on X86).  Patch
by Evan Cheng!

llvm-svn: 24424
2005-11-19 07:05:57 +00:00
Chris Lattner a70c7dff2e Validate that the input to 'Pat' patterns is sane.
llvm-svn: 24393
2005-11-17 17:43:52 +00:00
Chris Lattner 2a230e1c1a teach tblgen to be smart enough to handle tglobaladdr nodes
llvm-svn: 24391
2005-11-17 07:39:45 +00:00
Chris Lattner b22950df6c fix a tblgen bug that Evan ran into, where we would lose the '$src' name
on patterns like "(set R32:$dst, (i32 imm:$src))"

llvm-svn: 24383
2005-11-16 23:14:54 +00:00
Jim Laskey d6d3afb05e 1. Remove ranges from itinerary data.
2. Tidy up the subtarget emittined code.

llvm-svn: 24172
2005-11-03 22:47:41 +00:00
Chris Lattner 64209fd14b Reject integer literals that are out of range for their type.
llvm-svn: 24162
2005-11-03 05:46:11 +00:00
Chris Lattner 590176be16 Add support for immediates directly in the pattern, this allows itanium to
define:

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

llvm-svn: 24149
2005-11-02 06:49:14 +00:00
Jim Laskey 802748cd61 Allow itineraries to be passed through the Target Machine.
llvm-svn: 24139
2005-11-01 20:06:59 +00:00
Jeff Cohen 9e1784d738 Keep VC++ happy.
llvm-svn: 24137
2005-11-01 18:04:06 +00:00
Jim Laskey 0433df136f Emit itinerary class in instruction info.
llvm-svn: 24122
2005-10-31 17:16:46 +00:00
Jim Laskey 3763a50d82 Generate cpu to itinerary map.
llvm-svn: 24121
2005-10-31 17:16:01 +00:00
Chris Lattner d91df9d941 Make negative immediates in patterns work correctly, silence some warnings
building the itanium backend.

llvm-svn: 24095
2005-10-29 16:39:40 +00:00
Chris Lattner 742606ad30 Switch more code over to using getValueAsListOfDefs. Look at all the -'s. :)
llvm-svn: 24074
2005-10-28 22:59:53 +00:00
Chris Lattner 7ad0bed89f Rename Record::getValueAsListDef to getValueAsListOfDefs, to more accurately
reflect what it is.
Convert some more code over to use it.

llvm-svn: 24072
2005-10-28 22:49:02 +00:00
Chris Lattner 802bd8d94f Use the new interface Jim added
llvm-svn: 24071
2005-10-28 22:43:25 +00:00
Jim Laskey dffe5978a3 Removed Mr. Smith from the code.
llvm-svn: 24070
2005-10-28 21:47:29 +00:00
Jim Laskey b04feb633f Added method to return a vector of records for a ListInit of Def field. This
simplifies using list of records.

llvm-svn: 24069
2005-10-28 21:46:31 +00:00
Jim Laskey 1959575208 Add some commentary.
llvm-svn: 24055
2005-10-28 15:20:43 +00:00
Jeff Cohen b0aa47b043 Keep Visual Studio happy.
llvm-svn: 24052
2005-10-28 01:43:09 +00:00
Jim Laskey 86f002cc32 Now generating instruction itineraries for scheduling. Not my best work, but...
llvm-svn: 24050
2005-10-27 19:47:21 +00:00
Jim Laskey 777a26efc3 Simplify.
llvm-svn: 24015
2005-10-26 17:49:21 +00:00
Jim Laskey a2b5235fac Give full control of subtarget features over to table generated code.
llvm-svn: 24013
2005-10-26 17:30:34 +00:00
Chris Lattner f277ac7caa Condcodes are in the ISD namespace
llvm-svn: 24010
2005-10-26 17:02:02 +00:00
Chris Lattner 611b0c634c Add support for CondCode's
llvm-svn: 24008
2005-10-26 16:59:37 +00:00
Chris Lattner d980c46f52 Emit some boilerplate for targets
llvm-svn: 23983
2005-10-25 20:35:14 +00:00
Jim Laskey 1b7369b1ae Refactored to make room for more stuff (scheduling info.)
llvm-svn: 23975
2005-10-25 15:16:36 +00:00
Chris Lattner fc9f5773d0 Fix an incompatibility with GCC 4.1, thanks to Vladimir Merzliakov
for pointing this out!

llvm-svn: 23963
2005-10-24 15:04:15 +00:00
Chris Lattner 4f48e67c6c Add the needed #include, emit enums with the sizes of tables, remove
definitions from the LLVM namespace, since they are all static.

llvm-svn: 23907
2005-10-23 22:33:08 +00:00
Chris Lattner 49f7b69997 Remove the obsolete instr selector emitter
llvm-svn: 23894
2005-10-23 05:47:52 +00:00
Jim Laskey a1beea6c7d Sort the features and processor lists for the sake of search (and maintainers.)
llvm-svn: 23879
2005-10-22 07:59:56 +00:00
Jim Laskey 9ed9032e22 Plugin new subtarget backend into the build.
llvm-svn: 23870
2005-10-21 19:05:19 +00:00
Jim Laskey cfda85ad91 New TableGen backends for subtarget information. Only command line stuff
active now.  Scheduling itinerary next.

llvm-svn: 23869
2005-10-21 19:00:04 +00:00
Chris Lattner 8bda5afd91 Make tblgen emit:
tblgen: In ZAPNOTi: Cannot use 'IZAPX' in an input pattern!
for a bad pattern, instead of an ugly assertion.

llvm-svn: 23854
2005-10-21 01:19:59 +00:00
Chris Lattner c9ad735e78 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.
llvm-svn: 23819
2005-10-19 04:41:05 +00:00
Chris Lattner 7f6f565846 Add basic support for integer constants in pattern results.
llvm-svn: 23817
2005-10-19 04:30:56 +00:00
Chris Lattner 2ae2f99326 Fix some checking that was causing duraid to get a perplexing assertion
instead of a happy error message

llvm-svn: 23816
2005-10-19 04:12:14 +00:00
Chris Lattner b8014e10ae 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 :)

llvm-svn: 23815
2005-10-19 02:07:26 +00:00
Chris Lattner c8f899f98d Asserting here is to violent
llvm-svn: 23814
2005-10-19 01:55:23 +00:00
Chris Lattner 8baf5043a8 Nate wants to define 'Pat's which turn into instructions that don't have
patterns.  Certainly a logical request.

llvm-svn: 23810
2005-10-19 01:27:22 +00:00
Chris Lattner ed653cbe43 Duraid pointed out that it is impolite to emit PPC:: into the IA64 backend
llvm-svn: 23780
2005-10-18 04:41:01 +00:00
Chris Lattner 825298b060 Make the generated code significantly more memory efficient, by using
SelectNodeTo instead of getTargetNode when possible.

llvm-svn: 23758
2005-10-16 01:41:58 +00:00
Chris Lattner 6b22d2554a 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.

llvm-svn: 23748
2005-10-15 21:34:21 +00:00
Chris Lattner c4db8f4163 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.

llvm-svn: 23730
2005-10-14 06:25:00 +00:00
Chris Lattner ecaf56b21a Fairly serious rework of the typing code to add new int/fp lattice values.
Overall, no functionality change yet though.

llvm-svn: 23729
2005-10-14 06:12:03 +00:00
Chris Lattner cdf483556f simplify the code a bit
llvm-svn: 23728
2005-10-14 05:08:37 +00:00
Chris Lattner 4892df38f3 Add basic support for recognizing a new SDTCisOpSmallerThanOp type constraint
llvm-svn: 23725
2005-10-14 04:53:53 +00:00
Chris Lattner 7b0275ba8c 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.

llvm-svn: 23724
2005-10-14 04:11:13 +00:00
Chris Lattner 90c5b9c83c Do not let getLegalValueTypes return a list with duplicates in it
llvm-svn: 23723
2005-10-14 03:54:49 +00:00
Chris Lattner d4ff3c1324 Emit the value type for each register class.
llvm-svn: 23584
2005-10-02 06:23:37 +00:00
Chris Lattner c9f4219cfc Rename MRegisterDesc -> TargetRegisterDesc for consistency
llvm-svn: 23564
2005-09-30 17:49:27 +00:00
Chris Lattner 3e020bb619 remove some more initializers
llvm-svn: 23562
2005-09-30 17:41:05 +00:00
Chris Lattner ddc69bbbba trim down the target info structs now that we have a preferred spill register class for each callee save register
llvm-svn: 23560
2005-09-30 17:35:22 +00:00
Chris Lattner da6fcc9f49 Compute a preferred spill register class for each callee-save register
llvm-svn: 23553
2005-09-30 06:44:45 +00:00
Chris Lattner 26f5fb1277 Fix a warning
llvm-svn: 23550
2005-09-30 06:09:50 +00:00
Chris Lattner 1916ef75cf Regenerate
llvm-svn: 23549
2005-09-30 04:53:25 +00:00
Chris Lattner b509577605 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.

llvm-svn: 23548
2005-09-30 04:53:04 +00:00
Chris Lattner 20b0e3cee4 Regenerate
llvm-svn: 23546
2005-09-30 04:42:56 +00:00
Chris Lattner ad61925e27 Generate a parse error instead of a checked exception if template args are
used on a def.

llvm-svn: 23545
2005-09-30 04:42:31 +00:00
Chris Lattner 6e60c8fe05 regenerate
llvm-svn: 23543
2005-09-30 04:11:27 +00:00
Chris Lattner e04e1384fc Refactor the grammar a bit to implement TableGen/ForwardRef.td
llvm-svn: 23542
2005-09-30 04:10:49 +00:00
Chris Lattner 2a6fd61dfc allow regs to be in multiple reg classes
llvm-svn: 23540
2005-09-30 01:33:48 +00:00
Chris Lattner 366fe04301 Teach tablegen to reassociate operators when possible. This allows it to
find all of teh pattern matches for EQV from one definition

llvm-svn: 23529
2005-09-29 22:36:54 +00:00
Chris Lattner e86824e57a 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.

llvm-svn: 23526
2005-09-29 19:28:10 +00:00
Chris Lattner 492e70f4ec add support for an associative marker
llvm-svn: 23502
2005-09-28 20:58:06 +00:00
Chris Lattner 8bb25cd68a 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!
llvm-svn: 23501
2005-09-28 19:27:25 +00:00
Chris Lattner f74c30c281 collect commutativity information
llvm-svn: 23499
2005-09-28 18:28:29 +00:00
Chris Lattner 3622f15491 Prefer cheaper patterns to more expensive ones. Print the costs to the generated
file

llvm-svn: 23492
2005-09-28 17:57:56 +00:00
Chris Lattner 75b4c5d868 Select Constant nodes to TargetConstant nodes
llvm-svn: 23488
2005-09-28 16:58:06 +00:00
Chris Lattner d455c36c91 memoize the assert results
llvm-svn: 23457
2005-09-26 22:10:24 +00:00
Chris Lattner c9153266c6 Emit the switch stmt cases in alphabetical order instead of pointer order,
which is not stable.

llvm-svn: 23456
2005-09-26 21:59:35 +00:00
Chris Lattner d5de8544f8 implement a fixme: only select values once, even if used multiple times.
llvm-svn: 23454
2005-09-26 21:53:26 +00:00
Jeff Cohen 23b1d28e69 Fix VC++ build errors.
llvm-svn: 23431
2005-09-25 19:04:43 +00:00
Chris Lattner cc1d38160d memoize translations
llvm-svn: 23419
2005-09-24 00:50:51 +00:00
Chris Lattner 0afb14cade Teach the DAG isel generator to emit code that creates nodes.
Fix a few corner cases parsing things like (i32 imm:$foo)

llvm-svn: 23417
2005-09-24 00:40:24 +00:00
Chris Lattner cd093e868e Emit better code (no more copies for var references), and support DAG patterns
(e.g. things like rotates).

llvm-svn: 23416
2005-09-23 23:16:51 +00:00
Chris Lattner 8ffb99b4fe Fix a fixme by passing around SDOperand's instead of SDNode*'s
llvm-svn: 23415
2005-09-23 21:53:45 +00:00
Chris Lattner cc8a564cb1 Emit code that matches the incoming DAG pattern and checks predicates.
This does not check that types match yet, but PPC only has one integer type
;-).

This also doesn't have the code to build the resultant dag.

llvm-svn: 23414
2005-09-23 21:33:23 +00:00
Chris Lattner 323a47970e emit information about the order patterns are to be matched.
llvm-svn: 23413
2005-09-23 20:52:47 +00:00
Chris Lattner abb430bad2 start filling in the switch stmt
llvm-svn: 23412
2005-09-23 19:36:15 +00:00
Chris Lattner 7884fffb00 Fix a minor bug, add comments
llvm-svn: 23370
2005-09-16 00:29:46 +00:00
Chris Lattner 59e96143a2 teach the type inference code how to infer types for instructions and node
xforms.  Run type inference on result patterns, so we always have fully typed
results (and to catch errors in .td files).

llvm-svn: 23369
2005-09-15 22:23:50 +00:00
Chris Lattner fedd9a5e1d put instructions into a map instead of a vector for quick lookup
llvm-svn: 23368
2005-09-15 21:57:35 +00:00
Chris Lattner f38ce8f756 when parsing instructions remember information about the types taken and
returned.

llvm-svn: 23367
2005-09-15 21:51:12 +00:00
Chris Lattner a0a986c9ae Start parsing "Pattern" nodes
llvm-svn: 23365
2005-09-15 21:42:00 +00:00
Chris Lattner f79ad4cb32 rename a couple of methods, add structure for pattern parsing
llvm-svn: 23364
2005-09-15 02:38:02 +00:00
Chris Lattner a155256a71 Verify that xform functions only occur in logical places
llvm-svn: 23363
2005-09-14 23:05:13 +00:00
Chris Lattner 991c7c973a Promote xform fns to be explicit nodes in result patterns, and clean off
predicates since they will have already matched at this point.

llvm-svn: 23362
2005-09-14 23:01:59 +00:00
Chris Lattner bc7aabce12 start building the instruction dest pattern correctly. Change the xform
functions to preserve the Record for the xform instead of making it into a
function name.

llvm-svn: 23361
2005-09-14 22:55:26 +00:00
Chris Lattner e389c6154e catch unnamed inputs
llvm-svn: 23360
2005-09-14 22:06:36 +00:00
Chris Lattner 030f876cf2 check that there are no unexpected operands
llvm-svn: 23359
2005-09-14 21:59:34 +00:00
Chris Lattner 3ced3f8b82 force all instruction operands to be named.
llvm-svn: 23358
2005-09-14 21:13:50 +00:00
Chris Lattner f02994d782 Check that operands have unique names. REJECT instructions with broken operand
lists: only don't parse them if they are entirely missing (sparcv9).

llvm-svn: 23355
2005-09-14 21:05:02 +00:00
Chris Lattner 24ae3494f0 fix a broke range check
llvm-svn: 23354
2005-09-14 21:04:12 +00:00
Chris Lattner 3ba60bf644 Parse significantly more of the instruction pattern, now collecting and
verifying information about the operands.

llvm-svn: 23353
2005-09-14 20:53:42 +00:00