Nick Lewycky
7b093a1c2f
Extend 'readonly' and 'readnone' to work on function arguments as well as
...
functions. Make the function attributes pass add it to known library functions
and when it can deduce it.
llvm-svn: 185735
2013-07-06 00:29:58 +00:00
Bill Wendling
ba6c1893c9
Use the AttributeSet instead of AttributeWithIndex.
...
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.
llvm-svn: 173606
2013-01-27 03:25:05 +00:00
Michael Ilseman
d8715c1e7a
Support for half intrinsics. Pushes MMX into slower encoding path.
...
llvm-svn: 172159
2013-01-11 01:45:05 +00:00
Bill Wendling
a16e5519db
Change 'AttrVal' to 'AttrKind' to better reflect that it's a kind of attribute instead of the value of the attribute.
...
llvm-svn: 170972
2012-12-22 00:37:52 +00:00
Bill Wendling
56d9c4b832
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
...
llvm-svn: 170502
2012-12-19 07:18:57 +00:00
Bill Wendling
3f153ce37b
s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.
...
llvm-svn: 169651
2012-12-07 23:16:57 +00:00
Bill Wendling
62a846033f
Make the AttrListPtr object a part of the LLVMContext.
...
When code deletes the context, the AttributeImpls that the AttrListPtr points to
are now invalid. Therefore, instead of keeping a separate managed static for the
AttrListPtrs that's reference counted, move it into the LLVMContext and delete
it when deleting the AttributeImpls.
llvm-svn: 168354
2012-11-20 05:09:20 +00:00
Joerg Sonnenberger
839f6c1a88
Remove exception handling usage from tblgen.
...
Most places can use PrintFatalError as the unwinding mechanism was not
used for anything other than printing the error. The single exception
was CodeGenDAGPatterns.cpp, where intermediate errors during type
resolution were ignored to simplify incremental platform development.
This use is replaced by an error flag in TreePattern and bailout earlier
in various places if it is set.
llvm-svn: 166712
2012-10-25 20:33:17 +00:00
Bill Wendling
f2fff93263
Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
...
llvm-svn: 165924
2012-10-15 07:29:08 +00:00
Bill Wendling
a77399599d
Attributes Rewrite
...
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.
llvm-svn: 165917
2012-10-15 04:46:55 +00:00
Bill Wendling
a55d5af923
Pass into the AttributeWithIndex::get method an ArrayRef of attribute
...
enums. These are then created via the correct Attributes creation method.
llvm-svn: 165607
2012-10-10 06:13:42 +00:00
Jakob Stoklund Olesen
2e87ef0470
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!
llvm-svn: 158311
2012-06-11 15:37:55 +00:00
Chris Lattner
afebb9fced
switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.
...
llvm-svn: 157556
2012-05-28 01:47:44 +00:00
Chris Lattner
b051169784
rdar://11542750 - llvm.trap should be marked no return.
...
llvm-svn: 157551
2012-05-27 23:20:41 +00:00
Chris Lattner
b787e2914f
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
llvm-svn: 157545
2012-05-27 19:37:05 +00:00
Chris Lattner
073117cd52
move some code around so that Verifier.cpp can get access to the intrinsic info table.
...
llvm-svn: 157540
2012-05-27 18:28:35 +00:00
Chris Lattner
f5861a2e42
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.
llvm-svn: 157536
2012-05-27 16:39:08 +00:00
Chris Lattner
95d61a8294
rearrange some code, no functionality change.
...
llvm-svn: 157523
2012-05-26 23:03:52 +00:00
Patrik Hägglund
6f837093ba
Fixed typo in r156905.
...
llvm-svn: 157320
2012-05-23 12:34:56 +00:00
Chris Lattner
9b30a6d7da
small refinement to r157218 to save a tiny amount of table size in the common
...
case.
llvm-svn: 157312
2012-05-23 05:19:18 +00:00
Pete Cooper
869fc085f9
Added address space qualifier to intrinsic PointerType arguments.
...
llvm-svn: 157218
2012-05-21 23:21:28 +00:00
Chris Lattner
3d3d2be19b
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.
llvm-svn: 156995
2012-05-17 15:55:41 +00:00
Chris Lattner
288872000a
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.
llvm-svn: 156978
2012-05-17 05:03:24 +00:00
Chris Lattner
8962c547fa
strengthen the intrinsic descriptor stuff to be able to handle sin, cos and other
...
intrinsics that use passed-in arguments.
llvm-svn: 156977
2012-05-17 04:30:58 +00:00
Chris Lattner
c951b8da61
simplify code generated by tblgen that is not necessary since we dropped
...
compatibility with LLVM 2.x bitcode files.
llvm-svn: 156976
2012-05-17 04:07:48 +00:00
Francois Pichet
8d9b4be771
I forgot the #ifdef _MSC_VER guard in my last commit.
...
llvm-svn: 156975
2012-05-17 04:00:03 +00:00
Francois Pichet
e46a849da6
Fix the MSVC 2010 build: disable the optimizer for a problematic function.
...
llvm-svn: 156973
2012-05-17 03:38:19 +00:00
Chris Lattner
294ca0bfbc
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.
llvm-svn: 156905
2012-05-16 06:34:44 +00:00
Chris Lattner
346025b7c0
have tblgen emit cast<> instead of dyn_cast<> when we know it must succeed.
...
llvm-svn: 156902
2012-05-16 04:51:09 +00:00
Douglas Gregor
0507cabcbd
Move llvm-tblgen's StringMatcher into the TableGen library so it can
...
be used by clang-tblgen.
llvm-svn: 156000
2012-05-02 17:32:48 +00:00
Craig Topper
da52eeedcb
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
...
llvm-svn: 154658
2012-04-13 06:14:57 +00:00
Benjamin Kramer
773a45650a
TableGen: Don't emit the llvm intrinsic -> gcc builtin table, its only user was the c backend.
...
llvm-svn: 153432
2012-03-26 11:08:03 +00:00
Benjamin Kramer
c57a6d4a2a
Emit the "is an intrinsic overloaded" table as a bitfield.
...
llvm-svn: 151792
2012-03-01 02:16:57 +00:00
Benjamin Kramer
14d729cf6a
Emit the intrinsic modref info as a lookup table instead of a huge switch.
...
Shrinks BasicAliasAnalysis.o from 106k to 56k on i386.
llvm-svn: 151781
2012-03-01 01:18:32 +00:00
Craig Topper
f86322b091
Convert generated intrinsic attributes to use an array lookup as Chris suggested in PR11951.
...
llvm-svn: 151622
2012-02-28 06:32:00 +00:00
Craig Topper
dfa8617ab9
Convert assert(0) to llvm_unreachable
...
llvm-svn: 149814
2012-02-05 07:21:30 +00:00
Dan Gohman
7940e4e81d
Add basic generic CodeGen support for half.
...
llvm-svn: 146927
2011-12-20 00:02:33 +00:00
Peter Collingbourne
01246536d9
Move TableGen's parser and entry point into a library
...
This is the first step towards splitting LLVM and Clang's tblgen executables.
llvm-svn: 140951
2011-10-01 16:41:13 +00:00
Benjamin Kramer
a6129829fa
Change Intrinsic::getDeclaration and friends to take an ArrayRef.
...
llvm-svn: 135154
2011-07-14 17:45:39 +00:00
Chris Lattner
c247005424
fix the varargs version of StructType::get to not require an LLVMContext, making usage
...
much cleaner.
llvm-svn: 133364
2011-06-18 22:48:56 +00:00
John McCall
fd85fdee7c
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.
llvm-svn: 132252
2011-05-28 06:31:34 +00:00
Dan Gohman
04e46fa78b
Rename AccessesArguments and AccessesArgumentsReadonly, and rewrite
...
their comments.
llvm-svn: 118696
2010-11-10 18:30:00 +00:00
Dan Gohman
357342a9b8
Translate IntrReadArgMem to AccessesArgumentsReadonly.
...
llvm-svn: 118622
2010-11-09 20:07:20 +00:00
Michael J. Spencer
87fea6690f
Get rid of pop_macro warnings on MSVC.
...
llvm-svn: 114750
2010-09-24 19:48:47 +00:00
Michael J. Spencer
26fe225080
CBackend: Fix MSVC build.
...
This may produce warnings on MSVS, but it's better than failures.
llvm-svn: 113834
2010-09-14 04:27:38 +00:00
Dale Johannesen
9dad72e011
Add x86mmx to TableGen.
...
llvm-svn: 113671
2010-09-11 00:16:46 +00:00
Chris Lattner
1f45ad0aba
emit the LLVM intrinsic name -> intrinsic number mapping table with
...
StringMatcher instead of a linear sequence of memcmps.
llvm-svn: 113145
2010-09-06 03:58:45 +00:00
Chris Lattner
8d0ee62652
emit the __builtin -> intrinsic map with StringMatcher instead of a
...
copy of a close relative of it.
llvm-svn: 113142
2010-09-06 03:14:45 +00:00
Chris Lattner
9feb462669
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.
llvm-svn: 113136
2010-09-06 01:44:44 +00:00
Dan Gohman
8a813c4ded
Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem
...
to IntrReadWriteArgMem, as it's for reading as well as writing.
llvm-svn: 110395
2010-08-05 23:36:21 +00:00