Commit Graph

953 Commits

Author SHA1 Message Date
Chris Lattner
3f8b8913bc Autogenerate code to map from GCC builtin to LLVM intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26770 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 01:33:26 +00:00
Reid Spencer
09a053a777 Allow a sequence of digits at the end of the directory name when trying to
determine the top directory. This allows the tool to find the correct top
directory when you have something like:

   /x/llvm
   /x/llvm2
   /x/llvm3

Previously the scripts would always find /x/llvm even if you were in the
llvm2 or llvm3 directory because the pattern didn't allow the digits at
the end of the path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:08:05 +00:00
Reid Spencer
b7b8317388 Change llvm.cs.uiuc.edu -> llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 06:05:05 +00:00
Reid Spencer
767a25b878 Add a newline at the end to avoid gcc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26749 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:59:52 +00:00
Reid Spencer
9dce2b3380 Convert llvm.cs.uiuc.edu -> llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:54:52 +00:00
Chris Lattner
022f64fbbc emit a mapping from LLVM intrinsic -> GCC builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:08:44 +00:00
Chris Lattner
18faf5d9f7 Verify that packed type operands have the right size and base type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 22:38:57 +00:00
Chris Lattner
78167faa18 fix pasto in generate assertion msg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26706 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 00:20:47 +00:00
Chris Lattner
4e5f35973c generate side-effect info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26672 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:37:52 +00:00
Chris Lattner
6448ee44c6 Parse mod/ref properties, autogen mod/ref information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26669 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:30:49 +00:00
Chris Lattner
f97a00e681 parse intrinsic types
autogenerate an intrinsic verifier


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26666 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:05:04 +00:00
Chris Lattner
9b843b2494 autogenerate the function name recognizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26663 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 20:34:19 +00:00
Evan Cheng
ed66e855ec Temporary hack to enable more (store (op (load ...))) folding. This makes
it possible when a TokenFactor is between the load and store. But is still
missing some cases due to ordering issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26638 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 08:19:11 +00:00
Evan Cheng
6f8aaf2cb0 Don't generate silly matching code like this:
if (N1.getOpcode() == ISD::ADD &&
     ...)
   if (... &&
       (N1.getNumOperands() == 1 || !isNonImmUse(N1.Val, N10.Val))) &&
       ...)

TableGen knows N1 must have more than one operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26592 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-07 08:31:27 +00:00
Chris Lattner
56879b2d96 Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26508 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 19:34:28 +00:00
Chris Lattner
b672d981a8 Fix pasteo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 06:13:41 +00:00
Chris Lattner
3b2397211b remove a bunch of long-dead testing code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26497 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:34:28 +00:00
Chris Lattner
9e493cfcc3 initial implementation of intrinsic parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26495 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:32:46 +00:00
Chris Lattner
3d87811ce0 remove out of date comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26492 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:04:07 +00:00
Chris Lattner
ed5424196d Add support for "-Ifoo" in addition to "-I foo"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26487 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:53:40 +00:00
Chris Lattner
c1d6e4eba7 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26486 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:47:37 +00:00
Chris Lattner
d9f5d90af1 add support for multiple include directories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26485 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:47:14 +00:00
Evan Cheng
9073dea7c0 New vector type v2f32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26437 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 01:10:52 +00:00
Chris Lattner
fd105d464a Select inline asm memory operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26349 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-24 02:13:31 +00:00
Evan Cheng
aea20f50e5 Added x86 integer vector types: 64-bit packed byte integer (v16i8), 64-bit
packed word integer (v8i16), and 64-bit packed doubleword integer (v2i32).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26294 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-20 22:34:53 +00:00
Jeff Cohen
bce4805d6f Fix bugs identified by VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26287 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-18 03:20:33 +00:00
Evan Cheng
fbad70808c Bump up pattern cost if the resulting instruction is marked
usesCustomDAGSchedInserter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-18 02:33:09 +00:00
Chris Lattner
bdd3c1604e Check the new form for bison output into CVS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26208 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 07:24:01 +00:00
Chris Lattner
e8242b168c Adjust to new form of handling lexer dependencies, this way shouldn't have
the problems the old way did.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26161 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-14 05:13:13 +00:00
Evan Cheng
67212a05e6 Call InsertISelMapEntry rather than map insertion operator to prevent overly
aggrssive inlining. This reduces Select_store frame size from 24k to 10k.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26095 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-09 22:12:27 +00:00
Evan Cheng
d7805a741d Match getTargetNode() changes (now returns SDNode* instead of SDOperand).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26084 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-09 07:16:09 +00:00
Evan Cheng
34167215a8 Change Select() from
SDOperand Select(SDOperand N);
to
void Select(SDOperand &Result, SDOperand N);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26067 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-09 00:37:58 +00:00
Evan Cheng
3468864f08 Added options -cflag, -cxxflags, and -ldflags to override the default C
compilation, C++ compilation, and linker options.
e.g. This is the options I use for testing on my x86 iMac:
nice ./NightlyTest.pl -release -cflags "-Os -DNDEBUG -fomit-frame-pointer" -cxxflags "-Os -DNDEBUG -finline-functions -felide-constructors -fomit-frame-pointer"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26057 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-08 09:08:06 +00:00
Evan Cheng
917707a73f Remove -pedantic. It no longer works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26055 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-08 07:28:22 +00:00
Evan Cheng
21ad392ee6 Hoist all SDOperand declarations within a Select_{opcode}() to the top level
to reduce stack memory usage. This is intended to work around the gcc bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26026 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-07 00:37:41 +00:00
Chris Lattner
04cadb3684 Add support for modifier strings in machine instr descriptions. This allows
us to avoid creating lots of "Operand" types with different printers, instead
we can fold several together and use modifiers.  For example, we can now use:

${target:call} to say that the operand should be printed like a 'call' operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26024 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 23:40:48 +00:00
Chris Lattner
b03b080a82 Simplify the variant handling code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26023 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 22:43:28 +00:00
Evan Cheng
7cd19d038f At the end of isel, select a replacement node for each handle that does not
have one. This can happen if a load's real uses are dead (i.e. they do not
have uses themselves).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26014 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 08:12:55 +00:00
Evan Cheng
024524fe9b Name change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26013 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 06:03:35 +00:00
Evan Cheng
0a83ed506c Handle HANDLENODE: just return itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26011 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-05 08:46:14 +00:00
Evan Cheng
e41bf82107 Allow more loads to be folded which were previously prevented from happening
due to ordering issue. i.e. they were selected for chain use first.
Now at load select time, check if it is being selected for a chain use and if
it has only a single real use. If so, return a HANDLENODE (with the load as
its operand) in its place and record it.
When it is folded or the load is selected for a real use, the isel records it
as the replacement for the HANDLENODE. The replacement is done when all nodes
are selected.
This scheme exposed a couple of problems where cycles can happen. (See comments
in EmitMatchCode() for descriptions of the problems and their workaround /
solutions.) These problems have been resolved with a small compile time
penality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25995 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-05 06:43:12 +00:00
Evan Cheng
2216d8ad2f Re-committing the last bit of change. It shouldn't break PPC this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25982 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-05 05:22:18 +00:00
Chris Lattner
9ed44818c5 Temporarily revert the last change, which breaks PPC and other targets that
DO select things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25970 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-04 09:23:06 +00:00
Evan Cheng
9c4815a036 Complex pattern's custom matcher should not call Select() on any operands.
Select them afterwards if it returns true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25968 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-04 08:50:49 +00:00
Chris Lattner
3e1798086b node predicates add to the complexity of a pattern. This ensures that the
X86 backend attempts to match small-immediate versions of instructions before
the full size immediate versions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25937 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-03 18:06:02 +00:00
Evan Cheng
e4a8a6e645 (store (op (load ...))) folding problem. In the generated matching code,
Chain is initially set to the chain operand of store node, when it reaches
load, if it matches the load then Chain is set to the chain operand of the
load.

However, if the matching code that follows this fails, isel moves on to the
next pattern but it does not restore Chain to the chain operand of the store.
So when it tries to match the next store / op / load pattern it would fail on
the Chain == load.getOperand(0) test.

The solution is for each chain operand to get a unique name. e.g. Chain10.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-03 06:22:41 +00:00
Chris Lattner
1cf9d961b2 add a note, ya knoe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25880 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 19:12:23 +00:00
Evan Cheng
657416cfba If a pattern's root node is a constant, its size should be 3 rather than 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25870 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 06:06:31 +00:00
Chris Lattner
d9aadd4d15 solaris won't clobber an existing symlink with ln -sf apparently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25849 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-31 16:10:53 +00:00
Chris Lattner
273d463bef implement test/Regression/TableGen/DagIntSubst.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25836 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-31 06:02:35 +00:00
Chris Lattner
7859313bae simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25791 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 20:01:35 +00:00
Andrew Lenharth
8e51773bb7 it is nice not to chop off bits for those blessed with lots of bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25766 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 05:22:37 +00:00
Andrew Lenharth
2cba57cb09 make the casts actually cast to the variable type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25765 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 05:17:22 +00:00
Andrew Lenharth
5c6bdf71d4 start of the 64bit safety cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25764 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 05:07:04 +00:00
Chris Lattner
24e00a4ac1 Emit series of conditionals with &&, emitting stuff like this:
if (N1.getOpcode() == ISD::LOAD &&
        N1.hasOneUse() &&
        !CodeGenMap.count(N1.getValue(0)) &&
        !CodeGenMap.count(N1.getValue(1))) {

instead of this:

    if (N1.getOpcode() == ISD::LOAD) {
      if (N1.hasOneUse()) {
        if (!CodeGenMap.count(N1.getValue(0))) {
          if (!CodeGenMap.count(N1.getValue(1))) {


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25763 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 04:41:05 +00:00
Chris Lattner
8bc7472a0c Factor matching code that is common between patterns. This works around
GCC not jump-threading across this common code, and produces far nicer
output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25762 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 04:25:26 +00:00
Chris Lattner
2bd4dd7668 Split out code generation from analysis from emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 02:57:39 +00:00
Chris Lattner
355408bcb7 move some code around, no change in the generated code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 02:43:35 +00:00
Chris Lattner
67a202bc42 now that we have control over emission of the code, emit the code using nested
"if" statements (indenting it appropriately, of course) instead of using goto's.

This inverts the logic for all of the if statements, which makes things simpler
to understand in addition to making the generated code easier to read.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25757 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 20:43:52 +00:00
Chris Lattner
8a0604b523 Change PatternCodeEmitter to emit code into a buffer instead of emitting it
directly to the output file.  This makes things simple because the code doesn't
have to worry about indentation or the case when there is no goto.  It also
allows us to indent the code better without touching everything :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25756 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 20:31:24 +00:00
Reid Spencer
24200d63fd Make long warnings wrap and have less indent so other portions of the page
are not skewed out of view.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 19:44:48 +00:00
Chris Lattner
488580c1ed Fit to 80 columns, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25752 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-28 19:06:51 +00:00
Jeff Cohen
9b0ffca478 Teach tablegen to generate code that is VC++ warning-free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 22:22:28 +00:00
Evan Cheng
c15d18c501 (store (op (load ...)), ...)
If store's chain operand is load, then use load's chain operand instead. If
it isn't (likely a TokenFactor), then do not allow the folding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25708 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 22:13:45 +00:00
Evan Cheng
19c9550744 Subtarget feature can now set any variable to any value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25678 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 08:09:42 +00:00
Chris Lattner
0cfcc1e807 Use printInlineAsm to, well, print inline asm's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25677 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 02:10:50 +00:00
Chris Lattner
aa77d77a43 PHI and INLINEASM are now builtin instructions provided by Target.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25673 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 01:45:06 +00:00
Chris Lattner
f52e2618f3 If we want to emit things in enum order, use getInstructionsByEnumValue to
get the order, don't compute it ourselves.

Don't emit stuff like (14<<0), emit 14 instead.

Don't attempt to get target properties for builtin instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25672 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 01:44:09 +00:00
Chris Lattner
387e4bdf00 There is at least a 'noitinerary' itinerary now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25671 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 01:41:55 +00:00
Chris Lattner
188454ae2b Don't emit JIT code for these instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25669 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 01:39:38 +00:00
Chris Lattner
fabcb7abc5 Teach the dag selectors to select InlineAsm nodes.
Aren't we happy the pattern selectors are almost all gone?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25666 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 23:08:55 +00:00
Evan Cheng
1feeeecf4c Another folding problem: if a node r/w chain or flag, don't fold it if it
has already been selected. The number of use check is not strong enough since
a node can be replaced with newly created target node. e.g. If the original
node has two uses, when it is selected for one of the uses it is replaced with
another. Each node now has a single use but isel still should not fold it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25651 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 19:13:45 +00:00
Evan Cheng
8eab3608de Add a FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25635 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 02:13:31 +00:00
Evan Cheng
545977371a Incoming (and optional) flag bugs. They may be embedded inside a inner node of
a pattern. Also, nodes which take incoming flag should not be folded if it has
more than one use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25627 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 00:22:25 +00:00
Evan Cheng
9789aaad63 Fix an optional in flag bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25590 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 20:46:50 +00:00
Evan Cheng
18667c4545 Optional InFlag was not being included in node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25588 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 20:07:38 +00:00
Evan Cheng
76356d9594 Prevent folding of a node with multiple uses if the node already folds a load!
Here is an example where the load ended up being done twice:

%A = global uint 0

uint %test(uint %B, ubyte %C) {
	%tmp = load uint *%A;
	%X = shl uint %tmp, ubyte %C
	%Cv = sub ubyte 32, %C
	%Y = shr uint %B, ubyte %Cv
	%Z = or uint %Y, %X
	store uint %Z, uint* %A
	ret uint %Z
}

==>

	subl $4, %esp
	movl %ebx, (%esp)
	movl 8(%esp), %edx
	movl A, %eax
	movb 12(%esp), %bl
	movb %bl, %cl
	shldl %cl, %edx, %eax
	movb %bl, %cl
	shldl %cl, %edx, A
	movl (%esp), %ebx
	addl $4, %esp
	ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-20 01:11:03 +00:00
Chris Lattner
485a350bed Don't include generated lexer .cpp files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25466 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 22:01:51 +00:00
Evan Cheng
823b752d75 Bug fix. Flag operand number may be calculated incorrectly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25465 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 21:57:10 +00:00
Evan Cheng
7419de89fb Use pattern information to determine whether the use expects this
instruction to produce a result. e.g MUL8m, the instruction does not
produce a explicit result. However it produces an implicit result in
AL which would be copied to a temp. The root operator of the matching
pattern is a mul so the use would expect it to produce a result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25458 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 10:12:58 +00:00
Evan Cheng
b4ad33c4ae Prevent unnecessary CopyToReg when the same HW register appears in two spots
in the pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25437 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 01:55:45 +00:00
Chris Lattner
09fb7d4dad fix a broken comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25411 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 21:31:18 +00:00
John Criswell
d788124317 Regenerated the Lex and Yacc output files on Linux. It seems that our
Linux machines don't like the source code generated on MacOS X for some
reason.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25394 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 17:01:34 +00:00
Evan Cheng
57c517d30c Emit a type matching check for ComplexPatterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25392 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 07:36:41 +00:00
Evan Cheng
37e9005db3 Type inferencing bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25337 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-15 10:04:45 +00:00
Evan Cheng
f805c2ed7f Allow transformation from GlobalAddress to TargetGlobalAddress and
ExternalSymbol to TargetExternalSymbol.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25252 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-12 19:35:54 +00:00
Evan Cheng
bb48e33bcd GlobalAddress -> TargetGlobalAddress; ExternalSymbol -> TargetExternalSymbol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25245 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-12 07:54:57 +00:00
Evan Cheng
b2c6d4957a Some minor fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25227 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 22:16:13 +00:00
Chris Lattner
8020a5233c Always select target registers to themselves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25218 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 19:52:27 +00:00
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