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

1777 Commits

Author SHA1 Message Date
Cedric Venet
48be6b5e15 Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Duncan Sands
5aeb9b727a Generalize some alias analysis logic from atomic
intrinsics to any IntrWriteArgMem intrinsics.

llvm-svn: 64551
2009-02-14 10:56:35 +00:00
Julien Lerouge
5d91210214 Fix MingW build: define GTEST_OS_WINDOWS if OS is MingW, but disable
exceptions.

llvm-svn: 64367
2009-02-12 08:02:35 +00:00
Bill Wendling
4ed3ee18ca Don't try to strip a file we just moved.
llvm-svn: 64263
2009-02-11 00:14:53 +00:00
Bill Wendling
f9d81f44cf Strip the LTO dylib.
llvm-svn: 64119
2009-02-09 06:42:40 +00:00
Bill Wendling
3f8a7a8f5d Small fix for the 'strip' command. Do a list of .so files.
llvm-svn: 64112
2009-02-09 04:01:11 +00:00
Evan Cheng
d040b30c1d Eliminate a 'control reaches end of non-void function' warning.
llvm-svn: 64111
2009-02-09 03:07:24 +00:00
Bill Wendling
d8f6731440 Don't run 'strip' on files that aren't there.
llvm-svn: 64108
2009-02-09 02:18:35 +00:00
Bill Wendling
0b9f8789a8 Remove warnings about not being able to delete something. Don't run lipo on gccas, gccld, and llvm-config scripts.
llvm-svn: 64107
2009-02-09 02:13:33 +00:00
Evan Cheng
a2b174e05c Revert 64023. make prefers GNUmakefile over makefile.
llvm-svn: 64024
2009-02-07 19:38:46 +00:00
Evan Cheng
65e85da5a1 Move Apple style build makefiles to the top level. Just like llvmgcc42.
llvm-svn: 64023
2009-02-07 19:05:24 +00:00
Dale Johannesen
e95c76b65e Get rid of one more non-DebugLoc getNode and
its corresponding getTargetNode.  Lots of
caller changes.

llvm-svn: 63904
2009-02-06 01:31:28 +00:00
Dale Johannesen
c96091a672 Remove a non-DebugLoc version of getNode.
llvm-svn: 63889
2009-02-05 22:07:54 +00:00
Mike Stump
ed6d4c396a FIx spelling.
llvm-svn: 63883
2009-02-05 20:49:49 +00:00
Mike Stump
1ffa350fcb Probe for flags before using them to try to help compiling with
compilers that don't support those flags.  This hopefully will help
gcc 3.X compile this code.  http://llvm.org/PR3487

llvm-svn: 63882
2009-02-05 20:45:27 +00:00
Dale Johannesen
fa28929927 Reapply 63765. Patches for clang and llvm-gcc to follow.
llvm-svn: 63812
2009-02-05 01:49:45 +00:00
Dale Johannesen
d27bc65e74 Remove non-DebugLoc forms of CopyToReg and CopyFromReg.
Adjust callers.

llvm-svn: 63789
2009-02-04 23:02:30 +00:00
Dale Johannesen
f6e1822ccd Reverting 63765. This broke the build of both clang
and llvm-gcc.

llvm-svn: 63786
2009-02-04 22:47:25 +00:00
Nate Begeman
66f10b55ed New feature: add support for target intrinsics being defined in the
target directories themselves.  This also means that VMCore no longer
needs to know about every target's list of intrinsics.  Future work
will include converting the PowerPC target to this interface as an
example implementation.

llvm-svn: 63765
2009-02-04 19:47:21 +00:00
Duncan Sands
cac6cf74f9 Fix PR3453 and probably a bunch of other potential
crashes or wrong code with codegen of large integers:
eliminate the legacy getIntegerVTBitMask and
getIntegerVTSignBit methods, which returned their
value as a uint64_t, so couldn't handle huge types.

llvm-svn: 63494
2009-02-01 18:06:53 +00:00
Bill Wendling
da5e35aa5f Explain why this is here.
llvm-svn: 63342
2009-01-29 23:19:43 +00:00
Bill Wendling
c65110ba7e - Add DebugLoc to getTargetNode().
- Modify TableGen to add the DebugLoc when calling getTargetNode.

(The light-weight wrappers are only temporary. The non-DebugLoc version will be
removed once the whole debug info stuff is finished with.)

llvm-svn: 63273
2009-01-29 05:27:31 +00:00
Dan Gohman
21a780e19c Move the code that starts printing the Select_* functions
after the code that sorts the patterns. This doesn't
affect the output, but it makes the code a little easier
to follow.

llvm-svn: 63265
2009-01-29 01:37:18 +00:00
Mikhail Glushenkov
cd3b13fc7b Typo.
llvm-svn: 63174
2009-01-28 03:47:58 +00:00
Mikhail Glushenkov
920118470d Add three new option properties.
Adds new option properties 'multi_val', 'one_or_more' and 'zero_or_one'.

llvm-svn: 63172
2009-01-28 03:47:20 +00:00
Evan Cheng
c971801ae1 Eliminate a couple of fields from TargetRegisterClass: SubRegClasses and SuperRegClasses. These are not necessary. Also eliminate getSubRegisterRegClass and getSuperRegisterRegClass. These are slow and their results can change if register file names change. Just use TargetLowering::getRegClassFor() to get the right TargetRegisterClass instead.
llvm-svn: 62762
2009-01-22 09:10:11 +00:00
Chris Lattner
fb1a7b3501 Make tblgen more portable, allowing it to build with ICC.
Patch by Robert Zeh!

llvm-svn: 62750
2009-01-22 05:10:16 +00:00
Dan Gohman
3d8c8dfe0e Fix a missing word.
llvm-svn: 62720
2009-01-21 21:54:44 +00:00
Dan Gohman
6c518dd2c6 Versions of VIM included with Intrepid and Leopard at least appear
to handle symlinks just fine, so reword the instructions in the
README accordingly.

llvm-svn: 62719
2009-01-21 21:52:42 +00:00
Dan Gohman
ef099b9d6c Enable syntax highlighting of LLVM and tablegen files by default,
so that users don't have to copy text from the README to get this.

llvm-svn: 62718
2009-01-21 21:47:51 +00:00
Dan Gohman
e9724624b7 Only set cindent for C and C++ source files.
llvm-svn: 62717
2009-01-21 21:30:25 +00:00
Mikhail Glushenkov
bf9e875d8e Change the hook API back to prevent memory leaks.
llvm-svn: 62686
2009-01-21 13:04:33 +00:00
Mikhail Glushenkov
9153777db7 Allow hooks with arguments.
llvm-svn: 62685
2009-01-21 13:04:00 +00:00
Dan Gohman
89103ff4d5 Avoid triggering an assertion failure when an instruction pattern
is a leaf node. Patch by Brandner!

llvm-svn: 62361
2009-01-16 21:30:55 +00:00
Dan Gohman
1810c6366d Add support for instructions with multiple ComplexPatterns, by
adding more information to the temporary variables names so that
they don't conflict.

llvm-svn: 62296
2009-01-16 02:05:52 +00:00
Duncan Sands
bcdbfb63dc Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Chris Lattner
ed4ee47a0d make tblgen autogenerate the nocapture intrinsics for
llvm.memcpy/memset/memmove.  This allows removal of some 
hackish code from basicaa.

llvm-svn: 62071
2009-01-12 02:41:37 +00:00
Chris Lattner
c26f718218 add scaffolding to emit argument attributes. No functionality
change.

llvm-svn: 62067
2009-01-12 01:27:55 +00:00
Chris Lattner
a844423a1b make tblgen emit the entire Intrinsic::getAttributes method,
not a random piece of it.  No functionality change.

llvm-svn: 62066
2009-01-12 01:18:58 +00:00
Chris Lattner
c31c59a3be add nocapture attribute to llvm.mem* intrinsics and have tblgen
parse them.  tblgen doesn't yet do anything with this info though.

llvm-svn: 62065
2009-01-12 01:12:03 +00:00
Misha Brukman
5837493db7 This has been replaced by llvm/utils/lint/cpp_lint.py, which is more
comprehensive and can support more complex style analysis.

llvm-svn: 62002
2009-01-09 19:46:41 +00:00
Chris Lattner
456f75a745 remove some exclusions that don't exist anymore.
llvm-svn: 61932
2009-01-08 19:02:03 +00:00
Misha Brukman
abc60e4b7d Use VIM's built-in shorthand for whitespace in regex.
llvm-svn: 61906
2009-01-08 02:17:30 +00:00
Misha Brukman
8399c15510 Be sure to ignore the end-of-line character when considering trailing
whitespace.

llvm-svn: 61905
2009-01-08 02:16:13 +00:00
Bob Wilson
98fdf706f7 Improve support for type-generic vector intrinsics by teaching TableGen how
to handle LLVMMatchType intrinsic parameters, and by adding new subclasses
of LLVMMatchType to match vector types with integral elements that are 
either twice as wide or half as wide as the elements of the matched type.

llvm-svn: 61834
2009-01-07 00:09:01 +00:00
Dan Gohman
8892b784d9 Fix a thinko in the grammar for thread_local variables.
llvm-svn: 61767
2009-01-05 23:03:03 +00:00
Dan Gohman
7934babf16 Delete an unused variable and simplify the code.
llvm-svn: 61732
2009-01-05 19:31:28 +00:00
Bob Wilson
50a8e4457d Handle iAny and fAny types in TreePatternNode::UpdateNodeType.
llvm-svn: 61713
2009-01-05 17:52:54 +00:00
Dan Gohman
8a7744e746 Add the keyword 'default'.
llvm-svn: 61710
2009-01-05 17:44:11 +00:00
Misha Brukman
e4ad02eac5 Renamed Google Test license file from COPYING to LICENSE.TXT to match LLVM
conventions, per John Criswell.

llvm-svn: 61708
2009-01-05 17:42:15 +00:00
Dan Gohman
b416e28d74 A few more polygen grammar updates.
- After GlobalAssign, emit addrspace before global/constant, to follow
   the new syntax.
 - Eliminate "type void", which is now invalid.
 - Fix invalid liblists like [, "foo"].
 - Tweak whitespace in a few places.

llvm-svn: 61706
2009-01-05 17:29:42 +00:00
Bob Wilson
265ddb0b65 Fix spelling in some comments.
llvm-svn: 61702
2009-01-05 17:23:09 +00:00
Dan Gohman
4a19de5ef2 gc is not an obsolete keyword.
llvm-svn: 61670
2009-01-05 03:22:02 +00:00
Dan Gohman
c290d0e596 Update polygen grammar for recent language changes.
llvm-svn: 61669
2009-01-05 03:21:23 +00:00
Dan Gohman
f378da5ac4 The .llx suffix is obsolete.
llvm-svn: 61647
2009-01-04 23:10:00 +00:00
Dan Gohman
aeecc94d42 Update VIM LLVM IR syntax highlighting.
- Add several new keywords
 - Clean up some obsolete keywords
 - Improve the patterns for constants.
 - Add syntax-highlighting for dejagnu test command comments

llvm-svn: 61646
2009-01-04 23:09:38 +00:00
Dan Gohman
7343641ae4 Set a few more vimrc indentation options.
llvm-svn: 61628
2009-01-04 18:59:55 +00:00
Dan Gohman
690954f68f Use softtabstop instead of redefining tabstop.
llvm-svn: 61618
2009-01-04 00:05:43 +00:00
Dan Gohman
7aee4c1d99 Switch the vimrc file from smartindent to cindent, which is
smarter about C-ish syntax, and supports the cinoptions
variable. Set cinoptions to suppress the extra indentation
for switch case labels.

llvm-svn: 61617
2009-01-04 00:03:54 +00:00
Misha Brukman
1969e75214 VerifyLineLength() actually takes a max length parameter.
llvm-svn: 61593
2009-01-02 21:24:29 +00:00
Misha Brukman
a0007f190a Added some basic lint tools for C++ and generic lint tool applicable to all
types of files (TableGen, LLVM assembly, HTML files, etc.)

llvm-svn: 61592
2009-01-02 21:15:30 +00:00
Misha Brukman
7bcf501c0e Deleted trailing whitespace; no functional changes.
llvm-svn: 61583
2009-01-02 16:28:18 +00:00
Misha Brukman
4d9a998dbc vimrc
* Fixed cursors in terminal by setting nocompatible (sorry, vi users)
* Enable syntax highlighting so that this file can stand on its own
* Highlight trailing whitespace
* Fixed commands to delete trailing whitespaces and convert tabs to spaces

llvm.vim and tablegen.vim
* Removed trailing whitespace, as it's now very visible

llvm-svn: 61582
2009-01-02 16:26:14 +00:00
Misha Brukman
247edadcb1 We also removed gtest-all.cc from the distribution tarball.
llvm-svn: 61581
2009-01-02 15:28:00 +00:00
Misha Brukman
3b9228c5ce 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
7ac554bb07 * 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
fb14f57734 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
1aecaaf274 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
84db870cc3 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
84ad2a383d Added support for vector widening.
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Mikhail Glushenkov
964b643cf8 Fix typo in error message.
llvm-svn: 61191
2008-12-18 04:06:58 +00:00
Mikhail Glushenkov
90baa08c2b Some enhancements for the 'case' expression.
Add (error) and (empty).

llvm-svn: 61117
2008-12-17 02:47:01 +00:00
Bill Wendling
efb04fd5a6 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
e50ddcc42a Put Edge* classes into anonymous namespace.
Prevents conflicts between plugins.

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

llvm-svn: 60667
2008-12-07 16:47:12 +00:00
Mikhail Glushenkov
e0c9f63882 Better error message.
llvm-svn: 60664
2008-12-07 16:45:12 +00:00
Mikhail Glushenkov
85098f0f90 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
4522fd9b8a 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
1348ac2185 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
f01331152a 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
c2986f3f3a 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
5dad0993a9 Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.
llvm-svn: 60487
2008-12-03 18:15:48 +00:00
Dan Gohman
ac6561793c 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
6333d48459 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
cd57fbc9c4 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
187b171022 Add 'hidden' and 'really_hidden' option properties.
llvm-svn: 60198
2008-11-28 00:13:25 +00:00
Evan Cheng
f18016728c 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
7534e81f38 Small fix: the error message was incorrect in some cases.
llvm-svn: 60099
2008-11-26 10:55:45 +00:00
Bill Wendling
023e8ff42c Copy the tblgen utility.
llvm-svn: 59681
2008-11-20 00:11:57 +00:00
Mikhail Glushenkov
0c4ad9c7cc Support dependencies between plugins by priority-sorting.
llvm-svn: 59449
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov
c44e8c9f2b 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
773924299a 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
9eaf125600 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
ab7198eb4b Put comma in correct place for call to StructType::get
llvm-svn: 59241
2008-11-13 10:18:35 +00:00
Bill Wendling
9dc2bd7973 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
ca51d6183a Tell GenLibDeps.pl to inspect .so and .dylib shared files.
llvm-svn: 59158
2008-11-12 20:39:06 +00:00
Mikhail Glushenkov
db3ab89624 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
3c568b376c 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
bb1a81c8e7 Some cosmetic changes.
llvm-svn: 59096
2008-11-12 00:04:46 +00:00
Mikhail Glushenkov
3e7723bbac Allow $CALL and $ENV in command names. Fixes #3025.
llvm-svn: 58922
2008-11-08 19:43:32 +00:00
Anton Korobeynikov
3f69727bd5 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
3a14e811be 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
022c4b719c 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
cd4b68bee9 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
171432bfe1 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
2dff90b025 Add some asserts to verify MVT invariant assumptions.
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Dan Gohman
edf3dc97c2 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
6f15274f7f Spell DISABLE_ASSERTIONS correctly.
llvm-svn: 58413
2008-10-30 01:08:03 +00:00
Bill Wendling
7ca989e778 - 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
93f9f0f718 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
cbdc9870d7 Remove tabs from my previous commit.
llvm-svn: 58263
2008-10-27 19:21:35 +00:00
Matthijs Kooijman
0e4cabbceb Remove redundant word in tblgen error message.
llvm-svn: 58250
2008-10-27 15:59:43 +00:00
Cedric Venet
f75bc692bb 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
Argyrios Kyrtzidis
f1de51fd9f Unbreak LLVM on the MSVC compiler:
-Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h
-Define strtoull

llvm-svn: 57970
2008-10-22 09:54:13 +00:00
Evan Cheng
e7afdb2a42 Add RCBarriers to TargetInstrDesc. It's a list of register classes the given instruction can "clobber". For example, on x86 the call instruction can modify all of the XMM and fp stack registers.
TableGen has been taught to generate the lists from instruction definitions.

llvm-svn: 57722
2008-10-17 21:00:09 +00:00
Dan Gohman
1641e5e794 Use INT64_C to emit constant values, to avoid problems with
constants that don't fit in an int. This fixes
"this decimal constant is unsigned only in ISO C90"
warnings.

llvm-svn: 57668
2008-10-17 04:40:39 +00:00
Dan Gohman
268cfea6bc Fun x86 encoding tricks: when adding an immediate value of 128,
use a SUB instruction instead of an ADD, because -128 can be
encoded in an 8-bit signed immediate field, while +128 can't be.
This avoids the need for a 32-bit immediate field in this case.

A similar optimization applies to 64-bit adds with 0x80000000,
with the 32-bit signed immediate field.

To support this, teach tablegen how to handle 64-bit constants.

llvm-svn: 57663
2008-10-17 01:33:43 +00:00
Dan Gohman
1bf4053aa8 Add support for having multiple predicates on a TreePatternNode.
This will allow predicates to be composed, which will allow the
predicate definitions to become less redundant, and eventually
will allow DAGISelEmitter.cpp to emit less redundant code.

llvm-svn: 57562
2008-10-15 06:17:21 +00:00
Duncan Sands
8f296a3788 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Devang Patel
25e8e5d528 Set UNIVERSAL_ARCH value.
Fixes build failure when target is i386.

llvm-svn: 57211
2008-10-06 21:24:48 +00:00
Chris Lattner
44997d0e3c Fix shift overflow bug that would occur when a field was a full 32-bits
in tblgen.  This is PR2827, thanks to Waldemar Knorr for tracking this
down.

llvm-svn: 57124
2008-10-05 18:31:58 +00:00
Chris Lattner
518ea108a1 Make GenLibDeps.pl more robust in the face of broken piping problems.
Patch by Kenneth Boyd!

llvm-svn: 57057
2008-10-04 18:03:46 +00:00
Dale Johannesen
dbd7b1bd33 Handle some 64-bit atomics on x86-32, some of the time.
llvm-svn: 56963
2008-10-02 18:53:47 +00:00
Dan Gohman
19530c810d Move the primary fast-isel top-level comments to FastISel.cpp, where
they'll be a little more visible. Also, update and reword them a bit.

llvm-svn: 56877
2008-09-30 20:48:29 +00:00
Dan Gohman
ac7d848c4b Move the code that handles DAGISel error conditions into
helper functions instead of duplicating it inline each time
it is needed. This eliminates a few hundred or so copies
of this code in each target.

llvm-svn: 56759
2008-09-27 23:53:14 +00:00
Dan Gohman
989db64c93 Rename ConstantSDNode's getSignExtended to getSExtValue, for
consistancy with ConstantInt, and re-implement it in terms
of ConstantInt's getSExtValue.

llvm-svn: 56700
2008-09-26 21:54:37 +00:00
Devang Patel
64dd7a2e89 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Mikhail Glushenkov
cf04ed88af Move llvmc2 header files under include/llvm/CompilerDriver
llvm-svn: 56466
2008-09-22 20:50:40 +00:00
Mikhail Glushenkov
3895eee874 Plugin support for llvmc2 (a-la opt).
llvm-svn: 56465
2008-09-22 20:49:34 +00:00
Mikhail Glushenkov
e412a69526 Make comments a little bit more clear.
llvm-svn: 56463
2008-09-22 20:48:22 +00:00
Mikhail Glushenkov
72e4c4e976 Get rid of GlobalLanguageMap. Global state is evil.
llvm-svn: 56462
2008-09-22 20:47:46 +00:00
Mikhail Glushenkov
7afbd753b7 Add a (forward_as) option property
llvm-svn: 56459
2008-09-22 20:46:19 +00:00
Mikhail Glushenkov
54297e6546 Delete the file llvmc2/doc/LLVMC-Enhancements.rst + some minor language/spelling fixes.
llvm-svn: 56458
2008-09-22 20:45:17 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Evan Cheng
b3923fd86f Add instruction names as comments to InstBits entries.
llvm-svn: 56275
2008-09-17 06:29:52 +00:00
Devang Patel
7267b480ef Remove.
llvm-svn: 56256
2008-09-16 22:26:44 +00:00
Bill Wendling
932818c75a Reverting r56249. On further investigation, this functionality isn't needed.
Apologies for the thrashing.

llvm-svn: 56251
2008-09-16 21:48:12 +00:00
Bill Wendling
1a240c8033 - Change "ExternalSymbolSDNode" to "SymbolSDNode".
- Add linkage to SymbolSDNode (default to external).
- Change ISD::ExternalSymbol to ISD::Symbol.
- Change ISD::TargetExternalSymbol to ISD::TargetSymbol

These changes pave the way to allowing SymbolSDNodes with non-external linkage.

llvm-svn: 56249
2008-09-16 21:12:30 +00:00
Devang Patel
b980f023ca Extract optimization pass selection code from llvm-gcc into a separate routine.
This can be used by other stand alone tools, such as 'opt'.

llvm-svn: 56229
2008-09-15 21:13:42 +00:00
Dan Gohman
cfe792b491 Update the LLVM polygen grammar for recent language changes:
x86_ssecallcc, function notes, and some whitespace adjustments.

llvm-svn: 56221
2008-09-15 16:10:51 +00:00
Dan Gohman
082879cfde Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
ConstantFP* instead of APInt and APFloat directly.

This reduces the amount of time to create ConstantSDNode
and ConstantFPSDNode nodes when ConstantInt* and ConstantFP*
respectively are already available, as is the case in
SelectionDAGBuild.cpp. Also, it reduces the amount of time
to legalize constants into constant pools, and the amount of
time to add ConstantFP operands to MachineInstrs, due to
eliminating ConstantInt::get and ConstantFP::get calls.

It increases the amount of work needed to create new constants
in cases where the client doesn't already have a ConstantInt*
or ConstantFP*, such as legalize expanding 64-bit integer constants
to 32-bit constants. And it adds a layer of indirection for the
accessor methods. But these appear to be outweight by the benefits
in most cases.

It will also make it easier to make ConstantSDNode and
ConstantFPNode more consistent with ConstantInt and ConstantFP.

llvm-svn: 56162
2008-09-12 18:08:03 +00:00
Dan Gohman
89660301e3 Rename ConstantSDNode::getValue to getZExtValue, for consistency
with ConstantInt. This led to fixing a bug in TargetLowering.cpp
using getValue instead of getAPIntValue.

llvm-svn: 56159
2008-09-12 16:56:44 +00:00
Evan Cheng
2d51d1299e Indentation.
llvm-svn: 56107
2008-09-11 17:31:12 +00:00
Jim Grosbach
f53af44e09 lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that 
way. TableGen sorts the records that will be used to create it by the names 
of the records, not the Name field of those records.

This patch corrects the sort to use the "Name" field of the record as the 
sort key.

llvm-svn: 56106
2008-09-11 17:05:32 +00:00
Evan Cheng
aebadcd733 Change getSubReg semantics. It now returns zero if the specified register doesn't have a subreg of the specified index.
llvm-svn: 56099
2008-09-11 06:25:25 +00:00
Dan Gohman
84924c9ceb Fix typos in (generated) comments.
llvm-svn: 55916
2008-09-08 16:29:36 +00:00
Evan Cheng
f8d8287454 Correctly handle physical register inputs. They are not explicit input operands in the resulting machine instrs.
llvm-svn: 55893
2008-09-08 08:39:33 +00:00
Evan Cheng
8f1ac64bc9 Eliminate a compile time warning.
llvm-svn: 55878
2008-09-07 09:00:57 +00:00
Evan Cheng
018d570cb8 Fix indentation of generated code.
llvm-svn: 55876
2008-09-07 08:23:06 +00:00
Evan Cheng
4fb8cbebe4 Ignore multi-instruction patterns. e.g.
def : Pat<(i8 (trunc GR32:$src)),
          (i8 (EXTRACT_SUBREG (MOV32to32_ GR32:$src), x86_subreg_8bit))>

llvm-svn: 55875
2008-09-07 08:19:51 +00:00
Evan Cheng
43c7084625 Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class.
llvm-svn: 55679
2008-09-03 00:03:49 +00:00
Evan Cheng
9817be2f96 Change getBinaryCodeForInstr prototype. First operand MachineInstr& should be const. Make corresponding changes.
llvm-svn: 55623
2008-09-02 06:51:36 +00:00
Owen Anderson
3aa3841da2 Add initial support for fast isel of instructions that have inputs pinned to physical registers.
llvm-svn: 55545
2008-08-29 17:45:56 +00:00
Dan Gohman
c7b8401b77 Add a target callback for FastISel.
llvm-svn: 55512
2008-08-28 23:21:34 +00:00
Gabor Greif
de8ed9f431 just a brain dump for a small tool
that brings us to 80-col violations
or tabs.

Usage:
  visit-violations <file>

At the moment it outputs editor invocations.

llvm-svn: 55509
2008-08-28 23:15:28 +00:00
Gabor Greif
86c795a8ca erect abstraction boundaries for accessing SDValue members, rename Val -> Node to reflect semantics
llvm-svn: 55504
2008-08-28 21:40:38 +00:00
Owen Anderson
a5b87bf7e2 Add support for fast-isel of opcodes that require use of extract_subreg. Because of how extract_subreg is treated, it requires special case handling.
llvm-svn: 55480
2008-08-28 18:06:12 +00:00
Dan Gohman
378f477a02 Update a comment to reflect recent changes.
llvm-svn: 55418
2008-08-27 16:18:22 +00:00
Dan Gohman
5e5f1c9e8f Basic FastISel support for floating-point constants.
llvm-svn: 55401
2008-08-27 01:09:54 +00:00
Gabor Greif
4b86114f92 disallow direct access to SDValue::ResNo, provide a getter instead
llvm-svn: 55394
2008-08-26 22:36:50 +00:00
Dan Gohman
84d7f86244 Refactor a bunch of FastISelEmitter code into a helper class, and
put each major step in a separate function. This makes the high
level sequence of events easier to follow.

llvm-svn: 55385
2008-08-26 21:21:20 +00:00
Cedric Venet
62a65ed510 - small bug corrected: incorrect iterator type.
- fix to please VS: add a return after an assert.

llvm-svn: 55380
2008-08-26 19:49:04 +00:00
Owen Anderson
9e2381b77d We need to check that the return type is correct, even in cases where we don't
have a return type that differs from the operand types.

llvm-svn: 55376
2008-08-26 18:50:00 +00:00
Chris Lattner
1804f18b34 code simplification, no functionality change.
llvm-svn: 55363
2008-08-26 07:01:28 +00:00
Chris Lattner
006fc6636d stabilize more printing, this doesn't cause a problem
in the example attached to PR2590, but is a problem in general.

llvm-svn: 55361
2008-08-26 06:50:46 +00:00
Chris Lattner
6adb1b1b26 stablize SubRegsSet printing, part of PR2590
llvm-svn: 55360
2008-08-26 06:49:06 +00:00
Chris Lattner
e589d360a1 Stabilize 'getDwarfRegNumFull' output to not depend on random memory
orders, part of PR2590

llvm-svn: 55359
2008-08-26 06:43:25 +00:00
Owen Anderson
9c207563a1 Throw the switch to allow FastISel to emit instructions whose return types different from their inputs. Next step: adding lowering pattens in FastISel that actually use these newly available opcodes.
llvm-svn: 55349
2008-08-26 01:22:59 +00:00
Owen Anderson
7e677167d6 Enhance TableGen to emit code for FastISel of opcodes with variadic return types without slowing down opcodes that are not variadic. No such opcodes are currently generated, but in theory it should be a matter of just hitting the switch.
llvm-svn: 55347
2008-08-26 00:42:26 +00:00
Owen Anderson
9264f41ef2 Add a RetVT parameter to emitted FastISel methods, so that we will be able to pass the desired return
type down.  This is not currently used.

llvm-svn: 55345
2008-08-25 23:58:18 +00:00
Owen Anderson
19b73e58e8 Deepen the map structure tablegen uses to compute FastISel patterns, in preparation for having patterns
with return types that differ from their input types.  This is not yet used.

llvm-svn: 55344
2008-08-25 23:43:09 +00:00
Owen Anderson
27491bbf2c Add support for fast isel of (integer) immediate materialization pattens, and use them to support
bitcast of constants in fast isel.

llvm-svn: 55325
2008-08-25 20:20:32 +00:00
Dan Gohman
a9d5f9b006 Move the point at which FastISel taps into the SelectionDAGISel
process up to a higher level. This allows FastISel to leverage
more of SelectionDAGISel's infastructure, such as updating Machine
PHI nodes.

Also, implement transitioning from SDISel back to FastISel in
the middle of a block, so it's now possible to go back and
forth. This allows FastISel to hand individual CallInsts and other
complicated things off to SDISel to handle, while handling the rest
of the block itself.

To help support this, reorganize the SelectionDAG class so that it
is allocated once and reused throughout a function, instead of
being completely reallocated for each block.

llvm-svn: 55219
2008-08-23 02:25:05 +00:00
Dan Gohman
46c93eebcd Add a few comments.
llvm-svn: 55157
2008-08-22 00:28:15 +00:00
Dan Gohman
a398d11527 Factor out the predicate check code from DAGISelEmitter.cpp
and use it in FastISelEmitter.cpp, and make FastISel
subtarget aware. Among other things, this lets it work
properly on x86 targets that don't have SSE, where it
successfully selects x87 instructions.

llvm-svn: 55156
2008-08-22 00:20:26 +00:00
Dan Gohman
a6e647dd7c Basic fast-isel support for instructions with constant int operands.
llvm-svn: 55099
2008-08-21 01:41:07 +00:00
Dan Gohman
e628777073 Remove the code that limited FastISel to certain fixed signatures.
llvm-svn: 55096
2008-08-21 00:35:26 +00:00
Dan Gohman
4ab3376173 Begin making more use of the FastISelEmitter class.
llvm-svn: 55093
2008-08-21 00:19:05 +00:00
Dan Gohman
d79f723519 Remove an obsolete todo comment.
llvm-svn: 55080
2008-08-20 21:47:28 +00:00
Dan Gohman
74bfad70e1 Factor the code for determining the target-specific instruction
namespace out of the isel emitters and into common code.

llvm-svn: 55079
2008-08-20 21:45:57 +00:00
Dan Gohman
ddebe95287 Simplify FastISel's constructor argument list, make the FastISel
class hold a MachineRegisterInfo member, and make the
MachineBasicBlock be passed in to SelectInstructions rather
than the FastISel constructor.

llvm-svn: 55076
2008-08-20 21:05:57 +00:00
Dan Gohman
ed5e30b819 Fix the string for MVT::isVoid.
llvm-svn: 55034
2008-08-20 01:44:30 +00:00
Dan Gohman
ebba5dd8be For now, restrict FastISel to instructions that only involve one
register class.

llvm-svn: 55008
2008-08-19 20:58:14 +00:00
Dan Gohman
69eb9fb38e Factor out the code to scan an instruction's operands into a
helper function.

llvm-svn: 55007
2008-08-19 20:56:30 +00:00
Dan Gohman
85448ceb8d Add more comments.
llvm-svn: 55004
2008-08-19 20:36:33 +00:00
Dan Gohman
b60099089a Fix indentation in FastISel tablegen-emitted code.
llvm-svn: 55003
2008-08-19 20:31:38 +00:00
Dan Gohman
a8dfd17e4e Add more checking to filter out more kinds of things that
FastISel doesn't support yet.

llvm-svn: 55002
2008-08-19 20:30:54 +00:00
Dan Gohman
1701d4ef7e 80 columns.
llvm-svn: 54998
2008-08-19 18:07:49 +00:00
Dan Gohman
3a57ef9668 Add a few doxygen comments.
llvm-svn: 54997
2008-08-19 18:06:12 +00:00
Dan Gohman
fbc4410ada Remove an unneeded #include.
llvm-svn: 54996
2008-08-19 17:53:16 +00:00
Devang Patel
84b8e5630e Compress manpages.
llvm-svn: 54971
2008-08-19 01:17:41 +00:00
Owen Anderson
169e5e5b99 Speed up addRegisterDead by adding more fast checks before performing the expensive
subregister query, and by increasing the size of the subregister hashtable so
that there are fewer collisions.

llvm-svn: 54781
2008-08-14 18:34:18 +00:00
Daniel Dunbar
4e592412d4 Update makellvm to return correct result code.
llvm-svn: 54756
2008-08-13 20:43:56 +00:00
Dan Gohman
4b1b033f89 Initial checkin of the new "fast" instruction selection support. See
the comments in FastISelEmitter.cpp for details on what this is.
This is currently experimental and unusable.

llvm-svn: 54751
2008-08-13 20:19:35 +00:00
Dan Gohman
502d2aebff Oops, check in these files too, for the FastISel -> Fast rename.
llvm-svn: 54750
2008-08-13 19:55:00 +00:00
Chris Lattner
fecb2b44a4 remove obsolete files
llvm-svn: 54630
2008-08-11 06:12:45 +00:00
Bill Wendling
cff4a97a86 Add ARM to the targets to build.
llvm-svn: 54386
2008-08-05 23:52:28 +00:00
Mon P Wang
fb483982f5 Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Bill Wendling
3a37809823 Don't build with 4.0.
llvm-svn: 54137
2008-07-28 18:45:36 +00:00
Dan Gohman
9742f7772d Rename SDOperand to SDValue.
llvm-svn: 54128
2008-07-27 21:46:04 +00:00