Commit Graph

622 Commits

Author SHA1 Message Date
Evan Cheng 482ef91d26 Pattern complexity calculation fix.
llvm-svn: 25133
2006-01-06 22:19:44 +00:00
Evan Cheng 46634d21e3 Tweak pattern complexity calc.
llvm-svn: 25122
2006-01-06 02:30:23 +00:00
Evan Cheng 6b037909ff Bug fix wrt chain operand.
llvm-svn: 25115
2006-01-06 00:41:12 +00:00
Jeff Cohen a69bb989f1 Replace fix with one less disruptive to the original code.
Also note that GCC 4.1 also correctly flags the syntax error.

llvm-svn: 25076
2006-01-04 03:23:30 +00:00
Jeff Cohen 7d17a6bc86 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++.

llvm-svn: 25075
2006-01-04 03:15:19 +00:00
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
Patrick Meredith 2dd7e06d8e 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 ;-)

llvm-svn: 24876
2005-12-20 02:03:23 +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
Patrick Meredith 136f465fa2 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.

llvm-svn: 24851
2005-12-19 01:23:31 +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
Chris Lattner 08dbd94632 Send an indicator to llvm-testresults if the build failed
llvm-svn: 24665
2005-12-11 19:55:39 +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