Commit Graph

3172 Commits

Author SHA1 Message Date
Johnny Chen
1808e4d251 If all the bit positions are not specified; do not decode the instructions.
We are bound to fail!  For proper disassembly, the well-known encoding bits
of the instruction must be fully specified.

This also removes pseudo instructions from considerations of disassembly,
which is a better design and less fragile than the name matchings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 21:01:02 +00:00
Chris Lattner
21aa347c28 add minix support, patch by Kees van Reeuwijk! PR6797
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 20:45:04 +00:00
Bob Wilson
ec80e2693a Provide versions of the ARM eh_sjlj_setjmp instructions for non-VFP subtargets
such that the non-VFP versions have no implicit defs of VFP registers.
If any callee-saved VFP registers are marked as having been defined, the
prologue/epilogue code will try to save and restore them.
Radar 7770432.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 20:41:18 +00:00
Johnny Chen
e0c74fb1de ARM decoder emitter should print out useful information unconditionally when it
encounters decoding conflicts, instead of wrapping it inside the DEBUG() macro. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:31:33 +00:00
Daniel Dunbar
2381379d1d lit: Add support to OneCommandPerFileTest format to take input directory from input path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 02:15:10 +00:00
Johnny Chen
2d16a67b94 Now that Evan Cheng has fixed the coalescer bug (r100804), the workaround code
to avoid memcpy() call is no longer necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 21:23:54 +00:00
Benjamin Kramer
454c4ce479 Various MSVC warning fixes about truncated 64 bit shifts and const pointers passed to free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 15:25:57 +00:00
Benjamin Kramer
127dc5e615 Use errs instead of fprintf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 09:42:29 +00:00
Sean Callanan
8f993b8c24 Added support for ARM disassembly to edis.
I also added a rule to the ARM target's Makefile to
build the ARM-specific instruction information table
for the enhanced disassembler.

I will add the test harness for all this stuff in
a separate commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 00:48:21 +00:00
Chris Lattner
75361b69f3 rename llvm::llvm_report_error -> llvm::report_fatal_error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:58:41 +00:00
Chris Lattner
e3a601b648 add newlines at end of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:54:55 +00:00
Sean Callanan
5edca81626 Fixed a bug where the disassembler would allow an immediate
argument that had to be between 0 and 7 to have any value,
firing an assert later in the AsmPrinter.  Now, the
disassembler rejects instructions with out-of-range values
for that immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 21:42:19 +00:00
Eric Christopher
72666f2be9 Fix typo and correct comment somewhat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:58:16 +00:00
Johnny Chen
3c500e6947 Re-enable ARM/Thumb disassembler and add a workaround for a memcpy() call in
ARMDecoderEmitter.cpp, with FIXME comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:53:12 +00:00
Anton Korobeynikov
96085a36db Initial support for different kinds of FU reservation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:19:32 +00:00
Chris Lattner
4c842dda39 stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:42:30 +00:00
Jakob Stoklund Olesen
fddb7667ca Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field.
When a target instruction wants to set target-specific flags, it should simply
set bits in the TSFlags bit vector defined in the Instruction TableGen class.

This works well because TableGen resolves member references late:

class I : Instruction {
  AddrMode AM = AddrModeNone;
  let TSFlags{3-0} = AM.Value;
}

let AM = AddrMode4 in
def ADD : I;

TSFlags gets the expected bits from AddrMode4 in this example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 03:10:20 +00:00
Chris Lattner
35c33bd772 change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter.  Instead, pass it in explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 04:47:45 +00:00
Chandler Carruth
1e86e3fb4b Fix a warning in GCC about a pointless typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 04:45:24 +00:00
Chandler Carruth
b421640efa Add the new ARMDecodeEmitter to CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 04:36:43 +00:00
Johnny Chen
55f71187a5 Move variable "Bits" declaration/definition into the DEBUG block where its usage
is expected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100247 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 23:13:52 +00:00
Johnny Chen
493a441391 Fixed build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 22:51:04 +00:00
Johnny Chen
9981814a40 Change from .../Support/DataTypes.h to .../System/DataTypes.h.
(Fix build failure)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 22:41:06 +00:00
Johnny Chen
b68a3ee82a Second try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
backend (ARMDecoderEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Reviewed by Chris Latter and Bob Wilson.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 22:27:38 +00:00
Daniel Dunbar
e09ccab0ce Add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 19:14:05 +00:00
Daniel Dunbar
c3681d334a lit: Make sure to close any files we open as part of redirection.
PR6753.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 18:48:43 +00:00
Chris Lattner
283d1ceb57 Switch pattern sorting predicate from stable sort -> sort, it
doesn't need to be stable because the patterns are fully ordered.

Add a first level sort predicate that orders patterns in this
order:  1) scalar integer operations 2) scalar floating point 
3) vector int 4) vector float.  This is a trivial sort on their
top level pattern type so it is nice and transitive.  The
benefit of doing this is that simple integer operations are
much more common than insane vector things and isel was trying
to match the big complex vector patterns before the simple
ones because the complexity of the vector operations was much
higher.  Since they can't both match, it is best (for compile
time) to try the simple integer ones first.

This cuts down the # failed match attempts on real code by
quite a bit, for example, this reduces backtracks on crafty
(as a random example) from 228285 -> 188369.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 02:02:45 +00:00
Chris Lattner
4810736134 revert 99795, as mentioned, it is disabled anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:58:15 +00:00
Chris Lattner
a0401249e8 Check in a (disabled) failed attempt to improve the ordering of
patterns within the generated matcher.  This works great except
that the sort fails because the relation defined isn't 
transitive.  I have a much simpler solution coming next, but want
to archive the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:56:19 +00:00
Chris Lattner
48e86dbe29 print the complexity of the pattern being matched in the
comment in the generated table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:40:38 +00:00
Chris Lattner
2a22cdc716 improve type checking of SDNode operand count. This rejects all cases
where an incorrect number of operands is provided to an sdnode instead
of just a few cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 08:48:47 +00:00
Chris Lattner
caa8870fe0 finally remove the immAllOnesV_bc/immAllZerosV_bc patterns
and those derived from them.  These are obnoxious because
they were written as: PatLeaf<(bitconvert).  Not having an
argument was foiling adding better type checking for operand
count matching up with what was required (in this case,
bitconvert always requires an operand!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 08:43:23 +00:00
Chris Lattner
7a0eb91b4c teach tblgen to allow patterns like (add (i32 (bitconvert (i32 GPR))), 4),
transforming it into (add (i32 GPR), 4).  This allows us to write type
generic multi patterns and have tblgen automatically drop the bitconvert
in the case when the types align.  This allows us to fold an extra load
in the changed testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 08:38:32 +00:00
Chris Lattner
b775b1e20b validate that input sdnodes don't exist in an output pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 06:57:56 +00:00
Chris Lattner
c217305f76 eliminate a bunch of code duplication in ParseTreePattern
by rotating it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 06:50:34 +00:00
Chris Lattner
c812261221 SDTCisVT<0, isVoid> is not valid, reject it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 06:04:39 +00:00
Chris Lattner
aa4e3391c8 add an optimized form of OPC_EmitMergeInputChains for the 1, 0 and
1, 1 cases which are by-far the most frequent.  This shrinks the X86
isel table from 77014 -> 74657 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 05:50:16 +00:00
Chris Lattner
b4a52b04bd fix a long standing fixme, which required fixing a bunch of other
issues to get here.  We now trim the result type list of the
CompleteMatch or MorphNodeTo operation to be the same size as the
thing we're matching.  this means that if you match (add GPR, GPR)
with an instruction that produces a normal result and a flag that
we now trim the result in tblgen instead of having to do it 
dynamically.  This exposed a bunch of inconsistencies in result
counting that happened to be getting lucky since the days of the
old isel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 20:45:15 +00:00
Chris Lattner
0d7952ed5a fix CodeGenTarget::getRegisterVTs to not return the
same vt multiple times for a register.  For example,
ECX is in 5 different i32 reg classes, just return 
1 i32 instead of 5.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99727 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 20:32:26 +00:00
Chris Lattner
9414ae5291 hoist some funky logic into CodeGenInstruction
from two places in CodeGenDAGPatterns.cpp, and
use it in DAGISelMatcherGen.cpp instead of using
an incorrect predicate that happened to get lucky
on our current targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 20:09:24 +00:00
Chris Lattner
0be6fe7139 continue pushing tblgen's support for nodes with multiple
results forward.  We can now handle an instruction that 
produces one implicit def and one result instead of one or
the other when not at the root of the pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 19:15:02 +00:00
Chris Lattner
5d3569e93c fix a bug in my recent patch that increased opcode size to 2 bytes:
the index comments nested under OPC_SwitchOpcode were off by one.
This fixes the comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 18:49:33 +00:00
Dan Gohman
f65f294c99 Remove an unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 16:33:36 +00:00
Chris Lattner
310adf1c6f remove parallel support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 02:53:27 +00:00
Jakob Stoklund Olesen
70feca409e Teach TableGen to understand X.Y notation in the TSFlagsFields strings.
Remove much horribleness from X86InstrFormats as a result. Similar
simplifications are probably possible for other targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 18:52:01 +00:00
Daniel Dunbar
f104f5b17a lit: Add LitTestCase and lit.load_test_suite, for adapting lit based suites for
use with Python's unittest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 07:10:01 +00:00
Chris Lattner
d5d5a3dcba Change tblgen to emit FOOISD opcode names as two
bytes instead of one byte.  This is important because
we're running up to too many opcodes to fit in a byte
and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE
making the numbering sparse.  This just bites the
bullet and bloats out the table.  In practice, this
increases the size of the x86 isel table from 74.5K
to 76K.  I think we'll cope :)

This fixes rdar://7791648


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 06:33:05 +00:00
Jakob Stoklund Olesen
d1baa252c4 Fix evil TableGen bug in template parameters with defaults.
If a TableGen class has an initializer expression containing an X.Y subexpression,
AND X depends on template parameters,
AND those template parameters have defaults,
AND some parameters with defaults are beyond position 1,
THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 06:23:34 +00:00
Chris Lattner
084df627c8 add plumbing for handling multiple result nodes
in some more places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:41:19 +00:00
Chris Lattner
cc87830732 implement SDTCisVTSmallerThanOp with EnforceSmallerThan
instead of reimplementing it wrong and poorly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:06:46 +00:00
Chris Lattner
66fb9d26c6 bring sanity to EnforceVectorEltType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 00:01:16 +00:00
Chris Lattner
640a3f5309 Cleanup getImplicitType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99353 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 23:50:31 +00:00
Chris Lattner
9972aff7da reject void in intrinsic type lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 23:46:27 +00:00
Bill Wendling
602d005083 Use "DISABLE_EDIS" to disable building "edis" explicitly. Don't build it for
Apple-style builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:15:33 +00:00
Chris Lattner
93dc92e412 Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.  Now with a fix
for the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 20:56:36 +00:00
Jeffrey Yasskin
982873cdfb When we don't pass --vg-leak to lit, pass --leak-check=no to valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99112 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 01:47:33 +00:00
Daniel Dunbar
32f6a8b8bb Fix suggested parentheses warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 01:38:21 +00:00
Jeffrey Yasskin
32989deb96 Add support for XFAILing valgrind runs with memory leak checking independently
of runs without leak checking.  We add -vg to the triple for non-checked runs,
or -vg_leak for checked runs.  Also use this to XFAIL the TableGen tests, since
tablegen leaks like a sieve.  This includes some valgrindArgs refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 23:08:45 +00:00
Eric Christopher
d7de54068c Revert r99009 temporarily it seems to be breaking the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 23:04:23 +00:00
Chris Lattner
26e763753b Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 22:40:56 +00:00
Chris Lattner
2e68a02c26 make getOperandNum a static function (since it's just used by
ApplyTypeConstraint) and make it handle multiple result nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:56:21 +00:00
Chris Lattner
d734919465 major surgery on tblgen: generalize TreePatternNode
to maintain a list of types (one for each result of
the node) instead of a single type.  There are liberal
hacks added to emulate the old behavior in various
situations, but they can start disolving now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:37:09 +00:00
Ben Holt
bcb4d81755 Test commit (removed extra blank line)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:12:29 +00:00
Daniel Dunbar
7a68e0df0d FileCheck: Don't print "possibly intended match" line if it would match the
"scanning from here" one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:43 +00:00
Torok Edwin
2f36fe4380 Set numThreads to 1 by default when Python is older than 2.5.2.
Python 2.4 always hits this bug: http://bugs.python.org/issue1731717
when running check-lit on multi-core systems.
Setting numThreads to 1 makes it slower, but at least the results reported are
correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 17:54:21 +00:00
Chris Lattner
774ce29399 make FillWithPossibleTypes take a predicate to filter types so that
we don't blow the smallvector as often.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 17:41:26 +00:00
Chris Lattner
1e50631675 resolve fixme: we now infer the instruction-level 'isvariadic' bit
from the pattern if present, and we use it instead of the bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:34:15 +00:00
Chris Lattner
e8cabf3c2e add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties.  This
allows the oh-so-useful behavior of matching a variadic
non-root node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:07:09 +00:00
Chris Lattner
5a9b8fb95c rewrite EnforceSmallerThan to be less bone headed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 04:54:36 +00:00
Daniel Dunbar
65f35d5703 Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 03:18:20 +00:00
Chris Lattner
aac5b5b2e5 eliminate the last use of EEVT::isUnknown
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:14:27 +00:00
Chris Lattner
e14d2e210d Finally change the instruction looking map to be a densemap from
record* -> instrinfo instead of std::string -> instrinfo.

This speeds up tblgen on cellcpu from 7.28 -> 5.98s with a debug
build (20%).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:07:44 +00:00
Chris Lattner
6a91b18e57 make inst_begin/inst_end iterate over InstructionsByEnumValue.
Use CodeGenTarget::getInstNamespace in one place and fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:00:55 +00:00
Chris Lattner
01dcecc214 revert 98912
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:50:47 +00:00
Chris Lattner
a28bc686fa make inst_begin/inst_end iterate over InstructionsByEnumValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:40:22 +00:00
Chris Lattner
f65027842e change Target.getInstructionsByEnumValue to return a reference
to a vector that CGT stores instead of synthesizing it on every 
call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:34:35 +00:00
Chris Lattner
e4e8bb1541 factor copy and paste code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:23:20 +00:00
Chris Lattner
b61e09de6d don't go through getInstructions().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:18:23 +00:00
Chris Lattner
f30187a363 look up instructions by record, not by name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:07:20 +00:00
Chris Lattner
928795387f expand tblgen's support for instructions with implicit defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 23:57:40 +00:00
Chris Lattner
6c6ba36493 infer results of a pattern from implicit defs. This allows you to do something
like this:

 def : Pat<(add ...),
           (FOOINST)>;

When fooinst only has a single implicit def (e.g. to R1).  This will be handled
as if written as (set R1, (FOOINST ...))



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 23:15:10 +00:00
Chris Lattner
f506b6b471 capture implicit uses and defs in CodeGenInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 21:42:03 +00:00
Chris Lattner
ef988984d7 simplify this code, the # of sets in the pattern for an instruction
shouldn't change this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98872 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 21:15:05 +00:00
Chris Lattner
0b6c926856 disallow concatenation of two dags with different operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98871 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 21:07:51 +00:00
Chris Lattner
f55eed299b rewrite this to not artificially force concat the ins/outs list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 21:07:39 +00:00
Chris Lattner
b0be4d261b eliminate support for "ops" in the input/output list of an
instruction.  Instructions must use 'ins' and 'outs' now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:56:35 +00:00
Chris Lattner
cedef1ccf0 remove some code that was working around old sparc v9 backend bugs.
Add checking that the input/output operand list in spelled right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:50:52 +00:00
Daniel Dunbar
1814cf0f10 lit: Tweak example tests config.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:06:05 +00:00
Daniel Dunbar
8cc9c0c487 MC/AsmMatcher: Add support for target specific "instruction cleanup" functions,
to allow custom post-processing of matched instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:05:56 +00:00
Kovarththanan Rajaratnam
e7e891f6af Add an extra newline to separate PP directives from the contents
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 13:16:38 +00:00
Jeffrey Yasskin
fd4943087e Avoid a problem in libc_freeres() seen on a linux-i686 buildbot when running
under valgrind:

==19577== Invalid free() / delete / delete[]
==19577==    at 0x4C9C866: free (vg_replace_malloc.c:325)
==19577==    by 0x5121104: ??? (in /lib/libc-2.10.2.so)
==19577==    by 0x4C97412: _vgnU_freeres (vg_preloaded.c:62)
==19577==    by 0x5041486: __run_exit_handlers (exit.c:93)
==19577==    by 0x50414FE: exit (exit.c:100)
==19577==    by 0x5028B5C: (below main) (libc-start.c:254)
==19577==  Address 0xffffffff is not stack'd, malloc'd or (recently) free'd
==19577== 

Apparently this happens under certain versions of glibc, so valgrind provides
the --run-libc-freeres=no option to avoid calling freeres().  This may increase
the number of "still reachable" blocks valgrind reports, but we don't care
about those, while this error breaks the buildbots.

There are upstream bugs about this at
http://sourceware.org/bugzilla/show_bug.cgi?id=10610 and
http://bugs.kde.org/show_bug.cgi?id=167483, but they don't look likely to be
fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 07:00:12 +00:00
Jim Grosbach
11cb87c259 Use llvm-gcc to build ARM when it's available
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 21:25:13 +00:00
Jeffrey Yasskin
b5e9770aef Make lit pay attention to --vg for tcl tests too, which makes it work on LLVM's
non-unit tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 17:04:56 +00:00
Bob Wilson
49d9dc4dd2 --- Reverse-merging r98637 into '.':
U    test/CodeGen/ARM/tls2.ll
U    test/CodeGen/ARM/arm-negative-stride.ll
U    test/CodeGen/ARM/2009-10-30.ll
U    test/CodeGen/ARM/globals.ll
U    test/CodeGen/ARM/str_pre-2.ll
U    test/CodeGen/ARM/ldrd.ll
U    test/CodeGen/ARM/2009-10-27-double-align.ll
U    test/CodeGen/Thumb2/thumb2-strb.ll
U    test/CodeGen/Thumb2/ldr-str-imm12.ll
U    test/CodeGen/Thumb2/thumb2-strh.ll
U    test/CodeGen/Thumb2/thumb2-ldr.ll
U    test/CodeGen/Thumb2/thumb2-str_pre.ll
U    test/CodeGen/Thumb2/thumb2-str.ll
U    test/CodeGen/Thumb2/thumb2-ldrh.ll
U    utils/TableGen/TableGen.cpp
U    utils/TableGen/DisassemblerEmitter.cpp
D    utils/TableGen/RISCDisassemblerEmitter.h
D    utils/TableGen/RISCDisassemblerEmitter.cpp
U    Makefile.rules
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/Makefile
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
D    lib/Target/ARM/Disassembler
U    lib/Target/ARM/ARMInstrFormats.td
U    lib/Target/ARM/ARMAddressingModes.h
U    lib/Target/ARM/Thumb2ITBlockPass.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 16:59:47 +00:00
Johnny Chen
d30a98e43a Initial ARM/Thumb disassembler check-in. It consists of a tablgen backend
(RISCDisassemblerEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm
instructions to help disassembly.

We also changed the output of the addressing modes to omit the '+' from the
assembler syntax #+/-<imm> or +/-<Rm>.  See, for example, A8.6.57/58/60.

And modified test cases to not expect '+' in +reg or #+num.  For example,

; CHECK:       ldr.w	r9, [r7, #28]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 16:36:54 +00:00
Daniel Dunbar
c613969122 NNT: Add -nouname option, so machine uniquing can occur across physical machines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 15:53:02 +00:00
Chris Lattner
5f19c43161 don't form a RecordChild or CheckChildType for child #'s over 7, we don't
have enums for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:35:11 +00:00
Chris Lattner
e002da34ef eliminate some #if 0 code I added in r96905, type inference
now enforces that input/output named values have hte same type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 06:03:22 +00:00
Chris Lattner
2cacec55f9 Completely rewrite tblgen's type inference mechanism,
changing the primary datastructure from being a 
"std::vector<unsigned char>" to being a new TypeSet class
that actually has (gasp) invariants!

This changes more things than I remember, but one major
innovation here is that it enforces that named input 
values agree in type with their output values.

This also eliminates code that transparently assumes (in 
some cases) that SDNodeXForm input/output types are the
same, because this is wrong in many case.

This also eliminates a bug which caused a lot of ambiguous
patterns to go undetected, where a register class would
sometimes pick the first possible type, causing an
ambiguous pattern to get arbitrary results.

With all the recent target changes, this causes no 
functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 06:00:16 +00:00
Evan Cheng
5e81716425 Check in tablegen changes to fix disassembler related failures caused by r98465.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 05:15:39 +00:00
Jeffrey Yasskin
355471741b Make lit pay attention to --vg for unittests too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 20:45:41 +00:00
Chris Lattner
202c6a7e76 update mkpatch for MC, patch by Aaron Gray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 06:32:12 +00:00
Chandler Carruth
315b1bb746 Continue propagating the GoogleTest flags until we can update our version to
eliminate this problem. This will hopefully let us make progress on Linux
bootstrapping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 22:45:10 +00:00
Chandler Carruth
f10e43ee7e Consolidate GoogleTest make options and duplicate them to its own makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 19:24:49 +00:00
John McCall
197d009e6b Revert r97726 and r97728 at ddunbar's request; we want to solve this
some other way when it comes to be necessary.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:02:05 +00:00
Chris Lattner
43e4754817 Node arguments to type casts can have names too. This code
needs to be majorly refactored, but this spot bugfix allows
things like:

 def vmrghw_shuffle : PatFrag<(ops node:$lhs, node:$rhs),
                             (vector_shuffle (v4i32 node:$lhs), node:$rhs), [{
...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:36:19 +00:00
Chris Lattner
81d6d52592 turn off debug spew
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:21:24 +00:00
Chris Lattner
6fd326b7ff more factoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:20:49 +00:00
Chris Lattner
9cdd9659c3 teach tblgen to be more aggressive when factoring CheckType nodes.
Now it will factor things like this:

CheckType i32
  ...
CheckOpcode ISD::AND
  CheckType i64
  ...

into:

SwitchType:
  i32: ...
  i64:
    CheckOpcode ISD::AND
    ...

This shrinks hte table by a few bytes, nothing spectacular.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 07:01:28 +00:00
Chris Lattner
48aa5756a2 add some helper functions and implement isContradictory
for CheckValueTypeMatcher.  The isContradictory implementation
helps us factor better, shrinking x86 table from 79144 -> 78896
bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07 06:29:26 +00:00
Duncan Sands
2d4e4af45e If LD_LIBRARY_PATH is set in the system environment, use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 08:21:02 +00:00
Mikhail Glushenkov
b5c4239606 Make it not an error to specify -O* options several times.
As in 'llvmc -O2 -O2 test.c'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 04:46:39 +00:00
John McCall
b8f2e4bde6 Simplify the condition-checking logic and hopefully clear up a build failure
that somehow got through my testing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 11:48:42 +00:00
John McCall
7b7b90769a Teach lit to honor conditional directives. The syntax is:
IF(condition(value)):
If the value satisfies the condition, the line is processed by lit;  otherwise
it is skipped.  A test with no unignored directives is resolved as Unsupported.

The test suite is responsible for defining conditions;  conditions are unary
functions over strings.  I've defined two conditions in the LLVM test suite,
TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values
like those in llvm_bindings).  So for example you can write:
  IF(BINDING(ocaml)): RUN: %blah %s -o -
and the RUN line will only execute if LLVM was configured with the ocaml
bindings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 09:36:50 +00:00
Chris Lattner
57fcd03611 so hey, it turns out that the histogram was completely wrong, because
we sometimes emit nodes multiple times to string buffers to size them.
Compute the histogram correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:34:29 +00:00
Chris Lattner
6b4ae71725 zap fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:26:00 +00:00
Chris Lattner
9752fb10a4 now that complexpatterns are all emitted at the end of the match
sequence, just emit instruction predicates right before them.  This
exposes yet more factoring opportunitites, shrinking the X86 table 
to 79144 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:25:36 +00:00
Chris Lattner
57bf8a483e change the new isel matcher to emit ComplexPattern matches
as the very last thing before node emission.  This should
dramatically reduce the number of times we do 'MatchAddress'
on X86, speeding up compile time.  This also improves comments
in the tables and shrinks the table a bit, now down to 
80506 bytes for x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:23:08 +00:00
Chris Lattner
d1aca7c8b4 enhance comment output to specify what recorded slot
numbers a ComplexPat will match into.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 00:28:05 +00:00
Chris Lattner
cfe2eab744 introduce a new SwitchTypeMatcher node (which is analogous to
SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it.  This
speeds up selection, particularly for X86 which has lots of 
variants of instructions with only type differences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 06:28:15 +00:00
Bill Wendling
30174be37a Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 05:40:40 +00:00
Bill Wendling
fbe8eab37e Don't turn assertions on by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:13:55 +00:00
Chris Lattner
d272fee398 the sorting predicate should work for comparing an element
to itself, even though this isn't wildly useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97574 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 18:15:02 +00:00
Chris Lattner
4a3ac62332 eliminate CodeGen/DAGISelHeader.h, it is empty now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97556 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 06:36:28 +00:00
Chris Lattner
c6d7ad3c7d Rewrite chain handling validation and input TokenFactor handling
stuff now that we don't care about emulating the old broken 
behavior of the old isel.  This eliminates the 
'CheckChainCompatible' check (along with IsChainCompatible) which
did an incorrect and inefficient scan *up* the chain nodes which
happened as the pattern was being formed and does the validation
at the end in HandleMergeInputChains when it forms a structural 
pattern.  This scans "down" the graph, which means that it is
quickly bounded by nodes already selected.  This also handles
token factors that get "trapped" in the dag.

Removing the CheckChainCompatible nodes also shrinks the 
generated tables by about 6K for X86 (down to 83K).

There are two pieces remaining before I can nuke PreprocessRMW:
1. I xfailed a test because we're now producing worse code in a 
   case that has nothing to do with the change: it turns out that
   our use of MorphNodeTo will leave dead nodes in the graph
   which (depending on how the graph is walked) end up causing
   bogus uses of chains and blocking matches.  This is really 
   bad for other reasons, so I'll fix this in a follow-up patch.

2. CheckFoldableChainNode needs to be improved to handle the TF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 02:22:10 +00:00
Chris Lattner
38fd96731c add some missing \n's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 00:13:03 +00:00
Chris Lattner
8b30b8dd33 fixme resolved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 23:08:51 +00:00
Chris Lattner
e60f7b4412 remove a little hack I did for the old isel, not needed
now that it is gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:51:11 +00:00
Chris Lattner
67ea6a7111 resolve some fixmes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:49:06 +00:00
Chris Lattner
01bcd947bf resolve a fixme and simplify code by moving insertion of the
EmitMergeInputChainsMatcher node up into EmitResultCode.  This
doesn't have much of an effect on the generated code, the X86
table is exactly the same size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:46:42 +00:00
Chris Lattner
405f1252b9 resolve a fixme by having the .td file parser reject thigns like
(set GPR, somecomplexpattern)

if somecomplexpattern doesn't declare what it can match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:29:19 +00:00
Chris Lattner
7c720fc33a remove dead code, simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:19:47 +00:00
Chris Lattner
117ccb7e51 Fix PR2590 by making PatternSortingPredicate actually be
ordered correctly.  Previously it would get in trouble when
two patterns were too similar and give them nondet ordering.
We force this by using the record ID order as a fallback.

The testsuite diff is due to alpha patterns being ordered
slightly differently, the change is a semantic noop afaict:

< 	lda $0,-100($16)
---
> 	subq $16,100,$0



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:09:11 +00:00
Chris Lattner
f94bc54757 tolerate factoring the *last* node for CellSPU.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 22:04:33 +00:00
Chris Lattner
adc5347b54 optimize tblgen compile time by eliminating the old isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 21:49:54 +00:00
Chris Lattner
459eeedbe0 don't emit the old sdnodexform stuff for the new isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97486 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:39:15 +00:00
Chris Lattner
8a01c8d00d Turn on the new isel by default. Here are some fun numbers
with a release-asserts build on x86-64-darwin10:

LLC Size:
Old: 15,426,852
New: 12,759,140  (down 2.7M)

LLI Size:
Old: 9,926,876
New: 8,864,292   (down 1.1M)

X86ISelDAGToDAG.o size:
Old: 1,401,232
New:   162,868   (down 1.3M)

Time to build X86ISelDAGToDAG.o:
Old: 67.147u 2.060s 1:09.78
New:  4.234u 0.387s 0:04.77



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:05:25 +00:00
Torok Edwin
5520ad4dd9 Missed a \n in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:00:55 +00:00
Torok Edwin
5c7fc88b55 Add command-line flag to tblgen to turn off generating comments for the new
isel (defaults it to generate comments).
This reduces the size of the generated source file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 18:49:10 +00:00
Dan Gohman
c235a0c388 Add the alignstack keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 17:53:39 +00:00
Chris Lattner
60c0e37afc Emit type checks late instead of early, this encourages
structural matching code to be factored and shared this
shrinks the X86 isel table from 86537 to 83890 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 07:54:59 +00:00
Chris Lattner
bd8965a7d9 Emit a redundant check for immediates at root context, e.g. (imm 0).
This allows formation of OpcodeSwitch for top level patterns, in
particular on X86.  This saves about 1K of data space in the x86
table and makes the dispatch much more efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 07:27:07 +00:00
Chris Lattner
fa342faef9 eliminate the CheckMultiOpcodeMatcher code and have each
ComplexPattern at the root be generated multiple times, once
for each opcode they are part of.  This encourages factoring
because the opcode checks get treated just like everything
else in the matcher.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 07:17:40 +00:00
Chris Lattner
eb66921adb add a new OPC_SwitchOpcode which is semantically equivalent
to a scope where every child starts with a CheckOpcode, but
executes more efficiently.  Enhance DAGISelMatcherOpt to 
form it.

This also fixes a bug in CheckOpcode: apparently the SDNodeInfo
objects are not pointer comparable, we have to compare the
enum name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 06:59:22 +00:00
Chris Lattner
c99b5a25bb pull MarkFlagResult out from between an EmitNode/CompleteMatch
pair.  This encourages MorphNodeTo formation, this gets us 200
more MorphNodeTo's on X86 and shrinks the table a bit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 02:33:14 +00:00
Chris Lattner
0cebe6181a enhance RecordNode and RecordChild comments to indicate what
slot they're recording into, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 02:24:17 +00:00
Chris Lattner
e9eeda878b Emit redundant opcode checks for andimm and orimm tests at root
so that we get grouping at the top level.

Add an optimization to reorder type check & record nodes
after opcode checks.  We prefer to expose tree shape 
matching which improves grouping and will enhance the next
optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 02:15:34 +00:00
Chris Lattner
4d0c931ba7 inline the node transforms and node predicates into the generated
dispatcher method.  This eliminates the dependence of the new isel's
generated code on the old isel's predicates, however some random
hand written isel code still uses them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 01:54:19 +00:00
Chris Lattner
ccd23cc2a4 simplify some code now that chain/flag results are not stored in
the vtlist for emitnode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 23:00:47 +00:00
Chris Lattner
d20c0bc569 don't emit useless functions. These were producing
warnings in release-assert builds if there were no cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:57:03 +00:00
Chris Lattner
5310654dc5 change a few opcodes to use VBRs instead of embedding
immediate sizes into the opcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:14:32 +00:00
Chris Lattner
ff7fb60f2a enhance the EmitNode/MorphNodeTo operands to take a bit that
specifies whether there is an output flag or not.  Use this
instead of redundantly encoding the chain/flag results in the
output vtlist.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 21:53:42 +00:00
Chris Lattner
9a21500edc use MorphNodeTo instead of SelectNodeTo. SelectNodeTo
is just a silly wrapper around MorphNodeTo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 20:55:18 +00:00
Chris Lattner
c78f2a3994 enhance the new isel to use SelectNodeTo for most patterns,
even some the old isel didn't.  There are several parts of
this that make me feel dirty, but it's no worse than the
old isel.  I'll clean up the parts I can do without ripping
out the old one next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 20:49:53 +00:00
Chris Lattner
6281cda673 enhance EmitNodeMatcher to keep track of the recorded slot numbers
it will populate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 02:41:25 +00:00
Chris Lattner
e86097af55 add infrastructure to support forming selectnodeto. Not used yet
because I have to go on another detour first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 02:31:26 +00:00
Chris Lattner
225798143d Generalize my hack to use SDNodeInfo to find out when a
node is always guaranteed to have a particular type 
instead of hacking in ISD::STORE explicitly.  This allows
us to use implied types for a broad range of nodes, even
target specific ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 00:22:30 +00:00
Dan Gohman
bc9d98b52d The mayHaveSideEffects flag is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 23:47:46 +00:00
Chris Lattner
a230f9623d change CheckOpcodeMatcher to hold the SDNodeInfo instead of
the opcode name.  This gives the optimizer more semantic info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 21:48:43 +00:00
Chris Lattner
255584aaa6 add another case from the ppc backend. This is obviously a huge and
dissatisfying hack.  TODO: Improve it. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:19:47 +00:00
Chris Lattner
db8b6222d4 fix logic in DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:13:23 +00:00
Chris Lattner
247896272a teach the optimizer that opcode == ISD::STORE is contradictory
with getType() == MVT::i32 etc.  Teach it that two different
integer constants are contradictory.  This cuts 1K off the X86
table, down to 98k



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:11:15 +00:00
Chris Lattner
82781b938a Teach the grouper some simple tricks about looking contradictory
predicates.  For example if we have:

Scope:
  CheckType i32
    ABC
  CheckType f32
    DEF
  CheckType i32
    GHI

Then we know that we can transform this into:
Scope:
  CheckType i32
    Scope
      ABC
      GHI
  CheckType f32
    DEF

This reorders the check for the 'GHI' predicate above
the check for the 'DEF' predidate.  However it is safe to do this
in this situation because we know that a node cannot have both an
i32 and f32 type.

We're now doing more factoring that the old isel did.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 07:49:13 +00:00
Chris Lattner
aaf5486b82 use DEBUG instead of DebugFlag directly so that this
respects -debug-only=something-else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 06:51:44 +00:00
Chris Lattner
d323fd45e3 implement a new optimization to sink pattern predicates (like isSSE1)
as deeply into the pattern as we can get away with.  In pratice, this 
means "all the way to to the emitter code, but not across 
ComplexPatterns".  This substantially increases the amount of factoring
we get.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 06:22:57 +00:00
Dan Gohman
f34ff01a7a Fix grammaro in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:45:37 +00:00
Dan Gohman
7b14fc211c Add Revision keywords to these files, as it's common for them to be
copied out of the source tree.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:38:04 +00:00
Dan Gohman
d30103dd36 Improve the vim code for highlighting trailing whitespace and lines
longer than 80 columns. This replaces the heavy-handed "textwidth"
mechanism, and makes the trailing-whitespace highlighting lazy so
that it isn't constantly jumping on the user during typing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:24:46 +00:00
Dan Gohman
79073e3ea0 Add the alignstack keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:16:17 +00:00
Dan Gohman
77c8ff906a Remove bogus Updated line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 21:15:49 +00:00
Chris Lattner
5a56e5c82a add some helpful comments to the emitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:15:02 +00:00
Chris Lattner
d6f0602564 switch from my nice hashtable based merging solution to a
gross little neighbor merging implementation.  This one has
the benefit of not violating the ordering of patterns, so it
generates code that passes tests again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:08:41 +00:00
Chris Lattner
bb08d89298 fix same bug in CheckChainCompatibleMatcher::isEqualImpl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:06:02 +00:00
Chris Lattner
38717f6ccf fix a nasty bug in CheckTypeMatcher::isEqualImpl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:05:36 +00:00
Chris Lattner
d4397b9481 finish off the factoring optimization along the lines of the
current design.  This generates a matcher that successfully
runs, but it turns out that the factoring we're doing violates
the ordering of patterns, so we end up matching (e.g.) movups
where we want movaps.  This won't due, but I'll address this in
a follow on patch.  It's nice to not be on by default yet! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 07:36:37 +00:00
Chris Lattner
ca56feaf38 add a new setNumChildren method for resizing scopes. Tweak getHash() so
that we never return a tombstone value, which (thankfully) triggers an
assert in densemap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97214 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 07:35:27 +00:00
Chris Lattner
d6c84720df change the scope node to include a list of children to be checked
instead of to have a chained series of scope nodes.  This makes
the generated table smaller, improves the efficiency of the
interpreter, and make the factoring optimization much more 
reasonable to implement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 19:00:39 +00:00
Dan Gohman
5f8bfebb38 Add the union keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:17:58 +00:00
Daniel Dunbar
99fe6d92d3 Add simple script for finding most-recent-rev-before-N in a git-svn repo; useful
when bisecting multiple repos in sync.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:07:07 +00:00
Chris Lattner
04db82d2ba Implement the first half of redundancy factoring: efficiently
splitting all the patterns under scope nodes into equality sets
based on their first node.  The second step is to rewrite the
graph info a form that exposes the sharing.  Before I do this, 
I want to redesign the Scope node.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 07:45:24 +00:00
Chris Lattner
a5028a6463 factor the print method better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 06:53:39 +00:00
Chris Lattner
58aa834d31 add methods to do equality checks and get hashes of Matchers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97123 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 06:49:58 +00:00
Chris Lattner
499622b2b1 formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 02:09:00 +00:00
Chris Lattner
b21ba71045 rename fooMatcherNode to fooMatcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 02:04:40 +00:00
Chris Lattner
06158406c5 add some noop code to push it out of my tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:57:41 +00:00
Chris Lattner
60df53e30a rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does.  Switch the sense of the Next and the Check
arms to be more logical.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:56:48 +00:00
Jeffrey Yasskin
b05942cec9 Filter the future all-of-llvm shared library out of the llvm-config
results.  I'm checking this in before the shared library so that I can
tell if it breaks anything on its own.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:21:38 +00:00
Chris Lattner
2a1263b1e1 add a fixme for an experiment that defeated me for the time being.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 00:03:03 +00:00
Chris Lattner
23cfda719e contract movechild+checktype into a new checkchild node, shrinking the
x86 table by 1200 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 20:15:25 +00:00
Chris Lattner
22c48b384c split the movechild/record/moveparent -> recordchild optzn into a
movechild/record -> recordchild/movechild and 
movechild/moveparent -> noop xforms.  This slightly shrinks the tables
(x86 to 117454) and enables adding future improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 19:52:48 +00:00
Chris Lattner
09b9f3928e emit a histogram of the opcodes in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 19:17:12 +00:00
Chris Lattner
a86509d436 lets not break the old isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:41:11 +00:00
Chris Lattner
c84edb7bdd Since the new instruction selector now works, I don't need to keep
the old one around for comparative purposes: have the
ENABLE_NEW_ISEL #define (which is not enabled on mainline) stop
emitting the old isel at all, yay for build time win.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:35:09 +00:00
Chris Lattner
19b5a7590b implement a simple proof-of-concept optimization for
the new isel: fold movechild+record+moveparent into a
single recordchild N node.  This shrinks the X86 table
from 125443 to 117502 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:31:45 +00:00
Chris Lattner
91c6a822ba The new isel passes all tests, time to start making it go fast.
Also add an easy macro at the top of DAGISelEmitter.cpp to enable
it.  Lets see if I can avoid accidentally turning it on :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:06:50 +00:00
Chris Lattner
02f73585f7 The new isel was not properly handling patterns that covered
internal nodes with flag results.  Record these with a new 
OPC_MarkFlagResults opcode and use this to update the interior
nodes' flag results properly.  This fixes CodeGen/X86/i256-add.ll
with the new isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 05:33:42 +00:00
Sean Callanan
80443f9146 Changed the table generator so that the X86
disassembler never recognizes InitReg instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97017 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 02:56:25 +00:00
Mikhail Glushenkov
c43012960a Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:05:01 +00:00
Mikhail Glushenkov
1afba8e474 Implement order-preserving option forwarding.
Needed to correctly handle things like 'llvmc -framework Foo foo.o -framework
Bar bar.o' - before this commit all '-framework' options would've been grouped
together in the beginning.

Due to our dependence on CommandLine this turned out to be a giant hack; we will
migrate away from CommandLine eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:57 +00:00
Mikhail Glushenkov
a34f97ab22 Correct option forwarding: initial implementation.
Does not work, but the infrastructure changes are in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
be6ee7c116 New experimental/undocumented feature: 'works_on_empty'.
For now, just enough support to make -filelist work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:28 +00:00
Mikhail Glushenkov
a04d4ed690 Add a way to enable '-opt=foo' forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:04:13 +00:00
Daniel Dunbar
3d4d01bd39 Eliminate llvmgcc_version testing variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:56:28 +00:00
Daniel Dunbar
a2b40a95b2 Kill unused llvmgccmajvers testing variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:56:18 +00:00
Chris Lattner
ba1cff4450 add some #if 0'd out code for checking that named values in
input/output patterns have the same type.  It turns out that 
this triggers all the time because we don't infer types 
between these boundaries.  Until we do, don't turn this on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:50:58 +00:00
Chris Lattner
a27234e290 Reject patterns that use a name multiple times in the src or result
of a pattern and where the uses have different types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:22:28 +00:00
Chris Lattner
4ac7a0ca8f reject patterns that have dead named arguments in the input pattern
this is tidier and can find bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 06:55:24 +00:00
Chris Lattner
967d54ae04 reject patterns that mention a name in the destination pattern
but not in the input.  Previously, this would trigger an abort
late in the isel logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 06:35:45 +00:00
Chris Lattner
25b6f91c54 merge some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 06:16:51 +00:00
Chris Lattner
53d09bd009 more tidying up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 05:59:10 +00:00
Chris Lattner
6eb3012b45 reduce indentation by eliminating 'else after return'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 05:51:07 +00:00
Chris Lattner
860d4a787f really fix an off-by-one error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:07:39 +00:00
Chris Lattner
5007e1e435 switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
VBR encoding for the insanity being perpetrated by the spu backend. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 00:59:59 +00:00
Chris Lattner
3e22f2d489 add a new Push2 opcode for targets (like cellspu) which have
ridiculously ginormous patterns and need more than one byte
of displacement for encodings.  This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 23:55:39 +00:00
Chris Lattner
20df2420f7 Change ComplexPattern handling to push the node being matched as
well as the operands produced when the pattern is matched.  This
allows CheckSame to work correctly when matching replicated 
names involving ComplexPatterns.  This fixes a bunch of MSP430 
failures, we're down to 13 failures, two of which are
due to a sched bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 23:33:44 +00:00
Chris Lattner
12a667c1e8 add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex 
pattern.  This fixes 4 regtest failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 22:30:37 +00:00
Chris Lattner
1f2ed5fe7e When matching patterns that have a complex pattern as their root, make
sure to only run the complex pattern on nodes where the target opts in.
This patch only handles targets with one opcode specified so far, but
fixes 16 failures, only 34 left.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 22:18:05 +00:00
Chris Lattner
565a6f9480 fix most of the failures in the x86 suite by handling multiple
result nodes correctly.  Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without 
eliminating (parallel) from input patterns.  That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 23:54:05 +00:00
Chris Lattner
664012bb64 Always emit register class id references as i32 like
DAGISelEmitter does.  This fixes 11 arm failures (8 
left).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96757 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 20:53:45 +00:00
Chris Lattner
99ce6e8aff Sort the patterns before adding them to the FA so that we get the
least cost matches.  This gets us from 195 -> 208 passes on the ppc codegen tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 19:22:06 +00:00
Chris Lattner
8fbad244bd emit table indexes before each row so that it is debuggable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 07:16:41 +00:00
Chris Lattner
bef2a515f6 fix a table size miscomputation, target opcodes are 2 bytes.
With this, the matcher actually works reasonably well, but
crashes on larger examples in the scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96727 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 06:44:29 +00:00
Chris Lattner
984e18823e emit to the right streams, to avoid emitting the push
body before the push.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 06:30:04 +00:00
Chris Lattner
0ab1c5f8f8 oops don't turn this on for everyone yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 06:03:56 +00:00
Chris Lattner
77f2e2724d implement the last known missing feature: updating uses of results
of the matched pattern to use the newly created node results.  Onto
the "making it actually work" phase!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 06:03:07 +00:00
Chris Lattner
8e946bea14 Lots of improvements to the new dagisel emitter. This gets it to
the point where it is to the 95% feature complete mark, it just
needs result updating to be done (then testing, optimization 
etc).

More specificallly, this adds support for chain and flag handling
on the result nodes, support for sdnodexforms, support for variadic
nodes, memrefs, pinned physreg inputs, and probably lots of other
stuff.

In the old DAGISelEmitter, this deletes the dead code related to
OperatorMap, cleans up a variety of dead stuff handling "implicit
remapping" from things like globaladdr -> targetglobaladdr (which
is no longer used because globaladdr always needs to be legalized),
and some minor formatting fixes.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 03:22:59 +00:00
Chris Lattner
906b4995ee add emitter support for integer constants and simple physreg references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 07:49:56 +00:00
Chris Lattner
01a5bee716 fix this to work more determinstically, patch by Thomas Veith!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 07:02:20 +00:00
Chris Lattner
853b919d93 I confused myself, temporaries will be recorded right along with other inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:33:13 +00:00
Chris Lattner
c94fa4c759 introduce a new ResultVal and start keeping track of temporary values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:27:40 +00:00
Chris Lattner
845c042734 add support for referencing registers and immediates,
building the tree to represent them but not emitting 
table entries for them yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 22:03:03 +00:00
Chris Lattner
b49985a849 start sketching out the structure of code for result emission generation.
Nothing real here yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 06:47:49 +00:00
Chris Lattner
bd8227f529 rename the child field to 'next'. This is not a parent/child
relationship, this is a linear list relationship.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96561 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:53:41 +00:00
Chris Lattner
8ef9c7958a eliminate the MatcherNodeWithChild class, give the 'child'
field to MatcherNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:49:24 +00:00
Chris Lattner
dcdcef2cb3 fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 00:23:27 +00:00
Chris Lattner
03ddb20bfd redisable this to save people a small amount of build time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 19:19:50 +00:00
Chris Lattner
0a3f39985b move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,
and add a sparc implementation that knows about delay slots.  Patch by
Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 18:52:56 +00:00
Chris Lattner
84aa60b522 reduce nesting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 06:53:36 +00:00
Chris Lattner
781f359c1a improve comments, the matcher is now feature complete, on to codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 06:47:35 +00:00
Chris Lattner
409ac586e8 sink special case "cannotyetselect" for intrinsics out of the
tblgen splatted code into the implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 06:28:22 +00:00
Chris Lattner
9a747f1305 Emulate the current isel's "IsChainCompatible" logic for now.
I'd like to eventually rip it out, but for now producing the
same selections as the old matcher is more important.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 06:23:39 +00:00
Chris Lattner
8dc4f2bb60 properly record chain inputs to complex patterns,
resolving a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 06:08:25 +00:00
Chris Lattner
d9c1a344a0 simplify IsChainCompatible codegen, add comments. no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 05:35:28 +00:00
Chris Lattner
785d16fe75 Prep work to handle input chains of matched patterns and checking for
'ischaincompatible' when a pattern has more than one input chain.  Need
to do some commenting and cleanup now that I understand how this works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:16:19 +00:00
Chris Lattner
2f7ecdeb1d record input chains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96437 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:34:15 +00:00
Chris Lattner
c642b84fb8 prefix captured value names with $ so they look like
variables.  Use the fancy OpNo variable instead of i,
which has the right index including chains.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:27:29 +00:00
Chris Lattner
c96087b343 improve comments on OPC_Record to say what we're recording a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:03:09 +00:00
Chris Lattner
5be6e5990b improve comments in generated matcher a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:39:26 +00:00
Chris Lattner
e609a513f3 make the new isel generator plop out a CheckComplexPattern function
for evaluating complex patterns.  Some cleanup has to happen before
this can be used though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:31:50 +00:00
Chris Lattner
c2676b2909 fix inverted condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:11:30 +00:00
Chris Lattner
53a2f60062 complex patterns don't get 'record' nodes, they implicitly
record all their results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 23:16:25 +00:00
Chris Lattner
05446e7d47 clean up some code, eliminate NodeIsComplexPattern, which
does the same thing as getComplexPatternInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96411 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 23:13:59 +00:00
Chris Lattner
5b08f77096 fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 22:38:31 +00:00
Chris Lattner
92d3ada814 fix rdar://7653908, a crash on a case where we would fold a load
into a roundss intrinsic, producing a cyclic dag.  The root cause
of this is badness handling ComplexPattern nodes in the old dagisel
that I noticed through inspection.  Eliminate a copy of the of the
code that handled ComplexPatterns by making EmitChildMatchCode call
into EmitMatchCode.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 22:35:06 +00:00
Chris Lattner
6bc1b51377 simplify this code. In the new world order there is no
need to scan the entire subtree of the pattern anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 19:19:58 +00:00
Chris Lattner
21390d7984 convert the new matcher to check intermediate nodes for a single
use and only call IsProfitableToFold/IsLegalToFold on the load
being folded, like the old dagiselemitter does.  This 
substantially simplifies the code and improves opportunities for
sharing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 19:15:55 +00:00
Chris Lattner
29c6270328 change dag isel emitter to only call 'IsProfitableToFold' on nodes
with chains.  On interior nodes that lead up to them, we just directly
check that there is a single use.  This generates slightly more
efficient code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 19:03:34 +00:00
Chris Lattner
ccba15f914 mark all the generated node predicates 'const'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 07:26:36 +00:00
Chris Lattner
050a03d0f3 generate code for node and pattern predicates. Note that this won't
build if enabled, it will fail with constness issues. I'll resolve 
these next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 07:21:10 +00:00
Chris Lattner
e02ea54cfd refactor some code into a local class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:52:01 +00:00
Chris Lattner
e2de49d9a1 remove now dead code and fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:15:00 +00:00
Chris Lattner
6e6975d419 remove dead code. This is never generated for any targets in mainline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:14:22 +00:00
Chris Lattner
e39650a805 add support for the new isel matcher to generate
(isprofitable|islegal)tofold checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:10:58 +00:00
Evan Cheng
014bf215c3 Split SelectionDAGISel::IsLegalAndProfitableToFold to
IsLegalToFold and IsProfitableToFold. The generic version of the later simply checks whether the folding candidate has a single use.

This allows the target isel routines more flexibility in deciding whether folding makes sense. The specific case we are interested in is folding constant pool loads with multiple uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 19:41:07 +00:00
Chris Lattner
da272d1a70 Check in the first big step of rewriting DAGISelEmitter to
produce a table based matcher instead of gobs of C++ Code.

Though it's not done yet, the shrinkage seems promising,
the table for the X86 ISel is 75K and still has a lot of 
optimization to come (compare to the ~1.5M of .o generated
the old way, much of which will go away).

The code is currently disabled by default (the #if 0 in
DAGISelEmitter.cpp).  When enabled it generates a dead
SelectCode2 function in the DAGISel Header which will
eventually replace SelectCode.

There is still a lot of stuff left to do, which are
documented with a trail of FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 08:04:42 +00:00
Mikhail Glushenkov
0b1a39577b Revert r96130 ("Forward parameter options as '-option=param'").
This behaviour must be configurable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 03:17:06 +00:00
Chris Lattner
751d5aa1ea constize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 22:33:49 +00:00
Chris Lattner
4766132036 clean up a bunch of code, move some random predicates
on TreePatternNode to be methods on TreePatternNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 22:22:58 +00:00
Chris Lattner
c87bf389dc remove the DisablePatternForFastISel predicate, which is a check
that predated -fast-isel which attempted to speed up the dag pattern
matchers at -O0.  Since fast-isel is around, this is basically 
obsolete and removing it shrinks the generated dag isels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 21:11:53 +00:00
Chris Lattner
383fed9c7a add an insertion operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 21:10:33 +00:00
Chris Lattner
523f6a5848 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 21:10:15 +00:00
Mikhail Glushenkov
18c67b994c Forward parameter options as '-option=parameter'.
Some tools do not like the '-option parameter' form. Should this be
configurable?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 22:37:28 +00:00
Chris Lattner
a0cdf17f37 pull a bunch of huge inline methods in the PatternCodeEmitter
class out of line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 20:06:50 +00:00
Sean Callanan
cebe955779 Added the rdtscp instruction to the x86 instruction
tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 02:06:11 +00:00
Sean Callanan
95a5a7d570 Fixed encodings for invlpg, invept, and invvpid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 01:48:34 +00:00
Chris Lattner
a599de2410 remove special cases for vmlaunch, vmresume, vmxoff, and swapgs
fix swapgs to be spelled right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 00:41:14 +00:00
Chris Lattner
eaca5fa8e6 Remove special cases for [LM]FENCE, MONITOR and MWAIT from
encoder and decoder by using new MRM_ forms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:54:57 +00:00
Sean Callanan
9492be8d10 Reworked the Intel disassembler to support instructions
whose opcodes extend into the ModR/M field using the
Form field of the instruction rather than by special
casing each instruction.  Commented out the special
casing of VMCALL, which is the first instruction to use
this special form.  While I was in the neighborhood,
added a few comments for people modifying the Intel
disassembler. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:39:46 +00:00
Chris Lattner
0d8db8e0a8 add a bunch of mod/rm encoding types for fixed mod/rm bytes.
This will work better for the disassembler for modeling things
like lfence/monitor/vmcall etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 02:06:33 +00:00
Daniel Dunbar
3b6910dcd4 MC: Fix bug where trailing tied operands were forgotten; the X86 assembler
matcher is now free of implicit operands!
 - Still need to clean up the code now that we don't to worry about implicit
   operands, and to make it a hard error if an instruction fails to specify all
   of its operands for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 01:46:54 +00:00
Chris Lattner
0d7b0aa760 enhance llvm-mc -show-inst to print the enum of an instruction, like so:
testb	%al, %al                ## <MCInst #2412 TEST8rr
                                        ##   <MCOperand Reg:2>
                                        ##   <MCOperand Reg:2>>
	jne	LBB1_7                  ## <MCInst #938 JNE_1
                                        ##   <MCOperand Expr:(LBB1_7)>>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 22:57:32 +00:00
Chris Lattner
e555c9f4a5 work around a gcc bug with -Wuninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 21:22:51 +00:00
Daniel Dunbar
cacaa5bff2 lit: Ignore dot files when scanning for tests (e.g., editor temprary files,
etc.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 21:00:55 +00:00
Daniel Dunbar
bef529182f MC/AsmMatcher: Tweak conversion function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 21:00:47 +00:00
Daniel Dunbar
af61681ced MC/AsmMatcher: Add support for creating tied operands when constructing MCInsts.
- Pretty messy, but we need to rework how we handle tied operands in MCInst
   anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 08:15:48 +00:00
Daniel Dunbar
3f451cafb5 Remove stray DOS newline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 04:10:10 +00:00
Sean Callanan
cf57c7084a Updated the enhanced disassembly library's TableGen
backend to not use exceptions at all except in cases
of actual error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 03:23:23 +00:00
Sean Callanan
2db6ff2285 Updated the TableGen emitter for the Enhanced
Disassembler to take advantage of the refactored
AsmWriterInst.h.  Note removed parser code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 02:47:08 +00:00
Sean Callanan
397170b0ab Changed AsmWriterOperand to also include the index of the
operand into the CodeGenInstruction's list of operands,
which is useful for EDEmitter.  (Still working on PR6219)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 02:27:43 +00:00
Chris Lattner
a7d479c7bd Introduce a new CodeGenInstruction::ConstraintInfo class
for representing constraint info semantically instead of
as a c expression that will be blatted out to the .inc
file.  Fix X86RecognizableInstr to use this instead of
parsing C code :).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 01:45:28 +00:00
Sean Callanan
d0bc7f060e Fixed some indentation in the AsmWriterInst
implementation.  Also changed the constructor
so that it does not require a Record, making it
usable by the EDEmitter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 23:06:35 +00:00
Sean Callanan
3ac97b386b Added AsmWriterInst.cpp to the CMakeList so that
it builds OK on Visual Studio.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 22:29:16 +00:00
Sean Callanan
d32c02f314 Per PR 6219, factored AsmWriterInst and AsmWriterOperand
out of the AsmWriterEmitter.  This patch does the physical
code movement, but leaves the implementation unchanged. I'll
make any changes necessary to generalize the code in a
separate patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 21:50:41 +00:00
Chris Lattner
518bb53485 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 19:54:29 +00:00
Chris Lattner
b8d6e98e56 pass stringref by value instead of by const&
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 00:34:28 +00:00
Jakob Stoklund Olesen
570a4a5d9c Reintroduce the InlineHint function attribute.
This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 01:16:28 +00:00
Jeffrey Yasskin
8d280fb50a Make lit's gtest support honor config.environment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 18:09:19 +00:00
Torok Edwin
18743f4502 New flag for GenLibDeps, and llvm-config-perobjincl.
This allows to show the explicit files that need to be built/linked to get an
LLVM component.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 09:31:35 +00:00
Chris Lattner
0d883e3f84 sink handling of target-independent machine instrs (other
than DEBUG_VALUE :(  ) into the target indep AsmPrinter.cpp
file.   This allows elimination of the 
NO_ASM_WRITER_BOILERPLATE hack among other things.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 01:00:52 +00:00
Daniel Dunbar
e1f6de3fbd AsmMatcherEmitter: Use stable_sort when reordering instructions, so that order
is still deterministic even amongst ambiguous instructions (eventually ambiguous
match orders will be a hard error, but we aren't there yet).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 23:46:36 +00:00
Daniel Dunbar
a2f5e00347 AsmMatcher: Create operand classes before use, apparently records aren't visited
in the order they were declared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 01:02:37 +00:00
Daniel Dunbar
0806f9ff58 FileCheck: When looking for "possible matches", only compare against the prefix
line. Turns out edit_distance can be slow if the string we are scanning for
happens to be quite large.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 00:24:06 +00:00
Dan Gohman
e3a1e50680 Minor code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 21:57:46 +00:00
Dan Gohman
d8a5541a51 Skip whitespace when looking for a potential intended match.
Before:

<stdin>:94:1: note: possible intended match here
 movsd 4096(%rsi), %xmm0
^

After:
<stdin>:94:2: note: possible intended match here
 movsd 4096(%rsi), %xmm0
 ^


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 21:55:16 +00:00
Dan Gohman
e546343799 Fix the position of the caret in the FileCheck error message.
Before:

test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
                                 ^

After:

test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
         ^


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 21:53:18 +00:00
Daniel Dunbar
8cdf54c222 FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.
- Thanks Doug, who is obviously less lazy than me!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 03:22:19 +00:00
Sean Callanan
9988ab0496 Quick fix to make the header file for the enhanced
disassembly information have a better comment (and
better guard macros).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 01:34:29 +00:00
Ted Kremenek
a78def9680 Recognize 'add_executable' when analyzing CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 01:10:55 +00:00
Ted Kremenek
55b88096aa Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 01:10:25 +00:00
Sean Callanan
95fcebd5c4 Added a custom TableGen backend to support the
enhanced disassembler, and the necessary makefile
rules to build the table for X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 00:21:04 +00:00
Mikhail Glushenkov
ae779383be Escape double quotes in 'help'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 14:55:04 +00:00
Chris Lattner
43b5f9312d make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:43:08 +00:00
Sean Callanan
e9b466d4f0 Modified the register matcher function in AsmMatcher to
be static.  Also made it possible for clients to get it
and no other functions from ...GenAsmMatcher.inc by
defining REGISTERS_ONLY before including GenAsmMatcher.inc.
This sets the stage for target-specific lexers that can
identify registers and return AsmToken::Register as
appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 00:40:33 +00:00
Daniel Dunbar
1402f0b2ca AsmMatcher: Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 00:26:16 +00:00
Daniel Dunbar
f63623fb3f Make GetSourceVersion more portable, thanks Pawel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 18:14:21 +00:00
Daniel Dunbar
eab04fc0be lit: Separate test suite from test name with spaces, to make it easier to cut and paste.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 02:04:28 +00:00
Daniel Dunbar
e40eb09e5e Add a simple script for getting a version tag from a svn/git-svn/git
repository. Feel free to add support for your favorite VCS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:09:59 +00:00
Bob Wilson
ce8febefa5 The change in r90189 adds a link in a directory outside the iPhone platform
directory when building the llvmCore_Embedded project.  Fix this by putting
the iPhone platform directory into DEST_DIR instead of DEST_ROOT.  I also
noticed what appears to be an unintentional use of DEVELOPER_BIN instead of
DEVELOPER_DIR, so I fixed that and changed to use DEVELOPER_DIR in some places
that were hardcoded to "Developer".  Finally, the other changes here allowed
some refactoring and simplification, which I have done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 16:42:10 +00:00
Chris Lattner
2d53c21eca update mkpatch, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 21:09:05 +00:00
Eric Christopher
606a1d1f59 Remove the InlineHint attribute. There are no current or planned
users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:36:30 +00:00
Dale Johannesen
243a32f96b Remove DEBUG_DECLARE, looks like we don't need it.
Also, DEBUG_VALUE has side effects.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:50:44 +00:00
Chris Lattner
9898671a74 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:21:20 +00:00
Bill Wendling
dfe7281fab Use ENABLE_ASSERTIONS throughout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 10:19:55 +00:00
Stuart Hastings
b7eaa130d0 Erm, previous patch was wrong; Thanks Bill\!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 00:34:53 +00:00
Stuart Hastings
ee6c04e245 Enable assertions by default for Apple-style builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 00:22:05 +00:00
Benjamin Kramer
d4f195999a Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:03:24 +00:00
Dan Gohman
7a523dde57 Tighten up the vim LLVM IR syntax highlighting regex for labels, and add a
highlighting rule for identifiers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 17:22:48 +00:00
Dan Gohman
acb75a9d70 Set the vim auto-indent setting for open braces after case statements to
follow LLVM source convention.

Before:
  case X: {
            stuff;
          }

After:
  case X: {
    stuff;
  }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 17:15:21 +00:00
Dale Johannesen
d2035203a0 Add DEBUG_DECLARE. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 01:24:25 +00:00
Dale Johannesen
87563b3937 Add DEBUG_VALUE. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 23:51:25 +00:00
Duncan Sands
7c422ac216 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 08:45:52 +00:00
Dan Gohman
7c3ecb6838 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 22:26:32 +00:00
David Greene
6786d5e183 Add an !eq() operator to TableGen. It operates on strings only.
Use !cast<string>() to compare other types of objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 19:11:42 +00:00
David Greene
f0fd3afeff Have TableGen emit code that uses dbgs() rather than errs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 17:47:41 +00:00
Dan Gohman
eeb3a00b84 Change SelectCode's argument from SDValue to SDNode *, to make it more
clear what information these functions are actually using.

This is also a micro-optimization, as passing a SDNode * around is
simpler than passing a { SDNode *, int } by value or reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:24:18 +00:00
Daniel Dunbar
5ddcd6be8f tblgen/OptParser: Use EmitSourceFileHeader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 22:03:51 +00:00
Dan Gohman
ba7a662f54 Replace some special-case code which probably was buggy with an assertion
verifying that the special case does not occur.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 20:36:57 +00:00
Dan Gohman
537ab90d8d Remove the CPAttrParentAsRoot code, which is unused, and inconvenient
for a refactoring I'm working on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 20:31:55 +00:00
Mikhail Glushenkov
b7935e00eb Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 04:40:54 +00:00
Mikhail Glushenkov
d64c90776e Make CheckForSuperfluousOptions handle list form of 'switch_on' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 03:51:02 +00:00
Mikhail Glushenkov
3a481e38c9 Minor simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 03:50:51 +00:00
Mikhail Glushenkov
163dd597c9 Better error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 03:50:34 +00:00
Daniel Dunbar
9ac75ca0bf lit: Add setuptools support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-26 22:58:39 +00:00
Daniel Dunbar
d24f1f342a lit: Sink code into a 'lit' package.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-26 22:58:23 +00:00
Bill Wendling
7529ece7af Use the 'MadeChange' variable instead of returning 'false' all of the time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92155 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 13:35:40 +00:00
Daniel Dunbar
96a47829c8 Don't emit trailing semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 17:49:28 +00:00
Mikhail Glushenkov
9bef1bdcf5 Cosmetic issue: more consistent naming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 12:49:41 +00:00
Mikhail Glushenkov
e0b6570d24 Allow (set_option SwitchOption, true).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 12:49:30 +00:00
Daniel Dunbar
e5976b8c5c Suppress compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 00:45:10 +00:00
Sean Callanan
7fb35a2fd8 Fixes to the X86 disassembler:
Made LEA memory operands emit only 4 MCInst operands.
Made the scale operand equal 1 for instructions that have no
SIB byte.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 21:12:55 +00:00
David Greene
f660802f34 Fix a bug in !subst where TableGen would go and resubstitute text it had
just substituted.  This could cause infinite looping in certain
pathological cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 21:21:34 +00:00
Chris Lattner
349d8489b2 .llx is no more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 20:56:53 +00:00
Nuno Lopes
014dc70907 fix build and while at it remove a redudant include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 11:52:18 +00:00
Daniel Dunbar
8783087f69 More bzero -> memset that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:16:57 +00:00
Daniel Dunbar
9e6d1d1f50 Add missing newlines at EOF (for clang++).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:16:48 +00:00
Sean Callanan
8ed9f51663 Table-driven disassembler for the X86 architecture (16-, 32-, and 64-bit
incarnations), integrated into the MC framework.  

The disassembler is table-driven, using a custom TableGen backend to 
generate hierarchical tables optimized for fast decode.  The disassembler 
consumes MemoryObjects and produces arrays of MCInsts, adhering to the 
abstract base class MCDisassembler (llvm/MC/MCDisassembler.h).

The disassembler is documented in detail in

- lib/Target/X86/Disassembler/X86Disassembler.cpp (disassembler runtime)
- utils/TableGen/DisassemblerEmitter.cpp (table emitter)

You can test the disassembler by running llvm-mc -disassemble for i386
or x86_64 targets.  Please let me know if you encounter any problems
with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 02:59:52 +00:00
Dan Gohman
2929e1143a Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:46:09 +00:00
Eli Friedman
5760f35e15 Fix an issue in googletest where a name was used before it was defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 21:38:44 +00:00
Mikhail Glushenkov
9503b49462 Make 'set_option' work with list options.
This works now: (set_option "list_opt", ["val_1", "val_2", "val_3"])

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 11:27:26 +00:00
Mikhail Glushenkov
994dbe0073 Add a 'set_option' action for use in OptionPreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 07:49:16 +00:00
Mikhail Glushenkov
24723288a2 Refactoring, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 07:48:49 +00:00
Mikhail Glushenkov
2d366a21a1 s/TokenizeCmdline/TokenizeCmdLine/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 07:48:34 +00:00
Jim Grosbach
06801722a4 Add @earlyclobber TableGen constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 19:43:02 +00:00
Bill Wendling
0a0124e4f6 Remove superfluous 'extern' variable that was causing a warning with clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 19:36:42 +00:00
Bill Wendling
6be413dd64 Some command lines don't like numbers with leading zeros. Remove them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:42:19 +00:00
Daniel Dunbar
99ea6898e1 lit: Improve error when gtest discovery fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:00:37 +00:00
Dan Gohman
9b03da6824 Revert 90628, which was incorrect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:21:44 +00:00
Jim Grosbach
f0a4fad995 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 19:28:13 +00:00
Mikhail Glushenkov
f8bc1e4b27 Convert llvmc tests to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:21:14 +00:00
Mikhail Glushenkov
545f96814b Support hook invocation from 'append_cmd'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:20:50 +00:00
Mikhail Glushenkov
e4ac23a0ff Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:

- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:52 +00:00
Mikhail Glushenkov
abf2d986c9 Allow $CALL(Hook, '$INFILE') for non-join tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:02 +00:00
Daniel Dunbar
9682043ab5 NNT: Make sure stderr for build commands goes to log file, as intended but misdirected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 00:41:47 +00:00
Daniel Dunbar
252a0dfa6a NNT: Use [e]grep -a when scanning logs, its possibly they will have non-text
characters in them, in which case the grep will just return 'Binary file
matches' and the whole thing falls over.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91302 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:58:33 +00:00
Daniel Dunbar
1b54d423aa NNT: Always create the -sentdata.txt file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:58:27 +00:00
Daniel Dunbar
e854273892 Remove unneeded ';' and a class/struct mismatch (noticed by clang).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:58:09 +00:00
Daniel Dunbar
32c9800a16 lit: Prevent crash-on-invalid (when run on directory which has no test suite).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 19:49:30 +00:00
Mikhail Glushenkov
bc39a795f4 Simplify a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:16:13 +00:00
Mikhail Glushenkov
06d266170b Throw 'const char*' instead of 'std::string'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:15:57 +00:00
Mikhail Glushenkov
5b9b3ba2ba Deprecate 'unpack_values'.
Use 'forward_values' + 'comma_separated' instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov
8245a1dd53 Implement 'forward_value' and 'forward_transformed_value'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 17:03:05 +00:00
Mikhail Glushenkov
632eb20c34 Refactoring, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 10:51:55 +00:00
Dan Gohman
7004b9cf33 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:05:43 +00:00
Daniel Dunbar
d90ade54cd OptParser: Emit HelpText field for option groups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:41:24 +00:00
Mikhail Glushenkov
97955005b3 Forward -save-temps to llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:51:30 +00:00
Eric Christopher
c39d9536f7 Add a soft link so that in an apple style build we can find libLTO.dylib.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 02:26:01 +00:00
Daniel Dunbar
a76a7883b5 Fix FileCheck crash when fuzzy scanning starting at the end of the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 08:30:24 +00:00
Daniel Dunbar
405887419f Sketch TableGen disassembler emitter, based on patch by Sean Callanan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 02:13:23 +00:00
Dan Gohman
9e763b88b0 Delete some dead and non-obvious code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 01:48:15 +00:00
Dan Gohman
735afe14ee Remove ISD::DEBUG_LOC and ISD::DBG_LABEL, which are no longer used.
Note that "hasDotLocAndDotFile"-style debug info was already broken;
people wanting this functionality should implement it in the
AsmPrinter/DwarfWriter code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 23:20:51 +00:00
Daniel Dunbar
ead2dacc9e FileCheck, PR5239: Try to find the intended match on failures, but looking for a
good nearby fuzzy match. Frequently the input is nearly correct, and just
showing the user the a nearby sensible match is enough to diagnose the problem.
 - The "fuzzyness" is pretty simple and arbitrary, but worked on my three test
   cases. If you encounter problems, or places you think FileCheck should have
   guessed but didn't, please add test cases to PR5239.

For example, previously FileCheck would report this:
--
t.cpp:21:55: error: expected string not found in input
// CHECK: define void @_Z2f25f2_s1([[i64_i64_ty]] %a0)
                                                      ^
<stdin>:19:30: note: scanning from here
define void @_Z2f15f1_s1(%1) nounwind {
                             ^
<stdin>:19:30: note: with variable "i64_i64_ty" equal to "%0"
--

and now it also reports this:
--
<stdin>:27:1: note: possible intended match here
define void @_Z2f25f2_s1(%0) nounwind {
^
--

which makes it clear that the CHECK just has an extra ' %a0' in it, without
having to check the input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 22:59:26 +00:00
Daniel Dunbar
fafe93c8bc FileCheck: When a string using variable references fails to match, print
additional information about the current definitions of the variables used in
the string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 22:08:06 +00:00
Daniel Dunbar
964ac01201 Allow '_' in FileCheck variable names, it is nice to have at least one
separate character.
 - Chris, OK?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 22:07:50 +00:00
Bob Wilson
21870411d9 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 04:24:42 +00:00
Bob Wilson
2214dc0764 Fix pr5470. Tablegen handles template arguments by temporarily setting their
values, resolving references to them, and then removing the definitions.
If a template argument is set to an undefined value, we need to resolve
references to that argument to an explicit undefined value.  The current code
leaves the reference to the template argument as it is, which causes an
assertion failure later when the definition of the template argument is
removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 03:58:57 +00:00
Bob Wilson
a8449e6aaa Fix some spelling in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 22:44:20 +00:00
Bob Wilson
8478a5bcfb Avoid a redundant assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89565 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 22:39:27 +00:00
Daniel Dunbar
a627ef57ec TableGen/OptParser: When ordering options, make "sentinel" options appear before
everything else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 18:22:16 +00:00
Douglas Gregor
74f2ca8c4a De-bork CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 23:20:09 +00:00
Daniel Dunbar
2d6a8fb827 TableGen: Add initial backend for clang Driver's option parsing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 21:29:51 +00:00
Daniel Dunbar
a7193e40e2 lit: Fix exclude dirs functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 17:42:17 +00:00
Jeffrey Yasskin
d1ba06bf13 Make X86-64 in the Large model always emit 64-bit calls.
The large code model is documented at
http://www.x86-64.org/documentation/abi.pdf and says that calls should
assume their target doesn't live within the 32-bit pc-relative offset
that fits in the call instruction.

To do this, we turn off the global-address->target-global-address
conversion in X86TargetLowering::LowerCall(). The first attempt at
this broke the lazy JIT because it can separate the movabs(imm->reg)
from the actual call instruction. The lazy JIT receives the address of
the movabs as a relocation and needs to record the return address from
the call; and then when that call happens, it needs to patch the
movabs with the newly-compiled target. We could thread the call
instruction into the relocation and record the movabs<->call mapping
explicitly, but that seems to require at least as much new
complication in the code generator as this change.

To fix this, we make lazy functions _always_ go through a call
stub. You'd think we'd only have to force lazy calls through a stub on
difficult platforms, but that turns out to break indirect calls
through a function pointer. The right fix for that is to distinguish
between calls and address-of operations on uncompiled functions, but
that's complex enough to leave for someone else to do.

Another attempt at this defined a new CALL64i pseudo-instruction,
which expanded to a 2-instruction sequence in the assembly output and
was special-cased in the X86CodeEmitter's emitInstruction()
function. That broke indirect calls in the same way as above.

This patch also removes a hack forcing Darwin to the small code model.
Without far-call-stubs, the small code model requires things of the
JITMemoryManager that the DefaultJITMemoryManager can't provide.

Thanks to echristo for lots of testing!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:41:33 +00:00
Daniel Dunbar
2cb097d5cd lit: Factor a new OneCommandPerFileTest out of SyntaxCheckTest.
- Used for running a single fixed command on a directory of files, with the
   option of deriving a temporary input file from the test source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 08:10:29 +00:00
Daniel Dunbar
048bac35df Remove duplicate implementation of excludes functionality, and support excluding
dirnames.

Also, add support for the 'unsupported' config property.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 07:22:58 +00:00
Daniel Dunbar
40c67b5832 lit: Add --repeat=N option, for running each test N times.
- Currently just useful for timing, although it could be extended as one (bad) way to deal with flaky tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 01:02:09 +00:00
Benjamin Kramer
f2a39bd24f Implement DISABLE_INLINE for MSVC. This required changing the position in all
forward declaration and patching tblgen to emit it right. Patch by Amine Khaldi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 16:37:18 +00:00
Evan Cheng
fae3e92345 Added getSubRegIndex(A,B) that returns subreg index of A to B. Use it to replace broken code in VirtRegRewriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 03:42:17 +00:00
Sandeep Patel
bf177ee6fd Show command-line args and features passed into backend in debug output. Approved by Evan Cheng.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:23:46 +00:00
Daniel Dunbar
6c1c9cfc65 lit: Add ExampleTests, for testing lit and demonstrating test suite features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:41:17 +00:00
Daniel Dunbar
972cc05c23 lit: Fix bug in --show-suites which accidentally override the list of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:40:21 +00:00
Daniel Dunbar
7e3089d3c6 Add a 'zkill' script, which is more-or-less a fancy (although not necessarily
very robust) version of killall. Because I like making shiny new wheels out of
spare parts.

For use by buildbots when people insist on making cc1 infinite loop. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 21:51:53 +00:00
Anton Korobeynikov
c2fd919ea2 It is invalid to infer the value type from the result #0 of the node
since the instruction might use the other result of different type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 12:14:54 +00:00
Daniel Dunbar
539e187acb NNT: Remove DejaGNU test from NewNightlyTest reports, this aspect of testing is
handled by buildbots now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:34:14 +00:00
Daniel Dunbar
bf477df346 lit: Hardcode whence seek value, os.SEEK_END isn't always available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:07:33 +00:00
Daniel Dunbar
1bf013904f lit: Warn when a test suite contains no tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:07:26 +00:00
Daniel Dunbar
ee504b8cd7 lit: Drop require_and_and support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:07:13 +00:00
Daniel Dunbar
474f0df3ac lit: Workaround a Win32/subprocess bug when appending.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 03:43:06 +00:00
Daniel Dunbar
2d01b26ce7 lit: Preserve the PATHEXT variable when running subcommands, this is important on Win32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 03:35:19 +00:00
Chris Lattner
c128b3e74e clang++ points out that this is pointless.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 06:33:01 +00:00
Daniel Dunbar
6580da4755 NewNighlytTest: Fix timestamp format to actually make sense (it was missing the hour).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 04:12:13 +00:00
Daniel Dunbar
da420eea7d NewNightlyTest: Add -noclean option, which doesn't run 'make clean' before building LLVM (for testing).
Also, switch to always running 'make clean' in the test-suite directories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 04:12:07 +00:00
Daniel Dunbar
fe1974a187 NewNightlyTest: Unbreak passing the build directory via a positional argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 04:12:02 +00:00
Daniel Dunbar
2d7adb5f5a NewNightlyTest: Add -llvmgccdir as alternative to environment variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 04:11:29 +00:00
Dan Gohman
42046abd1f Don't print a redundant tab for inline asm, and do use the new printKill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 00:19:43 +00:00
Douglas Gregor
489b83302c Teach lit's SyntaxCheckTest two new tricks:
- skip .svn directories
  - add a set of excluded filenames so we can easily skip tests



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 22:58:04 +00:00
Daniel Dunbar
f626167e69 lit: Add --param NAME=VALUE option, for test suite specific use (to communicate
arbitrary command line arguments to the test suite).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 16:27:33 +00:00
Evan Cheng
17fc13f00a Look for llvm-gcc under /Developer/usr/bin first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 08:36:50 +00:00
Bill Wendling
7fc4026d97 Use llvm-gcc on newer Darwins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 22:50:10 +00:00
Chris Lattner
ec8e1b709e mark some constant global const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 18:30:31 +00:00
Daniel Dunbar
42543b7b73 lit: Update Clang's test style to use XFAIL: and XTARGET: lines that match
LLVM's tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 07:26:38 +00:00
Ted Kremenek
f7dd3ebf52 Support updating 'llvm_add_target' lists as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85860 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 04:06:58 +00:00
Jim Grosbach
ec2d49e79f Missing bit of universal built + hosted
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 03:46:35 +00:00
Anton Korobeynikov
3a639a07ea Do not infer the target type for COPY_TO_REGCLASS from dest regclass, this won't work if it can contain several types. Require explicit result type for the node for now. This fixes PR5364.
PS: It seems that blackfin usage of copy_to_regclass is completely bogus!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 00:11:39 +00:00
Jim Grosbach
58c4723662 The universal SDKROOT should only be assigned when hosted. Otherwise the
SDKROOT can refer to the target when we're building for the host.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 18:00:10 +00:00
Jim Grosbach
669327b9fb Allow cross target build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 20:54:59 +00:00
Dan Gohman
8c2b52552c Initial target-independent CodeGen support for BlockAddresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:27:03 +00:00
Dan Gohman
e1f188fe27 Move some code from being emitted as boilerplate duplicated in every
*ISelDAGToDAG.cpp to being regular code in SelectionDAGISel.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 22:30:23 +00:00
Dan Gohman
533297b58d Rename usesCustomDAGSchedInserter to usesCustomInserter, and update a
bunch of associated comments, because it doesn't have anything to do
with DAGs or scheduling. This is another step in decoupling MachineInstr
emitting from scheduling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 18:10:34 +00:00
Johnny Chen
f7bb23f343 Sorry to break the build.
I was trying to check the WIP file to some local repository, but ended up
checking in the llvm repository.  Oops!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:04:53 +00:00
Johnny Chen
1846dfa450 Minor tweak to forgo the the curly braces for most case blocks, except when
declaring local variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:45:07 +00:00
Dan Gohman
6b3bd7bbde Add indirectbr and blockaddress to the vim syntax highlighting file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:14:44 +00:00
Mikhail Glushenkov
d5a72d9642 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 09:02:49 +00:00
Julien Lerouge
cadd4b9ced Remove / use flags that are now set in the Makefile.config.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 20:01:35 +00:00
Chandler Carruth
8b67f774e9 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 01:35:46 +00:00
Daniel Dunbar
edb8997821 lit: Add --config-prefix option, to override default config file names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 03:30:55 +00:00
Daniel Dunbar
6efba21342 lit: Allow use of /dev/null in redirects on Windows (replace by a temporary
file).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 01:37:26 +00:00
Dan Gohman
a7f1d72d09 Delete a spurious semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:24:45 +00:00
Daniel Dunbar
a3f85d206a lit: Support '>>' redirections when executing scripts internally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 20:32:49 +00:00
Victor Hernandez
66284e063a Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 04:23:03 +00:00
Stuart Hastings
4a53e1ef9d Trying again to tweak the top-level Makefile to facilitate an Apple-style build.
Now with Clang-compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 17:22:37 +00:00
Mikhail Glushenkov
b6c3483905 Make 'unset_option' work on list options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 04:15:07 +00:00
Chris Lattner
69412f81fc Set comment string, patch by Johnny Chen!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 05:07:57 +00:00
Mikhail Glushenkov
4858a1d51e Implement any_[not_]empty and list versions of switch_on and [not_]empty.
Useful for OptionPreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 02:13:13 +00:00
Daniel Dunbar
80dd453b74 NNT: Implement "config mode", use -config path/to/llvm-config
- This runs the nightly test and does all the submission logic, but using the
   LLVM build specified by the llvm-config.

 - Useful for, among other things, testing NNT itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 07:30:54 +00:00
Daniel Dunbar
f27413866a NNT: Remove unused BUILDTYPE argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 07:30:46 +00:00
Daniel Dunbar
9a6d88d38b Revert "Tweak top-level Makefile to facilitate Apple-style build.", this is
breaking Clang's Apple-style build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 02:23:13 +00:00
Daniel Dunbar
9fb0b7ef35 NNT: Remove duplicate verbose print.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 02:23:05 +00:00
Mikhail Glushenkov
ccef6dec0c More refactoring...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 21:24:28 +00:00
Stuart Hastings
93d8cd8072 Tweak top-level Makefile to facilitate Apple-style build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 17:53:54 +00:00
Daniel Dunbar
ddef095d4d NNT: Add -parallel-test option, which runs llvm-test with
ENABLE_PARALLEL_REPORT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:56 +00:00
Daniel Dunbar
2bb4c53ef6 NNT: Don't hard code -l3.0 argument to make, this is very server dependent. Users who care can use -compileflags for this.
Also, fix make clean call and a few other tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:50 +00:00
Daniel Dunbar
ac0c064e9d NNT: Fix refactoro, I dropped the list of all (llvm-test) tests. I'm sure it was named dejagnu_test_list for a good reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:44 +00:00
Daniel Dunbar
1409c131b6 NNT: Lift conditional logic out of test steps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:38 +00:00
Daniel Dunbar
5381eb72e6 NNT: Now that build & test steps are factored out, coalesce all the logic together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:31 +00:00
Daniel Dunbar
4a338bf227 NNT: Sink code for running nightly test into subroutine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:25 +00:00
Daniel Dunbar
3431123f36 NNT: Tweaks and simplifications.
- Split out configure log.
 - Kill off GetRegexNum.
 - Fix GetRegex to not return previous match on failure.
 - Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84491 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:19 +00:00
Daniel Dunbar
439801e1b4 NNT: Move build code into subroutine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:13 +00:00
Daniel Dunbar
8df92e8d8b NNT: Move source checkout code into subroutine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84489 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:06 +00:00
Daniel Dunbar
7f0e81f736 NNT: Remove .{o,a} size info, this is better tracked elsewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:20:00 +00:00
Daniel Dunbar
7a1e60a581 NNT: Remove code to track build warnings, the buildbots cover this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 13:19:53 +00:00
Daniel Dunbar
0e9fe69ae8 NNT: Remove hard coded BuildDir and WebDir, users should have to specify these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 09:19:19 +00:00
Daniel Dunbar
7c9eb9ebab NNT: Remove "CVS Stats", this isn't particularly useful and can be better done by the server or user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 09:19:09 +00:00
Daniel Dunbar
2e10794e06 NNT: Remove now-unused -cvstag argument and CVSROOT code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84479 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 09:18:54 +00:00
Daniel Dunbar
ad83e7f371 NNT: Remove -usecvs option, this is very old.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 09:18:46 +00:00
Daniel Dunbar
5af8436cce NNT: Remove -debug argument, it is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 09:18:37 +00:00
Daniel Dunbar
4628e5e120 Regroup NewNightlyTest.pl options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 09:18:24 +00:00
Daniel Dunbar
7723d45153 lit: When running Tcl scripts via shell, try harder to find 'bash', but fall
back to running them internally if that fails. PR5240.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 03:54:21 +00:00
Mikhail Glushenkov
4d21ae7cf4 Refactoring, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 22:51:30 +00:00
Jeffrey Yasskin
6bccb4c237 Support GoogleTest's "typed tests"
(http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Typed_Tests)
in lit.py.  These tests have names like "ValueMapTest/0.Iteration", which broke
when lit.py os.path.join()ed them onto the path and then assumed it could
os.path.split() them back off.  This patch shifts path components from the
testPath to the testName until the testPath exists.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 02:05:42 +00:00
Daniel Dunbar
9bd34602fb Move UnescapeString to a static function for its sole client; its inefficient and broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:43:42 +00:00
Daniel Dunbar
3446cf142e Use raw_ostream::write_escaped instead of EscapeString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:43:19 +00:00
Mikhail Glushenkov
0a22fb6664 First draft of the OptionPreprocessor.
More to follow...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:09:29 +00:00
Mikhail Glushenkov
5a1a53e450 This variable is never used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:08:47 +00:00
Mikhail Glushenkov
2cea7bdef9 Disallow multiple instances of PluginPriority.
Several instances of PluginPriority in a single file most probably signifies a
programming error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:08:30 +00:00
Jakob Stoklund Olesen
11ee508d7b Report errors correctly for unselected target intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 18:50:03 +00:00
Edward O'Callaghan
df40664a63 Haiku porting patches, Credit to Paul Davey.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 04:57:20 +00:00
Mikhail Glushenkov
0b599391f8 Omit the 'out_file_index != -1' check when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 05:45:21 +00:00
Mikhail Glushenkov
39482dde66 Input files should go before all other options.
Important, for example, when calling 'gcc a.o b.o c.o -lD -lE -lF'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 04:40:08 +00:00
Evan Cheng
799d697bf8 Add instruction flags: hasExtraSrcRegAllocReq and hasExtraDefRegAllocReq. When
set, these flags indicate the instructions source / def operands have special
register allocation requirement that are not captured in their register classes.
Post-allocation passes (e.g. post-alloc scheduler) should not change their
allocations. e.g. ARM::LDRD require the two definitions to be allocated
even / odd register pair.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 08:21:18 +00:00
Stuart Hastings
9ad675893f B&I's buildit forces a PATH that omits /Developer. Temporarily add
/Developer/usr/bin to the PATH when looking for llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 23:42:38 +00:00
Stuart Hastings
dc3d8cc6a6 For B&I-style builds, tweak build_llvm script to prefer LLVM-G++ if
available.  Override by setting CC and CXX in the environment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 22:17:53 +00:00
Jakob Stoklund Olesen
26207e5bf1 Introduce the TargetInstrInfo::KILL machine instruction and get rid of the
unused DECLARE instruction.

KILL is not yet used anywhere, it will replace TargetInstrInfo::IMPLICIT_DEF
in the places where IMPLICIT_DEF is just used to alter liveness of physical
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 20:32:26 +00:00
Daniel Dunbar
705428ae4a Don't traverse into .svn directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 07:32:45 +00:00
Mikhail Glushenkov
ad981bfbcc Add a way to query the number of input files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 01:16:42 +00:00
Mikhail Glushenkov
9d7a2dc284 A bit prettier formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 01:15:44 +00:00
Chris Lattner
eec96958cd implement and document support for filecheck variables. This
allows matching and remembering a string and then matching and
verifying that the string occurs later in the file.

Change X86/xor.ll to use this in some cases where the test was
checking for an arbitrary register allocation decision.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 07:56:52 +00:00
Chris Lattner
81f46d9ce1 remove support for "NoSub" from regex. It seems like a minor optimization
and makes the API more annoying.  Add a Regex::getNumMatches() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 21:27:04 +00:00
Anton Korobeynikov
58cd84dc77 Provide proper masks for neon perfect shuffle table.
I definitely need to read documentation better :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 22:52:29 +00:00
Dan Gohman
c76909abfe Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 20:36:54 +00:00
Dan Gohman
602b0c8c17 Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:54:59 +00:00
Chris Lattner
94638f0081 reject attempts to use ()'s in patterns, these are reserved for filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 17:29:36 +00:00
Chris Lattner
5d6a05f4d4 reimplement the regex matching strategy by building a single
regex and matching it instead of trying to match chunks at a time.
Matching chunks at a time broke with check lines like 
  CHECK: foo {{.*}}bar
because the .* would eat the entire rest of the line and bar would
never match.

Now we just escape the fixed strings for the user, so that something
like:
  CHECK: a() {{.*}}???
is matched as:
  CHECK: {{a\(\) .*\?\?\?}}
transparently "under the covers".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 17:23:43 +00:00
Chris Lattner
2702e6aa53 special case Patterns that are a single fixed string. This is a microscopic
perf win and is needed for future changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 17:09:12 +00:00
Chris Lattner
d9485ddfdd filecheck should not match a \n with a .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:47:09 +00:00
Chris Lattner
bfa2eed139 turn a std::pair into a real class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:32:47 +00:00
Chris Lattner
528700863a add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 21:47:32 +00:00
Chris Lattner
adea46ed61 Use CanonicalizeInputFile to canonicalize the entire buffer containing the
CHECK strings, instead of canonicalizing the patterns directly.  This allows
Pattern to just contain a StringRef instead of std::string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:45:07 +00:00
Chris Lattner
a29703e842 change 'not' matching to use Pattern, move pattern parsing logic into
the Pattern class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:39:13 +00:00
Chris Lattner
9fc6678bea refactor out the match string into its own Pattern class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:25:55 +00:00
David Goodwin
1f52895692 Make the end-of-itinerary mark explicit. Some cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:22:50 +00:00
Daniel Dunbar
48f7ce88a6 Add count/not tools as executables.
- Apparently, I'm willing to do incredibly stupid things in the name of portability.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 06:23:57 +00:00
Daniel Dunbar
5a461dd513 lit: When executing shell scripts internally, don't allow piped stderr on any
commands except the last one, instead redirect the stderr to a temporary
file. This sidesteps a potential deadlocking issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 09:50:38 +00:00
Daniel Dunbar
df3388492b Add a magic LLVM_DISABLE_CRT_DEBUG environment variable which we check in RegisterHandler and use to disable the Win32 crash dialogs. These are a major blocker to any kind of automated testing.
Also, tweak the 'lit' test runner to set this variable unconditionally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 09:50:28 +00:00
Daniel Dunbar
4b78aa3f56 Actually use the arguments with the resolved executable path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 06:09:13 +00:00
Daniel Dunbar
58c661ced1 lit: Don't use close_fds=True on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 04:44:37 +00:00
Daniel Dunbar
6bd2b2e9a2 lit: When executing commands internally, perform PATH resolution ourselves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 04:44:26 +00:00
Mikhail Glushenkov
f8349ac8b8 Use raw_ostream::indent instead of passing strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 15:53:44 +00:00
Chris Lattner
8111576521 fix a FileCheck bug where:
; CHECK: foo
; CHECK-NOT: foo
; CHECK: bar

would always fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 02:30:42 +00:00
Chris Lattner
3711b7adcc rewrite CountNumNewlinesBetween to be in terms of StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 22:42:44 +00:00
Chris Lattner
f15380ba8a implement and document support for CHECK-NOT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 22:35:26 +00:00
Chris Lattner
96077036f0 rewrite FileCheck in terms of StringRef instead of manual pointer pairs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 22:11:44 +00:00
Daniel Dunbar
848454aede Follow googletest logic for suppressing warnings in unittests/UnitTestMain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 06:17:12 +00:00
Chris Lattner
c19418f31f convert some stuff to StringRef to avoid temporary std::strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 18:31:37 +00:00
Chris Lattner
700676087f add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 18:10:19 +00:00
Daniel Dunbar
7c748661ce lit: Add a custom test format for use in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 01:34:52 +00:00
Daniel Dunbar
b2485c9e41 lit: When finding nested test suites, check first in the execpath in case there
is a site configuration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 20:09:17 +00:00
Daniel Dunbar
3d2a664fe5 Add a valgrind suppressions file for x86_64/linux/4.3.3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 16:10:32 +00:00
Daniel Dunbar
00a42449ec lit: Give test formats control over test discovery.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 02:38:46 +00:00
Chris Lattner
f96271afed slightly increase prettiness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:27:50 +00:00
Chris Lattner
f6761be50d emit the register table as a massive string to avoid relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:26:18 +00:00
Chris Lattner
44da5fbf97 move StringToOffsetTable out to its own header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:19:16 +00:00
Chris Lattner
3200fc9bad factor string table generation out to its own class. This changes
the encoding of the AsmStrs table saving a byte or two.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:16:36 +00:00
Chris Lattner
e7f3107772 eliminate the TargetRegisterDesc::AsmName field, the asmprinters now have this table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 22:45:04 +00:00
Daniel Dunbar
f845c74c62 Move unittest driver to utils/unittest/UnitTestMain.
- This eliminates a race between building the unittests and linking the
   UnitTestMain library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 21:31:21 +00:00
Chris Lattner
d95148f073 the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:19:22 +00:00
Chris Lattner
05af2616d0 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:08:00 +00:00
Daniel Dunbar
5110609ceb tests: Add a %abs_tmp substitution which is guaranteed to be a full path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 01:39:50 +00:00
Owen Anderson
69110c90bf Eliminate some unnecessary implicit constructors in generated DAG ISel code.
Partial fix for PR4946.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 09:01:57 +00:00
Chris Lattner
5f12c21320 PHI nodes can never reach the asmprinter, assert and die instead of printing
out an illegal "PHINODE" instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:41:15 +00:00
Mikhail Glushenkov
2d04ec5fe6 Distinguish between 'empty' and empty DAG marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:22:02 +00:00
Mikhail Glushenkov
684a8b0f10 Add a logical 'not' operator to llvmc's TableGen dialect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:21:38 +00:00
Chris Lattner
c5ea263a23 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:14:36 +00:00
Chris Lattner
28179db68b Fix a subtle bug in "return;" generation which caused us to miss
a return in one case.  Instead of sprinking return handling code
throughout the asmprinter generator, just treat it like any other
normal statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:09:29 +00:00
Chris Lattner
634cca377a hoist the call to processDebugLoc out of the generated
asm printer into the "printInstruction" routine.  This
fixes a problem where the experimental asmprinter would
drop debug labels in some cases, and fixes issues on ppc/xcore
where pseudo instructions like "mr" didn't get debug locs properly.

It is annoying that this moves the call from one place into each
target, but a future set of more invasive refactorings will fix
that problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 20:34:59 +00:00
Daniel Dunbar
c60535ab81 Count test correctly with -q.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 02:41:42 +00:00
Daniel Dunbar
07d0bd4da7 Fix another refactoro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 02:41:32 +00:00
Daniel Dunbar
f072432e26 lit needs bash for tcl-as-sh execution, we use set -o pipefail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 06:08:07 +00:00
Daniel Dunbar
ba3931b667 Fix typo that worked on python 2.6.
Also, fix unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:46:28 +00:00
Daniel Dunbar
2c0a49c8cb Fix a refactoro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:37:51 +00:00
Daniel Dunbar
be7ada7181 Add 'lit' testing tool.
- make install && man $(llvm-config --prefix)/share/man/man1/lit.1 for more
   information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 05:31:18 +00:00