Commit Graph

115 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
6f36fa981a Write llvm-tblgen backends as functions instead of sub-classes.
The TableGenBackend base class doesn't do much, and will be removed
completely soon.

Patch by Sean Silva!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158311 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-11 15:37:55 +00:00
Chris Lattner
d509d0b532 switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157556 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 01:47:44 +00:00
Chris Lattner
86208903cb rdar://11542750 - llvm.trap should be marked no return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 23:20:41 +00:00
Chris Lattner
55dc5c77a3 Reimplement the intrinsic verifier to use the same table as Intrinsic::getDefinition,
making it stronger and more sane.

Delete the code from tblgen that produced the old code.

Besides being a path forward in intrinsic sanity, this also eliminates a bunch of
machine generated code that was compiled into Function.o


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157545 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 19:37:05 +00:00
Chris Lattner
908a831a9a move some code around so that Verifier.cpp can get access to the intrinsic info table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157540 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 18:28:35 +00:00
Chris Lattner
b4654c1c49 enhance the intrinsic info table to encode what *kind* of Any argument
it is (at the cost of 45 bytes of extra table space) so that the verifier can
start using it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157536 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 16:39:08 +00:00
Chris Lattner
e82d598ef2 rearrange some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157523 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-26 23:03:52 +00:00
Patrik Hägglund
9ce6f6fe5e Fixed typo in r156905.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157320 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23 12:34:56 +00:00
Chris Lattner
a48289a672 small refinement to r157218 to save a tiny amount of table size in the common
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157312 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23 05:19:18 +00:00
Pete Cooper
b428511989 Added address space qualifier to intrinsic PointerType arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157218 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 23:21:28 +00:00
Chris Lattner
387c9dcdda enhance the intrinsic info stuff to emit encodings that don't fit in 32-bits into a
separate side table, using the handy SequenceToOffsetTable class.  This encodes all
these weird things into another 256 bytes, allowing all intrinsics to be encoded this way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 15:55:41 +00:00
Chris Lattner
d7cf5eb021 finish encoding all of the interesting details of intrinsics. Now intrinsics
are only rejected because they can't be encoded into a 32-bit unit, not because
they contain an unencodable feature.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 05:03:24 +00:00
Chris Lattner
46aaf69e37 strengthen the intrinsic descriptor stuff to be able to handle sin, cos and other
intrinsics that use passed-in arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 04:30:58 +00:00
Chris Lattner
15706cbf85 simplify code generated by tblgen that is not necessary since we dropped
compatibility with LLVM 2.x bitcode files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156976 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 04:07:48 +00:00
Francois Pichet
e4807c1ba1 I forgot the #ifdef _MSC_VER guard in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156975 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 04:00:03 +00:00
Francois Pichet
3aca879906 Fix the MSVC 2010 build: disable the optimizer for a problematic function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156973 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 03:38:19 +00:00
Chris Lattner
a98aa6ad1e Significantly reduce the compiled size of Functions.cpp by turning a big blob of tblgen
generated code (for Intrinsic::getType) into a table.  This handles common cases right now,
but I plan to extend it to handle all cases and merge in type verification logic as well
in follow-on patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156905 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 06:34:44 +00:00
Chris Lattner
7200c5cd30 have tblgen emit cast<> instead of dyn_cast<> when we know it must succeed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156902 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 04:51:09 +00:00
Douglas Gregor
f657da2e48 Move llvm-tblgen's StringMatcher into the TableGen library so it can
be used by clang-tblgen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 17:32:48 +00:00
Craig Topper
b57b170317 Fix target specific intrinsic handling to adjust intrinsic number before doing attribute table lookup. Also fix attribute table lookup to handle 'invalid' intrinsic correctly. Fixes PR12542
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154658 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 06:14:57 +00:00
Benjamin Kramer
72e84f51a6 TableGen: Don't emit the llvm intrinsic -> gcc builtin table, its only user was the c backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153432 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-26 11:08:03 +00:00
Benjamin Kramer
36a2138cce Emit the "is an intrinsic overloaded" table as a bitfield.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151792 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 02:16:57 +00:00
Benjamin Kramer
b519a0fe0e Emit the intrinsic modref info as a lookup table instead of a huge switch.
Shrinks BasicAliasAnalysis.o from 106k to 56k on i386.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151781 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 01:18:32 +00:00
Craig Topper
1f59523521 Convert generated intrinsic attributes to use an array lookup as Chris suggested in PR11951.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151622 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 06:32:00 +00:00
Craig Topper
655b8de7b2 Convert assert(0) to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 07:21:30 +00:00
Dan Gohman
e3376ecd50 Add basic generic CodeGen support for half.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146927 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 00:02:33 +00:00
Peter Collingbourne
7c78888887 Move TableGen's parser and entry point into a library
This is the first step towards splitting LLVM and Clang's tblgen executables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 16:41:13 +00:00
Benjamin Kramer
eb9a85f09e Change Intrinsic::getDeclaration and friends to take an ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135154 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 17:45:39 +00:00
Chris Lattner
b2318662b6 fix the varargs version of StructType::get to not require an LLVMContext, making usage
much cleaner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 22:48:56 +00:00
John McCall
bd0fa4c00d Change how tblgen generates attributes for intrinsics to use a single
switch.  With this newfound organization, teach tblgen how not to give
all intrinsics the 'nounwind' attribute.  Introduce a new intrinsic,
llvm.eh.resume, which does not have this attribute.  Documentation and uses
to follow.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132252 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 06:31:34 +00:00
Dan Gohman
e88ccb545d Rename AccessesArguments and AccessesArgumentsReadonly, and rewrite
their comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 18:30:00 +00:00
Dan Gohman
9423f63365 Translate IntrReadArgMem to AccessesArgumentsReadonly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 20:07:20 +00:00
Michael J. Spencer
1f40960543 Get rid of pop_macro warnings on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 19:48:47 +00:00
Michael J. Spencer
08047f6169 CBackend: Fix MSVC build.
This may produce warnings on MSVS, but it's better than failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 04:27:38 +00:00
Dale Johannesen
8be452545a Add x86mmx to TableGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 00:16:46 +00:00
Chris Lattner
cc67c75b67 emit the LLVM intrinsic name -> intrinsic number mapping table with
StringMatcher instead of a linear sequence of memcmps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 03:58:45 +00:00
Chris Lattner
298b176559 emit the __builtin -> intrinsic map with StringMatcher instead of a
copy of a close relative of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 03:14:45 +00:00
Chris Lattner
2738ff9c22 slightly improve the runtime and code size of the Intrinsics info table by not
comparing the "llvm." prefix in the memcmp, and not storing it in the string literal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113136 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:44:44 +00:00
Dan Gohman
7365c091f9 Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem
to IntrReadWriteArgMem, as it's for reading as well as writing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:36:21 +00:00
Douglas Gregor
7d9663c70b Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 06:17:44 +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
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
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
Owen Anderson
1d0be15f89 Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Owen Anderson
825b72b057 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:47:22 +00:00
Bob Wilson
61fc4cf7aa Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 01:14:02 +00:00
Owen Anderson
e50ed30282 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 22:56:29 +00:00
Owen Anderson
d7f2a6cb3f Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:16:16 +00:00
Bob Wilson
09b1366f3f Fix the verifier to handle intrinsics with LLVMMatchType parameters, where
the return type of the intrinsic is not overloaded, i.e., where the type
being matched is some other parameter.  The argument to LLVMMatchType is
an index into the list of overloaded types (ignoring the fixed types),
but VerifyIntrinsicPrototype is expecting its arguments for LLVMMatchType
parameters to be indices into the combined list of _all_ return values and
parameters, not just the overloaded ones.

This patch changes TableGen to keep track for each overloaded type of the
corresponding index into the list of return values and parameters.  It
then generates the values expected by VerifyIntrinsicPrototype.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 16:35:59 +00:00