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

114 Commits

Author SHA1 Message Date
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
Chris Lattner
b8c69426ef reduce nesting.
llvm-svn: 96466
2010-02-17 06:53:36 +00:00
Chris Lattner
3d4086208b constize
llvm-svn: 96199
2010-02-14 22:33:49 +00:00
Chris Lattner
4a7b56d74e clean up a bunch of code, move some random predicates
on TreePatternNode to be methods on TreePatternNode.

llvm-svn: 96197
2010-02-14 22:22:58 +00:00
Chris Lattner
216edab8dd tidy up
llvm-svn: 96186
2010-02-14 21:10:15 +00:00
Bill Wendling
318224b8f1 Use the 'MadeChange' variable instead of returning 'false' all of the time.
llvm-svn: 92155
2009-12-25 13:35:40 +00:00
Anton Korobeynikov
9737bfedeb 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!
llvm-svn: 85766
2009-11-02 00:11:39 +00:00
Bob Wilson
2cc9f2ac91 PR4795: Remove EEVT::isFP, isInt and isVec types used by TableGen's type
inferencing.  As far as I can tell, these are equivalent to the existing
MVT::fAny, iAny and vAny types, and having both of them makes it harder
to reason about and modify the type inferencing code.

The specific problem in PR4795 occurs when updating a vAny type to be fAny
or iAny, or vice versa.  Both iAny and fAny include vector types -- they
intersect with the set of types represented by vAny.  When merging them,
choose fAny/iAny to represent the intersection.  This is not perfect, since
fAny/iAny also include scalar types, but it is good enough for TableGen's
type inferencing.

llvm-svn: 80423
2009-08-29 05:53:25 +00:00
Benjamin Kramer
eba201cea0 Try to fix MSVC build after r79846.
llvm-svn: 79850
2009-08-23 10:39:21 +00:00
Daniel Dunbar
55ef0b87d7 Fix non-determinism in DAGISel emitter.
- This manifested as non-determinism in the .inc output in rare cases (when two
   distinct patterns ended up being equivalent, which is rather rare). That
   meant the pattern matching was non-deterministic, which could eventually mean
   the code generator selected different instructions based on the arch.

 - It's probably worth making the DAGISel ensure a total ordering (or force the
   user to), but the simple fix here is to totally order the Record* maps based
   on a unique ID.

 - PR4672, PR4711.

Yay:
--
ddunbar@giles:~$ cat ~/llvm.obj.64/lib/Target/*/*.inc | shasum
d1099ff34b21459a5a3e7021c225c080e6017ece  -
ddunbar@giles:~$ cat ~/llvm.obj.ppc/lib/Target/*/*.inc | shasum
d1099ff34b21459a5a3e7021c225c080e6017ece  -
--

llvm-svn: 79846
2009-08-23 09:47:37 +00:00