Commit Graph

1627 Commits

Author SHA1 Message Date
Mikhail Glushenkov
34f376281f Fix: 'sink' handling was broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:23:29 +00:00
Mikhail Glushenkov
6be4ffc7c3 Add support for option aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:22:52 +00:00
Mikhail Glushenkov
2d0dc9ab44 Allow nesting of case expressions.
The following is now legal:

    (case (in_language "c"),
          (case (switch_on "E"), "gcc -x c -E $INFILE", (default), "gcc -x c $INFILE"),
          (default),
          "gcc $INFILE $OUTFILE")


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:22:15 +00:00
Mikhail Glushenkov
4fb71eae48 Small error message improvement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:21:48 +00:00
Mikhail Glushenkov
708e7c29bc Remove RequireDefault parameter from EmitCaseConstructHandler.
There are now no situations when 'default' is required.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:21:21 +00:00
Mikhail Glushenkov
fb37f39111 Fix some headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov
2e73e851d8 New tests for the 'case' expression: not_empty, in_language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov
ffcf3a1a69 Make it possible to have multiple input languages for a single tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:18:16 +00:00
Mikhail Glushenkov
cb64f4be3a Better error reporting for the 'case' construct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51738 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:15:47 +00:00
Mikhail Glushenkov
37f509a70c Do not generate empty 'if's for the output_suffix property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51737 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:15:20 +00:00
Mikhail Glushenkov
2242456da5 Make it possible to use hooks like this: '$CALL(MyHook)/path/to/file'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:13:29 +00:00
Mikhail Glushenkov
5c7578de08 Make it possible to change the output file suffix based on command-line options.
For instance, the following command:

    llvmc2 -E hello.c

now generates a file with the correct suffix (hello.i).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51733 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:13:02 +00:00
Mikhail Glushenkov
08bd2e74dc Add support for user-provided hooks and environment variable reads to the cmd_line tool property.
Used like this: (cmd_line "$CALL(MyHook) --option -o $ENV(VARIABLE) $CALL(AnotherHook)")
Also works with case expressions.

Hook declarations are auto-generated, the definitions should be provided by the user
(just drop a .cpp file in the tools/llvmc2 directory).

Hooks should live in the "hooks" namespace and have type std::string hooks::Hook(void).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:12:24 +00:00
Mikhail Glushenkov
14ec27fff1 Some small tweaks to make the generated code prettier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51729 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:10:47 +00:00
Mikhail Glushenkov
b5ccfbf0a9 Make it possible to use the generalised 'case' construct in the cmd_line property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51728 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:10:19 +00:00
Mikhail Glushenkov
e5557f4da4 Add a generalised 'case' construct.
Besides assigning edge weights, it will also be used by the cmd_line tool property.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:08:50 +00:00
Dan Gohman
b4106170dd Add patterns for CALL32m and CALL64m. They aren't matched in most
cases due to an isel deficiency already noted in
lib/Target/X86/README.txt, but they can be matched in this fold-call.ll
testcase, for example.

This is interesting mainly because it exposes a tricky tblgen bug;
tblgen was incorrectly computing the starting index for variable_ops
in the case of a complex pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:50:34 +00:00
Dan Gohman
d35121ad00 Fix a tblgen problem handling variable_ops in tblgen instruction
definitions. This adds a new construct, "discard", for indicating
that a named node in the input matching pattern is to be discarded,
instead of corresponding to a node in the output pattern. This
allows tblgen to know where the arguments for the varaible_ops are
supposed to begin.

This fixes "rdar://5791600", whatever that is ;-).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 19:57:41 +00:00
Bill Wendling
8370d38ade Add a flag to indicate that an instruction is as cheap (or cheaper) than a move
instruction to execute. This can be used for transformations (like two-address
conversion) to remat an instruction instead of generating a "move"
instruction. The idea is to decrease the live ranges and register pressure and
all that jazz.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-28 22:54:52 +00:00
Dan Gohman
b737a64a85 Fix the spelling of the va_arg keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 17:11:55 +00:00
Dan Gohman
e4977cf750 Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:55:30 +00:00
Dan Gohman
890c31cfcc Add a polygen grammar definition for LLVM assembly language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 22:45:03 +00:00
Roman Levenstein
6422e8aa1c Do not generate by TableGen the hard-coded standard, target-independent part of
DAG instruction selectors. Introudce a dedicated header file for this part:
include/llvm/CodeGen/DAGISelHeader.h

TableGen now only generates the include preprocessor directive to include this
new header.

This is a preparation for supporting multiple implementations of instruction
selectors in the future.

Reviewed and approved by Evan and Dan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 10:17:11 +00:00
Mikhail Glushenkov
5c98d824f6 Filter option names to escape symbols not allowed as C++ identifiers.
Makes it possible to use options with names like "Wa,".
Also fixes the -Wall option handling as a side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:33:06 +00:00
Mikhail Glushenkov
8e7254cd44 Reapply 50867: A small refactoring (extract method) + some comment fixes.
Fixed the build breakage, sorry for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 08:27:26 +00:00
Tanya Lattner
0561f78a14 Revertin 50867 since it was breaking the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 21:54:20 +00:00
Mikhail Glushenkov
21607fa63c A small refactoring (extract method) + some comment fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 20:02:03 +00:00
Mikhail Glushenkov
4561ab5d81 Use Doxygen-style comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 21:50:19 +00:00
Mikhail Glushenkov
e0ff9ae91e Change from llvm::SmallSet<std::string> to llvm::StringMap<char>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:18:58 +00:00
Mikhail Glushenkov
29063554d0 Add new edge property combinator: weight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:18:20 +00:00
Mikhail Glushenkov
76b1b24dc8 Use edge weights to choose the right linker based on input language names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:15:12 +00:00
Mikhail Glushenkov
bb8b58dcf3 Add weights to graph edges. Choose between edges based on their weight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:14:24 +00:00
Mikhail Glushenkov
d83038c960 Remove the UnpackValues() function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:13:45 +00:00
Mikhail Glushenkov
978d498e40 Add a --linker command-line option, make all tests pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:13:00 +00:00
Mikhail Glushenkov
895820da24 Naming fix: LLVMCCConfigurationEmitter -> LLVMCConfigurationEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:12:03 +00:00
Mikhail Glushenkov
ecbdcf2ae0 Rename LLVMCCConfigurationEmitter to LLVMCConfigurationEmitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:09:29 +00:00
Mikhail Glushenkov
be9d9a153f Add output redirection, rename namespace llvmcc to namespace llvmc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 18:08:59 +00:00
Mikhail Glushenkov
ee628d93aa Small output formatting fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50739 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 17:27:15 +00:00
Mikhail Glushenkov
c74bfc946d Add inward edge counters to Nodes; Associate JoinLists with JoinTools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50738 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 17:26:53 +00:00
Mikhail Glushenkov
b96cb60827 Return const char* instead of std::string in Tool classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50733 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 17:24:26 +00:00
Mikhail Glushenkov
9ef501b120 Refactoring: extract method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 17:23:14 +00:00
Mikhail Glushenkov
64683edb4d Add new edge properties: parameter_equals, element_in_list, and.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 17:22:47 +00:00
Mikhail Glushenkov
581936a99c Implemented switch_on edge property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50729 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 17:22:03 +00:00
Mikhail Glushenkov
d752c3ffd8 More work on edge properties. Use Edge classes instead of strings in CompilationGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 16:36:50 +00:00
Mikhail Glushenkov
0a174930e2 Ongoing work: add an edge typechecker, rudimentary support for edge properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 16:36:06 +00:00
Mikhail Glushenkov
0d08db0345 Convert internal representation to use DAG. This gives us more flexibility and enables future improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50724 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 16:35:25 +00:00
Mikhail Glushenkov
b90cd834ca Code reorg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50722 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 16:34:12 +00:00
Bill Wendling
1f85129eb7 Remove tar ball from installed directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 08:33:07 +00:00
Bill Wendling
908865d90f Added support for:
- defm and multiclass
- imbricatable multiline C style comment
- FIXME/TODO highlight in comment
- binary and hexadecimal number
- code using [{ }] is no highlighted as special (perhaps not the best
choice)
Patch by Cedric Venet!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 09:44:10 +00:00
Bill Wendling
ff140fa1f1 Apple GCC 4.2 builds things differently. It no longer spawns a bunch of
processes, but requires the project to use -j.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 21:33:52 +00:00
Chuck Rose III
cc51c31953 VisualStudio project files updated. #include <algorithm> added to make VisualStudio happy. Also had to undefine setjmp because of #include <csetjmp> turning setjmp into _setjmp in VisualStudio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49743 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 21:27:11 +00:00
Evan Cheng
8102703d70 Sort sub-registers and super-registers lists according to super-sub register relations. e.g. X86::RAX sub-register list is EAX, AX, AL, AH (order of last two are not guaranteed).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 07:56:03 +00:00
Bill Wendling
c373221a08 Install into the directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49713 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 07:02:59 +00:00
Devang Patel
6b893fced8 Change llvm tools install location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 17:45:39 +00:00
Chris Lattner
3dc2e96eec produce an error on invalid input instead of asserting:
def : Pat<((v2f64 (vector_shuffle immAllZerosV_bc,
           ^



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 04:48:34 +00:00
Nate Begeman
59d28132bc Fix a bug where an incorrect bit mask would be generated if a target's last asm
string began at a power of 2 in the string index.  For example, if "ret" started
at position 16, the ret instruction would be assigned code 16, but the mask would be AsmChars[] + Code & 15, not Code & 31.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 16:24:11 +00:00
Chris Lattner
d963ab1f58 Fix generation of multi-stage instruction itineraries. Patch by
giuma.cordes@gmail.com



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 17:38:14 +00:00
Dan Gohman
ee4fa1977d Move instruction flag inference out of InstrInfoEmitter and into
CodeGenDAGPatterns, where it can be used in other tablegen backends.
This allows the inference to be done for DAGISelEmitter so that it
gets accurate mayLoad/mayStore/isSimpleLoad flags. 

This brings MemOperand functionality back to where it was before
48329. However, it doesn't solve the problem of anonymous patterns
which expand to code that does loads or stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 00:02:49 +00:00
Anton Korobeynikov
67073f1cbd Add new CC lowering rule: provide a list of registers, which can be 'shadowed',
when some another register is used for argument passing.
Currently is used on Win64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49079 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 05:23:57 +00:00
Chris Lattner
038112a4e0 Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length.  All clients can produce a
null terminated name, and the system api's require null terminated 
strings anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 18:04:03 +00:00
Bill Wendling
1a76f00dde Simplify the conversion from "0x" numbers to a single digit number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 06:22:23 +00:00
Mikhail Glushenkov
3ee8402645 Fix build breakage on Windows with GCC 4.3. References bug #2176.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48874 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 09:53:47 +00:00
Dan Gohman
950a4c40b8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 22:06:05 +00:00
Dan Gohman
cfbb2f074d A quick nm audit turned up several fixed tables and objects that were
marked read-write. Use const so that they can be allocated in a
read-only segment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 21:45:14 +00:00
Anton Korobeynikov
ac67b7ea8f Add first proof-of-concept universal compiler driver framework based
on ideas mentioned in PR686.
Written by Mikhail Glushenkov and contributed by Codedgers, Inc.

Old llvmc will be removed soon after new one will have all its properties.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-23 08:57:20 +00:00
Bill Wendling
28ecd49e9b Don't strip things when we're doing a debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 21:57:15 +00:00
Duncan Sands
276dcbdc8d Introduce a new node for holding call argument
flags.  This is needed by the new legalize types
infrastructure which wants to expand the 64 bit
constants previously used to hold the flags on
32 bit machines.  There are two functional changes:
(1) in LowerArguments, if a parameter has the zext
attribute set then that is marked in the flags;
before it was being ignored; (2) PPC had some bogus
code for handling two word arguments when using the
ELF 32 ABI, which was hard to convert because of
the bogusness.  As suggested by the original author
(Nicolas Geoffray), I've disabled it for the moment.
Tested with "make check" and the Ada ACATS testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 09:14:45 +00:00
Chris Lattner
71a2cb25eb detabify llvm, patch by Mike Stump!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 01:22:40 +00:00
Nate Begeman
817affccd5 Add support for escaping {} in asm strings, based on patch from Nick Burns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 07:26:14 +00:00
Christopher Lamb
c929823525 Make insert_subreg a two-address instruction, vastly simplifying LowerSubregs pass. Add a new TII, subreg_to_reg, which is like insert_subreg except that it takes an immediate implicit value to insert into rather than a register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 03:12:01 +00:00
Evan Cheng
20ccded7de Remove isImplicitDef TargetInstrDesc flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48381 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 00:19:36 +00:00
Evan Cheng
da47e6e0d0 Replace all target specific implicit def instructions with a target independent one: TargetInstrInfo::IMPLICIT_DEF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 00:03:38 +00:00
Christopher Lamb
6634e26aa1 Get rid of a pseudo instruction and replace it with subreg based operation on real instructions, ridding the asm printers of the hack used to do this previously. In the process, update LowerSubregs to be careful about eliminating copies that have side affects.
Note: the coalescer will have to be careful about this too, when it starts coalescing insert_subreg nodes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 05:47:01 +00:00
Christopher Lamb
5b4153710e Recommitting changes after more testing. These appear to cause no problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48222 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 09:33:47 +00:00
Chris Lattner
ca796402be emit an ID # for each regclass ID. Chris doesn't like to have to count.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 00:00:23 +00:00
Evan Cheng
4499e495ea Revert 48125, 48126, and 48130 for now to unbreak some x86-64 tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48167 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 19:31:26 +00:00
Tanya Lattner
c161188703 Add nosubmit option to control what is sent back to the results server.
Patch by Joachim Durchholz. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 07:28:08 +00:00
Christopher Lamb
02f693708d Revert accidentally committed local changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 04:16:09 +00:00
Christopher Lamb
620d741250 Add support in TableGen for unknown operands that infer their type from the pattern their used in. This will be used to allow insert/extract subreg patterns in .td files!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 04:13:41 +00:00
Dale Johannesen
b8cafe3427 Increase ISD::ParamFlags to 64 bits. Increase the ByValSize
field to 32 bits, thus enabling correct handling of ByVal
structs bigger than 0x1ffff.  Abstract interface a bit.
Fixes gcc.c-torture/execute/pr23135.c and 
gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing
on ppc32, quietly producing wrong code on x86-32.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 02:17:22 +00:00
Scott Michel
327d0651f8 This patch fixes a problem encountered by the CellSPU backend where variants
were being pruned in patterns where a variable was used more than once, e.g.:

  (or (and R32C:$rA, R32C:$rC), (and R32C:$rB, (not R32C:$rC)))

In this example, $rC is used more than once and is actually significant to
instruction selection pattern matching when commuted variants are produced.
This patch scans the pattern's clauses and collects the variables, creating
a set of variables that are used more than once. TreePatternNode::isIsomorphicTo()
also understands that multiply-used variables are significant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47950 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 17:49:05 +00:00
Nick Kledzik
02e4e173bf install new lto dylib. pass down LLVM_SUBMIT_VERSION
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 19:32:13 +00:00
Nick Kledzik
ddb84f5c97 fix default RC_ProjectSourceSubversion to be zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 19:30:23 +00:00
Bill Wendling
e6d088acc9 Rename PrintableName to Name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:47:57 +00:00
Bill Wendling
74ab84c31e Change "Name" to "AsmName" in the target register info. Gee, a refactoring tool
would have been a Godsend here!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:11:01 +00:00
Bill Wendling
27926af828 De-tabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 10:45:29 +00:00
Bill Wendling
181eb737b2 Some platforms use the same name for 32-bit and 64-bit registers (like
%r3 on PPC) in their ASM files. However, it's hard for humans to read
during debugging. Adding a new field to the register data that lets you
specify a different name to be printed than the one that goes into the
ASM file -- %x3 instead of %r3, for instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 00:56:13 +00:00
Anton Korobeynikov
ae9f3a3b7c Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:08:44 +00:00
Scott Michel
0123b7dcfa Make tblgen a little smarter about constants smaller than i32. Currently,
tblgen will complain if a sign-extended constant does not fit into a
data type smaller than i32, e.g., i16. This causes a problem when certain
hex constants are used, such as 0xff for byte masks or immediate xor
values.

tblgen will try the sign-extended value first and, if the sign extended
value would overflow, it tries to see if the unsigned value will fit.
Consequently, a software developer can now safely incant:

	(XORHIr16 R16C:$rA, 0xffff)

which is somewhat clearer and more informative than incanting:

	(XORHIr16 R16C:$rA, (i16 -1))

even if the two are bitwise equivalent.

Tblgen also outputs the 64-bit unsigned constant in the generated ISel code
when getTargetConstant() is invoked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47188 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 23:05:48 +00:00
Dale Johannesen
db01c8ba26 Rewrite tblgen handling of subtarget features so
it follows the order of the enum, not alphabetical.
The motivation is to make -mattr=+ssse3,+sse41
select SSE41 as it ought to.  Added "ignored"
enum values of 0 to PPC and SPU to avoid compiler
warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 23:35:16 +00:00
Nate Begeman
e179584f9b Change how FP immediates are handled.
1) ConstantFP is now expand by default
2) ConstantFP is not turned into TargetConstantFP during Legalize
   if it is legal.

This allows ConstantFP to be handled like Constant, allowing for 
targets that can encode FP immediates as MachineOperands.

As a bonus, fix up Itanium FP constants, which now correctly match,
and match more constants!  Hooray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 08:57:00 +00:00
Devang Patel
2be680481b Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47012 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12 18:20:50 +00:00
Dan Gohman
6f0d024a53 Rename MRegisterInfo to TargetRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 18:45:23 +00:00
Nate Begeman
b5af3344c1 Tablegen support for insert & extract element matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46901 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-09 01:37:05 +00:00
Dan Gohman
69de1932b3 Re-apply the memory operand changes, with a fix for the static
initializer problem, a minor tweak to the way the
DAGISelEmitter finds load/store nodes, and a renaming of the
new PseudoSourceValue objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 22:27:42 +00:00
Evan Cheng
a58891ff1e Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 22:50:29 +00:00
Evan Cheng
4e3f5a4e9c Dwarf requires variable entries to be in the source order. Right now, since we are recording variable information at isel time this means parameters would appear in the reverse order. The short term fix is to issue recordVariable() at asm printing time instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46724 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 23:06:48 +00:00
Chris Lattner
f8dc0617ba Change the 'global modification' APIs in SelectionDAG to take a new
DAGUpdateListener object pointer instead of just returning a vector 
of deleted nodes.  This makes the interfaces more efficient (no more
allocating a vector [at least a malloc], filling it in, then walking
it) and more clean.  This also allows the client to be notified of
nodes that are *changed* but not deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 06:49:24 +00:00
Evan Cheng
4eecdeb3fa Get rid of the annoying blank lines before labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 08:39:46 +00:00
Evan Cheng
a844bdeab3 SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 04:07:54 +00:00