Commit Graph

1564 Commits

Author SHA1 Message Date
Misha Brukman 80ba6b7732 We also removed gtest-all.cc from the distribution tarball.
llvm-svn: 61581
2009-01-02 15:28:00 +00:00
Misha Brukman bcf15388ab Original patch by Talin.
* Added the first LLVM unittest -- DenseMap.
* Updated mkpatch utility to include llvm/unittests dir
* Added top-level target "unittests" to run all unittests

llvm-svn: 61541
2009-01-01 02:24:48 +00:00
Misha Brukman 22df200727 * Removed gtest-all.cc; .cc files including other .cc files is weird
* Removed gtest_main.cc: we have our own main() elsewhere
* Simplified the Makefile as we don't need SOURCES

* Moved the internal header to gtest/internal/
* Simplified the Makefile to remove -I param to CPP.Flags

* Updated README.LLVM with all the steps I took to massage GTest to
  work in LLVM so far

llvm-svn: 61540
2009-01-01 02:05:43 +00:00
Misha Brukman 922e34993a Moved Google Test code up one directory so that we can use a standard LLVM
Makefile with it, without resorting to the use of VPATH.

Also added Makefiles at every level of the directory tree to properly recurse
to Google Test and build it as a library (original Makefiles by Talin).

llvm-svn: 61539
2009-01-01 01:29:44 +00:00
Misha Brukman c89aba332f Import of Google Test 1.2.1, with the non-essential bits removed.
Added a README.LLVM file to indicate which files and directories
were removed from the original source tarball.

llvm-svn: 61526
2008-12-31 17:34:06 +00:00
Dan Gohman f1fb65c747 Use dyn_cast intead of isa + cast in the generated DAGISel code. This
reduces the amount of code slightly when assertions are enabled.

llvm-svn: 61249
2008-12-19 18:13:39 +00:00
Mon P Wang a501640ffa Added support for vector widening.
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Mikhail Glushenkov cf029824e1 Fix typo in error message.
llvm-svn: 61191
2008-12-18 04:06:58 +00:00
Mikhail Glushenkov 5932d8c986 Some enhancements for the 'case' expression.
Add (error) and (empty).

llvm-svn: 61117
2008-12-17 02:47:01 +00:00
Bill Wendling 160a416fc0 Change so that buildit won't need a parent directory with only the build scripts in them.
llvm-svn: 61061
2008-12-16 00:42:25 +00:00
Mikhail Glushenkov e30a2820f6 Put Edge* classes into anonymous namespace.
Prevents conflicts between plugins.

llvm-svn: 60871
2008-12-11 10:34:18 +00:00
Mikhail Glushenkov 7f1bef5a55 Make 'extern' an option property.
Makes (forward) work better.

llvm-svn: 60667
2008-12-07 16:47:12 +00:00
Mikhail Glushenkov 4cc945da6e Better error message.
llvm-svn: 60664
2008-12-07 16:45:12 +00:00
Mikhail Glushenkov 395cb25ac7 Re-apply Cedric's changes.
Use B instead of Beg (for consistency), but NodeA and NodeB instead of A
and B.

llvm-svn: 60663
2008-12-07 16:44:47 +00:00
Mikhail Glushenkov 0d88271490 Try to guess when the auto-generated cl::Sink option should be marked 'extern'.
This would be much easier to do if the CommandLine library didn't use
global state. Global state is evil.

llvm-svn: 60659
2008-12-07 16:42:47 +00:00
Mikhail Glushenkov 35a46f808b Add a (progn)-like construct for (actions). Implemented as a DAG list.
llvm-svn: 60658
2008-12-07 16:42:22 +00:00
Mikhail Glushenkov 85467c71d2 Use (actions) instead of option properties, support external options.
Also includes a major refactoring. See documentation for more
information.

llvm-svn: 60656
2008-12-07 16:41:11 +00:00
Cedric Venet af333378c9 The use of the construct:
for(Type1 B = ...;;) { Type2 B ; ... }
is bad: code is hard to read and VS VS don't like it (it ignore the second declaration of B).
This patch fix the problem in tablegen. Please don't write code like this. 

llvm-svn: 60590
2008-12-05 13:37:30 +00:00
Dan Gohman 69cc2cbbff Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.
llvm-svn: 60487
2008-12-03 18:15:48 +00:00
Dan Gohman cc78cdf275 Mark x86's V_SET0 and V_SETALLONES with isSimpleLoad, and teach X86's
foldMemoryOperand how to "fold" them, by converting them into constant-pool
loads. When they aren't folded, they use xorps/cmpeqd, but for example when
register pressure is high, they may now be folded as memory operands, which
reduces register pressure.

Also, mark V_SET0 isAsCheapAsAMove so that two-address-elimination will
remat it instead of copying zeros around (V_SETALLONES was already marked).

llvm-svn: 60461
2008-12-03 05:21:24 +00:00
Dan Gohman ae3ba45eb2 Add a sanity-check to tablegen to catch the case where isSimpleLoad
is set but mayLoad is not set. Fix all the problems this turned up.

Change code to not use isSimpleLoad instead of mayLoad unless it
really wants isSimpleLoad.

llvm-svn: 60459
2008-12-03 02:30:17 +00:00
Mikhail Glushenkov cc2d0b2c4c Support multiple compilation graph definitions. Not terribly useful, but makes the code more generic.
llvm-svn: 60199
2008-11-28 00:13:47 +00:00
Mikhail Glushenkov 3bb3da6f4c Add 'hidden' and 'really_hidden' option properties.
llvm-svn: 60198
2008-11-28 00:13:25 +00:00
Evan Cheng 83bdb38965 On x86 favors folding short immediate into some arithmetic operations (e.g. add, and, xor, etc.) because materializing an immediate in a register is expensive in turns of code size.
e.g.
movl 4(%esp), %eax
addl $4, %eax

is 2 bytes shorter than

movl $4, %eax
addl 4(%esp), %eax

llvm-svn: 60139
2008-11-27 00:49:46 +00:00
Mikhail Glushenkov 3ac10202c0 Small fix: the error message was incorrect in some cases.
llvm-svn: 60099
2008-11-26 10:55:45 +00:00
Bill Wendling 8d5b57b354 Copy the tblgen utility.
llvm-svn: 59681
2008-11-20 00:11:57 +00:00
Mikhail Glushenkov 20313c954e Support dependencies between plugins by priority-sorting.
llvm-svn: 59449
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov 7549d568d5 Filter ToolPropertiesList to exclude all Tools not mentioned in the compilation graph.
llvm-svn: 59448
2008-11-17 17:29:42 +00:00
Mikhail Glushenkov faae122e07 Add a layer of indirection to make plugins more flexible.
Use strings instead of TableGen defs in the compilation graph
definition. Makes it easier for the plugins to modify an existing graph.

llvm-svn: 59447
2008-11-17 17:29:18 +00:00
Bill Wendling c35325c698 Fix to record comparator to make it work for return values > 1.
llvm-svn: 59242
2008-11-13 12:03:00 +00:00
Bill Wendling 3d2667c8f3 Put comma in correct place for call to StructType::get
llvm-svn: 59241
2008-11-13 10:18:35 +00:00
Bill Wendling 9182147f17 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;

llvm-svn: 59237
2008-11-13 09:08:33 +00:00
Oscar Fuentes 38d6c9a817 Tell GenLibDeps.pl to inspect .so and .dylib shared files.
llvm-svn: 59158
2008-11-12 20:39:06 +00:00
Mikhail Glushenkov a2909684b6 Check the return value of std::getenv.
When constructing std::strings from C strings, we should check the input
value to be not NULL so that the std::string constructor does not
segfault.
Fixes #3047.

llvm-svn: 59131
2008-11-12 12:41:18 +00:00
Mikhail Glushenkov 1cb041242f Add a bit of lazy evaluation to PopulateCompilationGraph().
Only the tools that are mentioned in the compilation graph definition
are now inserted by PopulateCompilationGraph(). This should cut down
plugin loading time a little.

llvm-svn: 59097
2008-11-12 00:05:17 +00:00
Mikhail Glushenkov c1e7dbb1f7 Some cosmetic changes.
llvm-svn: 59096
2008-11-12 00:04:46 +00:00
Mikhail Glushenkov f5a294d08d Allow $CALL and $ENV in command names. Fixes #3025.
llvm-svn: 58922
2008-11-08 19:43:32 +00:00
Anton Korobeynikov 9278247502 Properly escape dashes in TableGen's LLVMC2 emitter.
Patch by Patrick Walton!

llvm-svn: 58901
2008-11-08 10:16:21 +00:00
Dan Gohman cc0d2cfa01 Make tablegen print out a nice error message for a const char*
exception, like it does for a std::string exception.

llvm-svn: 58865
2008-11-07 21:01:13 +00:00
Dan Gohman ce2417f4e1 Use an assert to check that SelectCode isn't called on
nodes that are already selected.

llvm-svn: 58763
2008-11-05 18:30:52 +00:00
Dan Gohman f14b77ebf1 Eliminate the ISel priority queue, which used the topological order for a
priority function. Instead, just iterate over the AllNodes list, which is
already in topological order. This eliminates a fair amount of bookkeeping,
and speeds up the isel phase by about 15% on many testcases.

The impact on most targets is that AddToISelQueue calls can be simply removed.

In the x86 target, there are two additional notable changes.

The rule-bending AND+SHIFT optimization in MatchAddress that creates new
pre-isel nodes during isel is now a little more verbose, but more robust.
Instead of either creating an invalid DAG or creating an invalid topological
sort, as it has historically done, it can now just insert the new nodes into
the node list at a position where they will be consistent with the topological
ordering.

Also, the address-matching code has logic that checked to see if a node was
"already selected". However, when a node is selected, it has all its uses
taken away via ReplaceAllUsesWith or equivalent, so it won't recieve any
further visits from MatchAddress. This code is now removed.

llvm-svn: 58748
2008-11-05 04:14:16 +00:00
Dan Gohman daca2240b1 Give tablegen's Type a destructor, to suppress spurious
"Type has virtual functions but non-virtual destructor"
warnings.

llvm-svn: 58710
2008-11-04 18:09:07 +00:00
Dan Gohman ade09cd9d3 Add some asserts to verify MVT invariant assumptions.
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Dan Gohman d7546abb8a Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.

llvm-svn: 58623
2008-11-03 17:56:27 +00:00
Dan Gohman 97acad13de Spell DISABLE_ASSERTIONS correctly.
llvm-svn: 58413
2008-10-30 01:08:03 +00:00
Bill Wendling 6e4ffba212 - Fix SUBVERSION string to handle x.x.x version number formats.
- Add VERBOSE=1 flag.
- Specify the LLVM_SUBMIT_VERSION when doing the "make install".
  The libLTO.dylib relies upon this flag during that time.

llvm-svn: 58298
2008-10-27 23:31:24 +00:00
David Greene ce2a938186 Have TableGen emit setSubgraphColor calls under control of a -gen-debug
flag.  Then in a debugger developers can set breakpoints at these calls
to see waht is about to be selected and what the resulting subgraph
looks like.  This really helps when debugging instruction selection.

llvm-svn: 58278
2008-10-27 21:56:29 +00:00
Cedric Venet 4e6ad3c12b Remove tabs from my previous commit.
llvm-svn: 58263
2008-10-27 19:21:35 +00:00
Matthijs Kooijman d470f73e2c Remove redundant word in tblgen error message.
llvm-svn: 58250
2008-10-27 15:59:43 +00:00
Cedric Venet 10a11f033c Add a default constructor to AsmWriterOperand to make VS2008sp1 happy. (AsmWriterOperand is used in a std::pair, and VS need to generate the default constructor of this pair).
llvm-svn: 58185
2008-10-26 15:40:44 +00:00