Commit Graph

2471 Commits

Author SHA1 Message Date
Chris Lattner 0e45d24a4e stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.

llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Jakob Stoklund Olesen b93331f3be 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.

llvm-svn: 100384
2010-04-05 03:10:20 +00:00
Chris Lattner 76c564b1bb change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter.  Instead, pass it in explicitly.

llvm-svn: 100306
2010-04-04 04:47:45 +00:00
Chandler Carruth 77074b1378 Fix a warning in GCC about a pointless typedef.
llvm-svn: 100268
2010-04-03 04:45:24 +00:00
Chandler Carruth 89c787b906 Add the new ARMDecodeEmitter to CMake build.
llvm-svn: 100267
2010-04-03 04:36:43 +00:00
Johnny Chen dbdd3f8b09 Move variable "Bits" declaration/definition into the DEBUG block where its usage
is expected.

llvm-svn: 100247
2010-04-02 23:13:52 +00:00
Johnny Chen 7d363b63fd Fixed build warning.
llvm-svn: 100244
2010-04-02 22:51:04 +00:00
Johnny Chen 88a7b5a724 Change from .../Support/DataTypes.h to .../System/DataTypes.h.
(Fix build failure)

llvm-svn: 100243
2010-04-02 22:41:06 +00:00
Johnny Chen 7b999ea7b7 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.

llvm-svn: 100233
2010-04-02 22:27:38 +00:00
Daniel Dunbar 3f183ae5cb Add a FIXME.
llvm-svn: 100034
2010-03-31 19:14:05 +00:00
Daniel Dunbar 6e0dbca6c4 lit: Make sure to close any files we open as part of redirection.
PR6753.

llvm-svn: 100032
2010-03-31 18:48:43 +00:00
Chris Lattner f91869b619 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.

llvm-svn: 99797
2010-03-29 02:02:45 +00:00
Chris Lattner 41a15141c9 revert 99795, as mentioned, it is disabled anyway.
llvm-svn: 99796
2010-03-29 01:58:15 +00:00
Chris Lattner a79260151f 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.

llvm-svn: 99795
2010-03-29 01:56:19 +00:00
Chris Lattner 05925fe1fe print the complexity of the pattern being matched in the
comment in the generated table.

llvm-svn: 99794
2010-03-29 01:40:38 +00:00
Chris Lattner 135091bd9d 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.

llvm-svn: 99761
2010-03-28 08:48:47 +00:00
Chris Lattner 6642118e83 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!)

llvm-svn: 99759
2010-03-28 08:43:23 +00:00
Chris Lattner a787c9e23a 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.

llvm-svn: 99756
2010-03-28 08:38:32 +00:00
Chris Lattner 2e9eae1fa2 validate that input sdnodes don't exist in an output pattern.
llvm-svn: 99747
2010-03-28 06:57:56 +00:00
Chris Lattner adf7ecf9d3 eliminate a bunch of code duplication in ParseTreePattern
by rotating it.

llvm-svn: 99746
2010-03-28 06:50:34 +00:00
Chris Lattner ffdac7b76a SDTCisVT<0, isVoid> is not valid, reject it.
llvm-svn: 99744
2010-03-28 06:04:39 +00:00
Chris Lattner 49e2773dd8 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.

llvm-svn: 99740
2010-03-28 05:50:16 +00:00
Chris Lattner 725d3f6219 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.

llvm-svn: 99728
2010-03-27 20:45:15 +00:00
Chris Lattner 4a5f7be077 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.

llvm-svn: 99727
2010-03-27 20:32:26 +00:00
Chris Lattner 7bc5d9b576 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.

llvm-svn: 99726
2010-03-27 20:09:24 +00:00
Chris Lattner d44966f26d 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.

llvm-svn: 99725
2010-03-27 19:15:02 +00:00
Chris Lattner e7e9f06d3b 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.

llvm-svn: 99722
2010-03-27 18:49:33 +00:00
Dan Gohman dcc8cd96f2 Remove an unnecessary #include.
llvm-svn: 99714
2010-03-27 16:33:36 +00:00
Chris Lattner 5c2182ef77 remove parallel support.
llvm-svn: 99703
2010-03-27 02:53:27 +00:00
Jakob Stoklund Olesen f8d7eda663 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.

llvm-svn: 99539
2010-03-25 18:52:01 +00:00
Daniel Dunbar e810155805 lit: Add LitTestCase and lit.load_test_suite, for adapting lit based suites for
use with Python's unittest.

llvm-svn: 99498
2010-03-25 07:10:01 +00:00
Chris Lattner 552dddc51c 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

llvm-svn: 99494
2010-03-25 06:33:05 +00:00
Jakob Stoklund Olesen 0e45762250 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.

llvm-svn: 99492
2010-03-25 06:23:34 +00:00
Chris Lattner 6c2d178957 add plumbing for handling multiple result nodes
in some more places.

llvm-svn: 99366
2010-03-24 00:41:19 +00:00
Chris Lattner 38c99662ff implement SDTCisVTSmallerThanOp with EnforceSmallerThan
instead of reimplementing it wrong and poorly.

llvm-svn: 99357
2010-03-24 00:06:46 +00:00
Chris Lattner 57ebf63da7 bring sanity to EnforceVectorEltType
llvm-svn: 99354
2010-03-24 00:01:16 +00:00
Chris Lattner 6070ee2a58 Cleanup getImplicitType
llvm-svn: 99353
2010-03-23 23:50:31 +00:00
Chris Lattner b424faa09c reject void in intrinsic type lists.
llvm-svn: 99347
2010-03-23 23:46:27 +00:00
Bill Wendling c941619a73 Use "DISABLE_EDIS" to disable building "edis" explicitly. Don't build it for
Apple-style builds.

llvm-svn: 99336
2010-03-23 22:15:33 +00:00
Chris Lattner 2109cb461c 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.

llvm-svn: 99206
2010-03-22 20:56:36 +00:00
Jeffrey Yasskin 544cfd76e7 When we don't pass --vg-leak to lit, pass --leak-check=no to valgrind.
llvm-svn: 99112
2010-03-21 01:47:33 +00:00
Daniel Dunbar d177edf361 Fix suggested parentheses warning.
llvm-svn: 99111
2010-03-21 01:38:21 +00:00
Jeffrey Yasskin 2f87b54f1a 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.

llvm-svn: 99103
2010-03-20 23:08:45 +00:00
Eric Christopher 3e2bb702db Revert r99009 temporarily it seems to be breaking the bots.
llvm-svn: 99011
2010-03-19 23:04:23 +00:00
Chris Lattner 933b2cf9a8 Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.

llvm-svn: 99009
2010-03-19 22:40:56 +00:00
Chris Lattner 2db7abaa44 make getOperandNum a static function (since it's just used by
ApplyTypeConstraint) and make it handle multiple result nodes.

llvm-svn: 99003
2010-03-19 21:56:21 +00:00
Chris Lattner f144725ebc 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.

llvm-svn: 98999
2010-03-19 21:37:09 +00:00
Ben Holt b7d3d99181 Test commit (removed extra blank line)
llvm-svn: 98988
2010-03-19 21:12:29 +00:00
Daniel Dunbar c069cc8eaa FileCheck: Don't print "possibly intended match" line if it would match the
"scanning from here" one.

llvm-svn: 98971
2010-03-19 18:07:43 +00:00
Torok Edwin bc8eed000f 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.

llvm-svn: 98969
2010-03-19 17:54:21 +00:00