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

123 Commits

Author SHA1 Message Date
Chris Lattner
6a517dbbd6 stop computing InstImpInputs, it is dead
llvm-svn: 101881
2010-04-20 06:30:25 +00:00
Chris Lattner
8b5bae8c3c DAGInstruction::ImpOperands is dead after my recent tblgen work, zap it.
llvm-svn: 101880
2010-04-20 06:28:43 +00:00
Chris Lattner
3bb37074fd 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
117eb269f9 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
5ad69fe4b6 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
e04fb0a1a7 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
af75e6a61f validate that input sdnodes don't exist in an output pattern.
llvm-svn: 99747
2010-03-28 06:57:56 +00:00
Chris Lattner
5bb82e570e eliminate a bunch of code duplication in ParseTreePattern
by rotating it.

llvm-svn: 99746
2010-03-28 06:50:34 +00:00
Chris Lattner
7c35e259aa SDTCisVT<0, isVoid> is not valid, reject it.
llvm-svn: 99744
2010-03-28 06:04:39 +00:00
Chris Lattner
d6afc9e48d 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
2ec88c02da 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
ad983d7a8a 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
d2dd416772 remove parallel support.
llvm-svn: 99703
2010-03-27 02:53:27 +00:00
Chris Lattner
cb2f61f245 add plumbing for handling multiple result nodes
in some more places.

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

llvm-svn: 99357
2010-03-24 00:06:46 +00:00
Chris Lattner
292d6c4f7e bring sanity to EnforceVectorEltType
llvm-svn: 99354
2010-03-24 00:01:16 +00:00
Chris Lattner
d0c16ce3c3 Cleanup getImplicitType
llvm-svn: 99353
2010-03-23 23:50:31 +00:00
Chris Lattner
c4be1194e5 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
Daniel Dunbar
575d014f60 Fix suggested parentheses warning.
llvm-svn: 99111
2010-03-21 01:38:21 +00:00
Eric Christopher
b41284cea9 Revert r99009 temporarily it seems to be breaking the bots.
llvm-svn: 99011
2010-03-19 23:04:23 +00:00
Chris Lattner
4af1cae2f1 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
eb5e201050 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
e425c6ab6c 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
Chris Lattner
5d1378e7a3 make FillWithPossibleTypes take a predicate to filter types so that
we don't blow the smallvector as often.  No functionality change.

llvm-svn: 98968
2010-03-19 17:41:26 +00:00
Chris Lattner
5afb55e172 resolve fixme: we now infer the instruction-level 'isvariadic' bit
from the pattern if present, and we use it instead of the bit.

llvm-svn: 98938
2010-03-19 05:34:15 +00:00
Chris Lattner
6b395fca87 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.

llvm-svn: 98934
2010-03-19 05:07:09 +00:00
Chris Lattner
0f1c18d7e6 rewrite EnforceSmallerThan to be less bone headed.
llvm-svn: 98933
2010-03-19 04:54:36 +00:00
Daniel Dunbar
cc34ff9e80 Fix -Asserts warning.
llvm-svn: 98927
2010-03-19 03:18:20 +00:00
Chris Lattner
68762f16c5 eliminate the last use of EEVT::isUnknown
llvm-svn: 98918
2010-03-19 01:14:27 +00:00
Chris Lattner
b929ca1352 change Target.getInstructionsByEnumValue to return a reference
to a vector that CGT stores instead of synthesizing it on every 
call.

llvm-svn: 98910
2010-03-19 00:34:35 +00:00
Chris Lattner
1acf5e4a8d don't go through getInstructions().
llvm-svn: 98906
2010-03-19 00:18:23 +00:00
Chris Lattner
3e5af02a79 look up instructions by record, not by name.
llvm-svn: 98904
2010-03-19 00:07:20 +00:00
Chris Lattner
0ed7a372d6 expand tblgen's support for instructions with implicit defs.
llvm-svn: 98900
2010-03-18 23:57:40 +00:00
Chris Lattner
5becdf478d 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 ...))

llvm-svn: 98897
2010-03-18 23:15:10 +00:00
Chris Lattner
fa01855463 simplify this code, the # of sets in the pattern for an instruction
shouldn't change this.

llvm-svn: 98872
2010-03-18 21:15:05 +00:00
Chris Lattner
3f7819560f remove some code that was working around old sparc v9 backend bugs.
Add checking that the input/output operand list in spelled right.

llvm-svn: 98865
2010-03-18 20:50:52 +00:00
Chris Lattner
02bf60555d eliminate some #if 0 code I added in r96905, type inference
now enforces that input/output named values have hte same type.

llvm-svn: 98535
2010-03-15 06:03:22 +00:00
Chris Lattner
c008597c0a 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!

llvm-svn: 98534
2010-03-15 06:00:16 +00:00
Chris Lattner
b5555f19f1 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), [{
...

llvm-svn: 97952
2010-03-08 18:36:19 +00:00
Chris Lattner
14ef40723a resolve a fixme by having the .td file parser reject thigns like
(set GPR, somecomplexpattern)

if somecomplexpattern doesn't declare what it can match.

llvm-svn: 97513
2010-03-01 22:29:19 +00:00
Chris Lattner
c0839055a9 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

llvm-svn: 97509
2010-03-01 22:09:11 +00:00
Chris Lattner
9f3d4dff50 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.

llvm-svn: 97355
2010-02-28 00:22:30 +00:00
Chris Lattner
fb0ddbc3b4 use DEBUG instead of DebugFlag directly so that this
respects -debug-only=something-else.

llvm-svn: 97307
2010-02-27 06:51:44 +00:00
Chris Lattner
5b5d31f533 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.

llvm-svn: 96905
2010-02-23 07:50:58 +00:00
Chris Lattner
8b5a000583 Reject patterns that use a name multiple times in the src or result
of a pattern and where the uses have different types.

llvm-svn: 96904
2010-02-23 07:22:28 +00:00
Chris Lattner
da756c0018 reject patterns that have dead named arguments in the input pattern
this is tidier and can find bugs.

llvm-svn: 96900
2010-02-23 06:55:24 +00:00
Chris Lattner
df30185383 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.

llvm-svn: 96898
2010-02-23 06:35:45 +00:00
Chris Lattner
1a749c367d merge some code.
llvm-svn: 96896
2010-02-23 06:16:51 +00:00
Chris Lattner
4c22c51356 more tidying up
llvm-svn: 96891
2010-02-23 05:59:10 +00:00
Chris Lattner
55115233db reduce indentation by eliminating 'else after return'
llvm-svn: 96889
2010-02-23 05:51:07 +00:00