Commit Graph

80961 Commits

Author SHA1 Message Date
Anders Carlsson 2d016af623 Use the newly added function in the VTT builder.
llvm-svn: 99799
2010-03-29 02:14:35 +00:00
Anders Carlsson f6f24c609b Cleanup, no functionality change.
llvm-svn: 99798
2010-03-29 02:08:26 +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
Anders Carlsson 9a97e2ef95 Add the thunks needed by this vtable.
llvm-svn: 99793
2010-03-29 01:38:05 +00:00
Anders Carlsson 848d86e5c4 Make sure to sort the vtable thunks by their vtable index :) With this we now pass the test from http://www.codesourcery.com/public/cxx-abi/abi-examples.html#vtable-ctor successfully.
llvm-svn: 99792
2010-03-29 01:28:05 +00:00
Anders Carlsson 948d3f4ec6 Fix another thinko, so that flags don't depend on previous bases.
llvm-svn: 99791
2010-03-29 01:16:41 +00:00
Anders Carlsson 74d7dfcf8e When generating base ctors/dtors, we need to lookup virtual bases using the vtable.
llvm-svn: 99790
2010-03-29 01:14:25 +00:00
Johnny Chen c86256fa5d Add NVTBLFrm to represent A8.6.406 VTBL, VTBX Vector Table Lookup Instructions.
These instructions use byte index in a control vector (M:Vm) to lookup byte
values in a table and generate a new vector (D:Vd).  The table is specified via
a list of vectors, which can be:

{Dn}
{Dn D<n+1>}
{Dn D<n+1> D<n+2>}
{Dn D<n+1> D<n+2> D<n+3>}

llvm-svn: 99789
2010-03-29 01:14:22 +00:00
Anders Carlsson 27d86bddfe Fix thinko.
llvm-svn: 99788
2010-03-29 01:12:13 +00:00
Anders Carlsson 5889027ccc Use construction vtables when needed. This is currently guarded by -fdump-vtable-layouts since it doesn't work 100% yet :)
llvm-svn: 99787
2010-03-29 01:08:49 +00:00
Anders Carlsson 8baeaf0a26 Two bug fixes, we weren't updating the thunk index when creating the vtable initializer and we weren't storing the secondary virtual pointer indices.
llvm-svn: 99786
2010-03-29 01:04:16 +00:00
Rafael Espindola 3e69c3ed31 Make default arguments to getFunctionNoProtoType an all or nothing option (as they already are in practise).
llvm-svn: 99785
2010-03-28 22:48:23 +00:00
Rafael Espindola 2ac0582419 Drop default arguments no one is using.
llvm-svn: 99783
2010-03-28 22:19:17 +00:00
Devang Patel 1e8ccb5f8b Revert 99772.
llvm-svn: 99778
2010-03-28 21:23:37 +00:00
Anders Carlsson d589593c93 Reapply r99775 with a fix for a silly bug - we were setting the vtable pointer for all bases, even those without a vtable pointer :)
llvm-svn: 99777
2010-03-28 21:07:49 +00:00
Anders Carlsson fcc9f91287 Looks like I broke self-host again :(.
llvm-svn: 99776
2010-03-28 20:55:21 +00:00
Anders Carlsson 74eab715ae More improvements to setting the vtable pointer. We now no longer set the vtable pointer for non-virtual primary bases. We also do a pre-order traversal of the class hierarchy; this is necessary in order to get the right vbase offset offsets in base ctors/dtors.
llvm-svn: 99775
2010-03-28 20:34:31 +00:00
Chris Lattner 03719af41d add a statistic for the # times isel has to backtrack.
llvm-svn: 99774
2010-03-28 19:46:56 +00:00
Anders Carlsson e87fae9afa Factor vtable pointer setting code out into a separate function.
llvm-svn: 99773
2010-03-28 19:40:00 +00:00
Devang Patel 32bdaef3fe Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
llvm-svn: 99772
2010-03-28 18:57:09 +00:00
Chris Lattner 11f85ccf7d zap an extra line that Eli noticed!
llvm-svn: 99770
2010-03-28 18:52:28 +00:00
Anton Korobeynikov c2747d068e Properly quote the quotes :) during cmdline construction on Windows.
Otherwise, e.g. in the invocation like clang -DFOO=\"bar\" FOO macro
got the bar value, not "bar".

Patch by Alexander Esilevich!

llvm-svn: 99763
2010-03-28 15:07:02 +00:00
Torok Edwin 07f0adc2a6 Fix use-of-uninitialized value when RWX memory can't be allocated (PR6701).
SELinux doesn't allow 'execmem', returning MAP_FAILED and 'Permission denied'
for mmap or RWX memory. In this case AllocateRWX was returning a MemoryBlock
with uninitialized fields, which sometimes caused crashes.

This patch initializes MemoryBlock fields to 0, so that the RWX-failure check
works.
It doesn't fix the SELinux 'execmem' issues though (the JIT will not work when
SELinux is in enforcing mode).

llvm-svn: 99762
2010-03-28 11:07:36 +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 b7c48433df fix a type contradition: XCoreISD::RETSP has one argument, not zero.
llvm-svn: 99760
2010-03-28 08:47:39 +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 505849d277 remove a pattern with no testcase that doesn't appear to be
matchable: it seems like it would always constant fold.

llvm-svn: 99758
2010-03-28 08:40:48 +00:00
Chris Lattner 3dad5fbeb9 fix integer negates to use the proper type for the zero vectors,
this also depends on the new "bitconvert dropping" behavior just
added to tblgen.

llvm-svn: 99757
2010-03-28 08:39:10 +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 240154e633 fix a typo, bitconvert from node to itself isn't valid.
llvm-svn: 99755
2010-03-28 08:36:45 +00:00
Chris Lattner 6c223ee0e9 fix vnot matching to explicitly specify the type of the
input to be v8i8 or v16i8, which buildvectors get canonicalized to.

This allows the patterns that were previously using a bare 'vnot' to
match, before they couldn't.

llvm-svn: 99754
2010-03-28 08:08:07 +00:00
Chris Lattner 1c85e3476d fix up vnot matching, eliminating a dead pattern, correcting a couple of
patterns that would never match because of bitcast, and eliminating use
of vnot_conv.

llvm-svn: 99753
2010-03-28 08:00:23 +00:00
Chris Lattner 6bba2f3c69 add some nounwinds
llvm-svn: 99752
2010-03-28 07:58:37 +00:00
Chris Lattner 108667f3ec this takes an insane amount of time to run, disable it for now (PR6727)
llvm-svn: 99751
2010-03-28 07:58:09 +00:00
Chris Lattner e549d9b1f2 stop using vnot_conv
llvm-svn: 99750
2010-03-28 07:48:17 +00:00
Chris Lattner 227a83d6ed revert r99743, this is saying that the repmovs instructinos have an
*input* of other type, which is the VT. 

llvm-svn: 99749
2010-03-28 07:38:39 +00:00
Chris Lattner be980f2df7 remove a bunch of dead patterns.
llvm-svn: 99748
2010-03-28 07:38:00 +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 58ff45cbef add some node definitions.
llvm-svn: 99745
2010-03-28 06:16:41 +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 cba70c8162 claiming to return other is pointless.
llvm-svn: 99743
2010-03-28 05:57:36 +00:00
Chris Lattner 89ad2f1d60 comply with the wishes of a fixme.
llvm-svn: 99742
2010-03-28 05:55:17 +00:00
Chris Lattner 4d8786b5cc now that (parallel) is gone and a variety of bugs in targets
are cleaned up, we can remove an old fixme.

llvm-svn: 99741
2010-03-28 05:54:03 +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 e01f7e33ac don't add nodes to the now-dead nodes list multiple times, this
can cause a crash on crazy situations in msp430 when morph-node-to
is disabled.

llvm-svn: 99739
2010-03-28 05:28:31 +00:00
Chris Lattner a520b166dc Improve systemz to model cmp and ucmp nodes as returning
their flags correctly.

llvm-svn: 99738
2010-03-28 05:21:52 +00:00