summaryrefslogtreecommitdiff
path: root/utils/TableGen/IntrinsicEmitter.cpp
Commit message (Collapse)AuthorAge
* Added support for overloading intrinsics (atomics) based on pointersMon P Wang2008-07-30
| | | | | | | | to different address spaces. This alters the naming scheme for those intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54195 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap MVT::ValueType in a struct to get type safetyDuncan Sands2008-06-06
| | | | | | | | | | | | | | | | | and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the builtin matcher to emit a decision tree, which should help out Chris Lattner2008-01-04
| | | | | | | the VC++ 'nesting depth' issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45567 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't let IntrinsicID be uninitialized if it doesn't match.Chris Lattner2008-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45563 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the default else. This was ending in code that looked like this:Bill Wendling2008-01-03
| | | | | | | | | | | if (!strcmp(Target, "x86")) { // ... } else IntrinsicID = Intrinsic::not_intrinsic; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45557 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a build problem with VC++ by not doing the target prefixChris Lattner2008-01-02
| | | | | | | | comparison for every builtin. This reduces the depth of the if/elseif chain dramatically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45500 91177308-0d34-0410-b5e6-96231b3b80d8
* remove attributions from utils.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45419 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-17
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-03
| | | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
* Add sqrt and powi intrinsics for long double.Dale Johannesen2007-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42423 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MVT::fAny for overloading intrinsics on floating-point types.Dan Gohman2007-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41128 91177308-0d34-0410-b5e6-96231b3b80d8
* This resolves a regression of BasicAA which failed to find any memory ↵Chandler Carruth2007-08-06
| | | | | | information for overloaded intrinsics (PR1600). This resolves that issue, and improves the matching scheme to use a BitVector rather than a binary search. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40872 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth2007-08-04
| | | | | | | | | LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a pasto in a comment.Dan Gohman2007-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40527 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment.Dan Gohman2007-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37727 91177308-0d34-0410-b5e6-96231b3b80d8
* The Intrinsic::getDeclaration function's Tys parameter only contains theReid Spencer2007-05-22
| | | | | | | | | types of the iAny types involved in the overloaded intrinsic. Thus, we can't use the argument number as the index but have to count them separately in order to index Tys correctly. This patch rectifies this situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37296 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1328:Reid Spencer2007-04-16
| | | | | | | | | Don't assert everytime an intrinsic name isn't recognized. Instead, make the assert optional when callin getIntrinsicID(). This allows the assembler to handle invalid intrinsic names gracefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36120 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1297:Reid Spencer2007-04-01
| | | | | | | | | | | Implement code generation for overloaded intrinsic functions. The basic difference is that "actual" argument types must be provided when constructing intrinsic names and types. Also, for recognition, only the prefix is examined. If it matches, the suffix is assumed to match. The suffix is checked by the Verifier, however. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35539 91177308-0d34-0410-b5e6-96231b3b80d8
* the lengths of the strings are known, just use memcmpChris Lattner2007-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34321 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Function::getIntrinsicID without it needing to call Value::getName,Chris Lattner2007-02-15
| | | | | | | which allocates a string. This speeds up instcombine on 447.dealII by 5%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34318 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-15
| | | | | | | | Change use of "packed" term to "vector" in comments, strings, variable names, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-15
| | | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
* Automatically generating intrinsic declarations from Dan Gohman. ModifiedJim Laskey2007-02-07
| | | | | | | | to construct FunctionType in separate function, and, have getDeclaration return a Function instead of a Constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34008 91177308-0d34-0410-b5e6-96231b3b80d8
* Error check and eliminate unnecessary value.Jim Laskey2007-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33966 91177308-0d34-0410-b5e6-96231b3b80d8
* Support var arg intrinsics.Jim Laskey2007-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33962 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1064:Reid Spencer2007-01-12
| | | | | | | | | | | | | | | | | | | | | | | | Implement the arbitrary bit-width integer feature. The feature allows integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 16, 32, and 64 bit integers. This change does several things: 1. Introduces a new Derived Type, IntegerType, to represent the number of bits in an integer. The Type classes SubclassData field is used to store the number of bits. This allows 2^23 bits in an integer type. 2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and 64-bit integers. These are replaced with just IntegerType which is not a primitive any more. 3. Adjust the rest of LLVM to account for this change. Note that while this incremental change lays the foundation for arbitrary bit-width integers, LLVM has not yet been converted to actually deal with them in any significant way. Most optimization passes, for example, will still only deal with the byte-width integer types. Future increments will rectify this situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more static dtor issuesChris Lattner2006-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30725 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the Intrinsics.gen interface a little bitChris Lattner2006-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27345 91177308-0d34-0410-b5e6-96231b3b80d8
* Final bugfix for PR724. GCC won't inline varargs functions, so use one toChris Lattner2006-03-31
| | | | | | | | validate the prototype of intrinsic functions. This prevents GCC from going crazy and inlining too much stuff, eventually running out of memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27283 91177308-0d34-0410-b5e6-96231b3b80d8
* When emitting code for the verifier, instead of emitting each case statementChris Lattner2006-03-31
| | | | | | | | | independently, batch up checks so that identically typed intrinsics share verifier code. This dramatically reduces the size of the verifier function, which should help avoid GCC running out of memory compiling Verifier.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27281 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't sort the names before outputing the intrinsic name table. It causes aEvan Cheng2006-03-28
| | | | | | | | | mismatch against the enum table. This is a part of Sabre's master plan to drive me nuts with subtle bugs that happens to only affect x86 be. :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27237 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CodeGenIntrinsic implementation to CodeGenTarget.cpp with the rest ofChris Lattner2006-03-24
| | | | | | | | | the CodeGen* implementations. Parse the MVT::ValueType for each operand of the intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27075 91177308-0d34-0410-b5e6-96231b3b80d8
* extract some more information from the intrinsic tableChris Lattner2006-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27022 91177308-0d34-0410-b5e6-96231b3b80d8
* allow the GCCBuiltinName field to be optionalChris Lattner2006-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26784 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VC++ build error.Jeff Cohen2006-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26773 91177308-0d34-0410-b5e6-96231b3b80d8
* remove typoChris Lattner2006-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26772 91177308-0d34-0410-b5e6-96231b3b80d8
* Autogenerate a table of intrinsic names, so we can map from intrinsic ID toChris Lattner2006-03-15
| | | | | | | LLVM intrinsic function name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26771 91177308-0d34-0410-b5e6-96231b3b80d8
* Autogenerate code to map from GCC builtin to LLVM intrinsic.Chris Lattner2006-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26770 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a newline at the end to avoid gcc warnings.Reid Spencer2006-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26749 91177308-0d34-0410-b5e6-96231b3b80d8
* emit a mapping from LLVM intrinsic -> GCC builtins.Chris Lattner2006-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26736 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that packed type operands have the right size and base type.Chris Lattner2006-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26735 91177308-0d34-0410-b5e6-96231b3b80d8
* fix pasto in generate assertion msgChris Lattner2006-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26706 91177308-0d34-0410-b5e6-96231b3b80d8
* generate side-effect infoChris Lattner2006-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26672 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse mod/ref properties, autogen mod/ref informationChris Lattner2006-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26669 91177308-0d34-0410-b5e6-96231b3b80d8
* parse intrinsic typesChris Lattner2006-03-09
| | | | | | | autogenerate an intrinsic verifier git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26666 91177308-0d34-0410-b5e6-96231b3b80d8
* autogenerate the function name recognizerChris Lattner2006-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26663 91177308-0d34-0410-b5e6-96231b3b80d8
* initial implementation of intrinsic parsingChris Lattner2006-03-03
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26495 91177308-0d34-0410-b5e6-96231b3b80d8