1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

1436 Commits

Author SHA1 Message Date
Mikhail Glushenkov
9c0a984b65 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")

llvm-svn: 51748
2008-05-30 06:22:15 +00:00
Mikhail Glushenkov
8b0a6430e6 Small error message improvement.
llvm-svn: 51747
2008-05-30 06:21:48 +00:00
Mikhail Glushenkov
1ba3b7e1fa Remove RequireDefault parameter from EmitCaseConstructHandler.
There are now no situations when 'default' is required.

llvm-svn: 51746
2008-05-30 06:21:21 +00:00
Mikhail Glushenkov
64ec622f1d Fix some headers.
llvm-svn: 51745
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov
9f66c06b4e New tests for the 'case' expression: not_empty, in_language.
llvm-svn: 51744
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov
1abbaf5299 Make it possible to have multiple input languages for a single tool.
llvm-svn: 51742
2008-05-30 06:18:16 +00:00
Mikhail Glushenkov
aa7a46f0bd Better error reporting for the 'case' construct.
llvm-svn: 51738
2008-05-30 06:15:47 +00:00
Mikhail Glushenkov
e0bb150778 Do not generate empty 'if's for the output_suffix property.
llvm-svn: 51737
2008-05-30 06:15:20 +00:00
Mikhail Glushenkov
5c31024be9 Make it possible to use hooks like this: '$CALL(MyHook)/path/to/file'.
llvm-svn: 51734
2008-05-30 06:13:29 +00:00
Mikhail Glushenkov
c9f69ac2fe 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).

llvm-svn: 51733
2008-05-30 06:13:02 +00:00
Mikhail Glushenkov
7ded98d7b6 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).

llvm-svn: 51732
2008-05-30 06:12:24 +00:00
Mikhail Glushenkov
b879936694 Some small tweaks to make the generated code prettier.
llvm-svn: 51729
2008-05-30 06:10:47 +00:00
Mikhail Glushenkov
b81c3fc00f Make it possible to use the generalised 'case' construct in the cmd_line property.
llvm-svn: 51728
2008-05-30 06:10:19 +00:00
Mikhail Glushenkov
4f4ac7de01 Add a generalised 'case' construct.
Besides assigning edge weights, it will also be used by the cmd_line tool property.

llvm-svn: 51727
2008-05-30 06:08:50 +00:00
Dan Gohman
aa8fcd5657 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.

llvm-svn: 51706
2008-05-29 21:50:34 +00:00
Dan Gohman
4e87d82476 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 ;-).

llvm-svn: 51699
2008-05-29 19:57:41 +00:00
Bill Wendling
b56bc61cf4 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.

llvm-svn: 51660
2008-05-28 22:54:52 +00:00
Dan Gohman
19aa4b76fc Fix the spelling of the va_arg keyword.
llvm-svn: 51484
2008-05-23 17:11:55 +00:00
Dan Gohman
c7007dd0dc 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.

llvm-svn: 51468
2008-05-23 01:55:30 +00:00
Dan Gohman
c4181f29d4 Add a polygen grammar definition for LLVM assembly language.
llvm-svn: 51449
2008-05-22 22:45:03 +00:00
Roman Levenstein
7e3ffb268e 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.

llvm-svn: 51102
2008-05-14 10:17:11 +00:00
Mikhail Glushenkov
18508c5df4 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.

llvm-svn: 50973
2008-05-12 16:33:06 +00:00
Mikhail Glushenkov
ac930296dd Reapply 50867: A small refactoring (extract method) + some comment fixes.
Fixed the build breakage, sorry for that.

llvm-svn: 50895
2008-05-09 08:27:26 +00:00
Tanya Lattner
56baa19bfb Revertin 50867 since it was breaking the build.
llvm-svn: 50871
2008-05-08 21:54:20 +00:00
Mikhail Glushenkov
49359aa3b3 A small refactoring (extract method) + some comment fixes.
llvm-svn: 50867
2008-05-08 20:02:03 +00:00
Mikhail Glushenkov
7e401e5002 Use Doxygen-style comments.
llvm-svn: 50833
2008-05-07 21:50:19 +00:00
Mikhail Glushenkov
b2547a6c28 Change from llvm::SmallSet<std::string> to llvm::StringMap<char>.
llvm-svn: 50766
2008-05-06 18:18:58 +00:00
Mikhail Glushenkov
24d085fee4 Add new edge property combinator: weight.
llvm-svn: 50765
2008-05-06 18:18:20 +00:00
Mikhail Glushenkov
3534026221 Use edge weights to choose the right linker based on input language names.
llvm-svn: 50759
2008-05-06 18:15:12 +00:00
Mikhail Glushenkov
7ea1b7e206 Add weights to graph edges. Choose between edges based on their weight.
llvm-svn: 50757
2008-05-06 18:14:24 +00:00
Mikhail Glushenkov
e2005cb90d Remove the UnpackValues() function.
llvm-svn: 50756
2008-05-06 18:13:45 +00:00
Mikhail Glushenkov
78aa308f84 Add a --linker command-line option, make all tests pass.
llvm-svn: 50755
2008-05-06 18:13:00 +00:00
Mikhail Glushenkov
89e32fbe59 Naming fix: LLVMCCConfigurationEmitter -> LLVMCConfigurationEmitter.
llvm-svn: 50754
2008-05-06 18:12:03 +00:00
Mikhail Glushenkov
c586c41085 Rename LLVMCCConfigurationEmitter to LLVMCConfigurationEmitter
llvm-svn: 50748
2008-05-06 18:09:29 +00:00
Mikhail Glushenkov
b70916c93f Add output redirection, rename namespace llvmcc to namespace llvmc.
llvm-svn: 50746
2008-05-06 18:08:59 +00:00
Mikhail Glushenkov
839e3445a1 Small output formatting fix.
llvm-svn: 50739
2008-05-06 17:27:15 +00:00
Mikhail Glushenkov
68908552ae Add inward edge counters to Nodes; Associate JoinLists with JoinTools.
llvm-svn: 50738
2008-05-06 17:26:53 +00:00
Mikhail Glushenkov
c00f149f81 Return const char* instead of std::string in Tool classes
llvm-svn: 50733
2008-05-06 17:24:26 +00:00
Mikhail Glushenkov
3895684d84 Refactoring: extract method.
llvm-svn: 50731
2008-05-06 17:23:14 +00:00
Mikhail Glushenkov
2ad807d5fe Add new edge properties: parameter_equals, element_in_list, and.
llvm-svn: 50730
2008-05-06 17:22:47 +00:00
Mikhail Glushenkov
00b7a3bfb5 Implemented switch_on edge property.
llvm-svn: 50729
2008-05-06 17:22:03 +00:00
Mikhail Glushenkov
689a173ed2 More work on edge properties. Use Edge classes instead of strings in CompilationGraph.
llvm-svn: 50726
2008-05-06 16:36:50 +00:00
Mikhail Glushenkov
10283528ca Ongoing work: add an edge typechecker, rudimentary support for edge properties.
llvm-svn: 50725
2008-05-06 16:36:06 +00:00
Mikhail Glushenkov
72590c9cc7 Convert internal representation to use DAG. This gives us more flexibility and enables future improvements.
llvm-svn: 50724
2008-05-06 16:35:25 +00:00
Mikhail Glushenkov
de53f4ce11 Code reorg
llvm-svn: 50722
2008-05-06 16:34:12 +00:00
Bill Wendling
8767148326 Remove tar ball from installed directory.
llvm-svn: 50717
2008-05-06 08:33:07 +00:00
Bill Wendling
2e2dab8423 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!

llvm-svn: 50319
2008-04-27 09:44:10 +00:00
Bill Wendling
b9b4f72a9a Apple GCC 4.2 builds things differently. It no longer spawns a bunch of
processes, but requires the project to use -j.

llvm-svn: 49744
2008-04-15 21:33:52 +00:00
Chuck Rose III
fbfb612c4e 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.
llvm-svn: 49743
2008-04-15 21:27:11 +00:00
Evan Cheng
cff9295e43 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).
llvm-svn: 49714
2008-04-15 07:56:03 +00:00
Bill Wendling
4a514d9633 Install into the directory
llvm-svn: 49713
2008-04-15 07:02:59 +00:00
Devang Patel
13b2e01d4a Change llvm tools install location.
llvm-svn: 49540
2008-04-11 17:45:39 +00:00
Chris Lattner
da0c256cab produce an error on invalid input instead of asserting:
def : Pat<((v2f64 (vector_shuffle immAllZerosV_bc,
           ^

llvm-svn: 49462
2008-04-10 04:48:34 +00:00
Nate Begeman
41d0309ce8 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.

llvm-svn: 49433
2008-04-09 16:24:11 +00:00
Chris Lattner
a8d3c512dd Fix generation of multi-stage instruction itineraries. Patch by
giuma.cordes@gmail.com

llvm-svn: 49276
2008-04-06 17:38:14 +00:00
Dan Gohman
214b27286d 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.

llvm-svn: 49123
2008-04-03 00:02:49 +00:00
Anton Korobeynikov
d3330dfbf6 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.

llvm-svn: 49079
2008-04-02 05:23:57 +00:00
Chris Lattner
d141d16ed7 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.

llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Bill Wendling
6d6d654acf Simplify the conversion from "0x" numbers to a single digit number.
llvm-svn: 48907
2008-03-28 06:22:23 +00:00
Mikhail Glushenkov
f3c45cf9d1 Fix build breakage on Windows with GCC 4.3. References bug #2176.
llvm-svn: 48874
2008-03-27 09:53:47 +00:00
Dan Gohman
2b96ce84aa Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Dan Gohman
22002efa15 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.

llvm-svn: 48800
2008-03-25 21:45:14 +00:00
Anton Korobeynikov
261bddcbeb 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.

llvm-svn: 48699
2008-03-23 08:57:20 +00:00
Bill Wendling
c66858e342 Don't strip things when we're doing a debug build.
llvm-svn: 48696
2008-03-22 21:57:15 +00:00
Duncan Sands
4153fc30c9 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.

llvm-svn: 48640
2008-03-21 09:14:45 +00:00
Chris Lattner
6c4486c5c7 detabify llvm, patch by Mike Stump!
llvm-svn: 48577
2008-03-20 01:22:40 +00:00
Nate Begeman
d782b76546 Add support for escaping {} in asm strings, based on patch from Nick Burns.
llvm-svn: 48450
2008-03-17 07:26:14 +00:00
Christopher Lamb
b4f4b41048 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.
llvm-svn: 48412
2008-03-16 03:12:01 +00:00
Evan Cheng
9af68f56c5 Remove isImplicitDef TargetInstrDesc flag.
llvm-svn: 48381
2008-03-15 00:19:36 +00:00
Evan Cheng
11d2c09adc Replace all target specific implicit def instructions with a target independent one: TargetInstrInfo::IMPLICIT_DEF.
llvm-svn: 48380
2008-03-15 00:03:38 +00:00
Christopher Lamb
0f1c32eb63 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.
llvm-svn: 48329
2008-03-13 05:47:01 +00:00
Christopher Lamb
97376d2df6 Recommitting changes after more testing. These appear to cause no problems.
llvm-svn: 48222
2008-03-11 09:33:47 +00:00
Chris Lattner
edd8cdcddb emit an ID # for each regclass ID. Chris doesn't like to have to count.
llvm-svn: 48200
2008-03-11 00:00:23 +00:00
Evan Cheng
067ecbc341 Revert 48125, 48126, and 48130 for now to unbreak some x86-64 tests.
llvm-svn: 48167
2008-03-10 19:31:26 +00:00
Tanya Lattner
8be5e14a70 Add nosubmit option to control what is sent back to the results server.
Patch by Joachim Durchholz. Thanks!

llvm-svn: 48139
2008-03-10 07:28:08 +00:00
Christopher Lamb
c1e184122a Revert accidentally committed local changes.
llvm-svn: 48126
2008-03-10 04:16:09 +00:00
Christopher Lamb
3d7bb6ec01 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!
llvm-svn: 48125
2008-03-10 04:13:41 +00:00
Dale Johannesen
e6b0009792 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.)

llvm-svn: 48122
2008-03-10 02:17:22 +00:00
Scott Michel
15cc6fabaf 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.

llvm-svn: 47950
2008-03-05 17:49:05 +00:00
Nick Kledzik
4d9197c9b6 install new lto dylib. pass down LLVM_SUBMIT_VERSION
llvm-svn: 47763
2008-02-29 19:32:13 +00:00
Nick Kledzik
03a1d4f4d7 fix default RC_ProjectSourceSubversion to be zero
llvm-svn: 47761
2008-02-29 19:30:23 +00:00
Bill Wendling
8fb166bf6c Rename PrintableName to Name.
llvm-svn: 47629
2008-02-26 21:47:57 +00:00
Bill Wendling
50f5c4be14 Change "Name" to "AsmName" in the target register info. Gee, a refactoring tool
would have been a Godsend here!

llvm-svn: 47625
2008-02-26 21:11:01 +00:00
Bill Wendling
a2fedd7d9c De-tabify.
llvm-svn: 47595
2008-02-26 10:45:29 +00:00
Bill Wendling
a369a6add8 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.

llvm-svn: 47534
2008-02-24 00:56:13 +00:00
Anton Korobeynikov
0c5e186924 Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
llvm-svn: 47367
2008-02-20 11:08:44 +00:00
Scott Michel
3ad0263173 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.

llvm-svn: 47188
2008-02-15 23:05:48 +00:00
Dale Johannesen
6cb8a628a2 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.

llvm-svn: 47143
2008-02-14 23:35:16 +00:00
Nate Begeman
1ef1013b6c 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.

llvm-svn: 47121
2008-02-14 08:57:00 +00:00
Devang Patel
1f8de09109 Remove dead code.
llvm-svn: 47012
2008-02-12 18:20:50 +00:00
Dan Gohman
cabaec582f Rename MRegisterInfo to TargetRegisterInfo.
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Nate Begeman
336fba2146 Tablegen support for insert & extract element matching
llvm-svn: 46901
2008-02-09 01:37:05 +00:00
Dan Gohman
f00842e086 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.

llvm-svn: 46827
2008-02-06 22:27:42 +00:00
Evan Cheng
851d353eb8 Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.
llvm-svn: 46776
2008-02-05 22:50:29 +00:00
Evan Cheng
1c67dcaae7 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.
llvm-svn: 46724
2008-02-04 23:06:48 +00:00
Chris Lattner
6ea106139d 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.

llvm-svn: 46677
2008-02-03 06:49:24 +00:00
Evan Cheng
f61d1115af Get rid of the annoying blank lines before labels.
llvm-svn: 46667
2008-02-02 08:39:46 +00:00
Evan Cheng
c57ec111f2 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.

llvm-svn: 46659
2008-02-02 04:07:54 +00:00
Evan Cheng
2a533e6894 Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
llvm-svn: 46623
2008-01-31 21:00:00 +00:00
Evan Cheng
705212577d Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.
llvm-svn: 46609
2008-01-31 09:59:15 +00:00