summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Small optimization of parameter attribute lookup.Duncan Sands2007-11-301-1/+1
| | | | llvm-svn: 44458
* Add a convenience method for modifying parameterDuncan Sands2007-11-301-1/+59
| | | | | | | | attributes. While there, I noticed that not all attribute methods returned a pointer-to-constant, so I fixed that. llvm-svn: 44457
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-7/+0
| | | | | | use them. llvm-svn: 44403
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-5/+29
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* Fix PR1816. If a bitcast of a function only exists because of aDuncan Sands2007-11-251-1/+44
| | | | | | | | | trivial difference in function attributes, allow calls to it to be converted to direct calls. Based on a patch by Török Edwin. While there, move the various lists of mutually incompatible parameters etc out of the verifier and into ParameterAttributes.h. llvm-svn: 44315
* Rename the 'const' parameter attribute to 'readnone',Duncan Sands2007-11-221-4/+4
| | | | | | | and the 'pure' parameter attribute to 'readonly'. Names suggested by DannyB. llvm-svn: 44273
* In order for parameter attribute uniquing to makeDuncan Sands2007-11-201-2/+6
| | | | | | | | | | | | any sense it is important that ParamAttr::None gets treated the same as not supplying an attribute at all. Rather than stripping ParamAttr::None out of the list of attributes, assert if ParamAttr::None is seen. Fix up the bitcode reader which liked to insert ParamAttr::None all over the place. Patch based on one by Török Edwin. llvm-svn: 44250
* Add pure/const attributes. Documentation will follow.Anton Korobeynikov2007-11-141-0/+4
| | | | llvm-svn: 44109
* Two ParamAttrsVectors which differ by a permutationDuncan Sands2007-09-111-0/+4
| | | | | | | | | | of their elements do not yield the same ParamAttrsList, though they should. On the other hand, everyone seems to pass such vectors with elements ordered by increasing index, so rather than sorting the elements simply assert that the elements are ordered in this way. llvm-svn: 41845
* When Intrinsic::getName is constructing names for overloaded intrinsics,Dan Gohman2007-08-201-1/+2
| | | | | | | | use the ValueType name instead of the llvm type name, to match what the verifier expects. For integers these are the same, but for floating-point values the intrinsics use f32/f64 instead of float/double. llvm-svn: 41189
* Compute the argument list as lazily as possible. This ensures that clientsChris Lattner2007-08-181-7/+24
| | | | | | | | that don't use it don't have to pay the memory cost for the arguments. This allows us to avoid creating Argument nodes for many prototypes and for clients who lazily deserialize code from a bytecode file. llvm-svn: 41166
* Support for trampolines, except for X86 codegen which isDuncan Sands2007-07-271-0/+2
| | | | | | still under discussion. llvm-svn: 40549
* For PR1553:Reid Spencer2007-07-191-2/+2
| | | | | | | | Change the keywords for the zext and sext parameter attributes to be zeroext and signext so they don't conflict with the keywords for the instructions of the same name. This gets around the ambiguity. llvm-svn: 40069
* Add the byval attributeRafael Espindola2007-07-061-0/+2
| | | | llvm-svn: 37940
* Fix a user-reported error building with GCC 3.4.4 on Cygwin.Chris Lattner2007-06-051-1/+1
| | | | llvm-svn: 37445
* Commit first round work of PR1373. "noalias" is now fully supported inZhou Sheng2007-06-051-0/+2
| | | | | | | VMCore, BitCode, and Assembly. Documentation and test case paramattrs.ll updated also. llvm-svn: 37432
* simplify some codeChris Lattner2007-04-251-5/+2
| | | | llvm-svn: 36427
* For PR1136:Reid Spencer2007-04-221-0/+18
| | | | | | | Add reference counting to ParamAttrsList and make use of it in Function, CallInst and InvokeInst classes. llvm-svn: 36346
* For PR1146:Reid Spencer2007-04-221-27/+22
| | | | | | | | Make ParamAttrsList objects unique. You can no longer directly create or destroy them but instead must go through the ParamAttrsList::get() interface. llvm-svn: 36327
* merge several fields in GlobalValue to use the same word, move CallingConvChris Lattner2007-04-171-1/+0
| | | | | | | | | field into SubclassData in Value. This shrinks GlobalVAlue from 48->40 bytes, Function from 88->76, and GlobalVariable from 76->68. This trims 4640 bytes off my testcase, reading a bc file without materializing any functions. llvm-svn: 36192
* The (negative) offset from a SymbolTableListTraits-using ilist to its containerChris Lattner2007-04-171-2/+0
| | | | | | | | | object is always constant. As such, evaluate it at compile time instead of storing it as an ivar in SymbolTableListTraits. This shrinks every SymbolTableListTraits ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes, and Module from 60->52 bytes. llvm-svn: 36189
* Refactor SymbolTableListTraits to only have a single pointer in it, insteadChris Lattner2007-04-171-5/+2
| | | | | | | | of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8 bytes (68->60). On a testcase of mine, this reduces the memory used to read a module header from 565680b to 561024, a little over 4K. llvm-svn: 36188
* Don't return 0 if the len == 5, let the assert handle that case.Reid Spencer2007-04-161-1/+1
| | | | | | Thanks, Chris. llvm-svn: 36139
* Fix test/CodeGen/Generic/vector-constantexpr.llReid Spencer2007-04-161-0/+2
| | | | llvm-svn: 36123
* For PR1328:Reid Spencer2007-04-161-3/+4
| | | | | | | | 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. llvm-svn: 36120
* For PR1146:Reid Spencer2007-04-111-8/+8
| | | | | | | Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. llvm-svn: 35877
* For PR1146:Reid Spencer2007-04-091-0/+64
| | | | | | | * Add ParamAttrList pointers to Function and CallInst. * Move the implementation of ParamAttrList from Type.cpp to Function.cpp llvm-svn: 35818
* For PR1146:Reid Spencer2007-04-091-2/+2
| | | | | | Parameter attributes can now be defaulted for intrinsics. llvm-svn: 35809
* For PR1297:Reid Spencer2007-04-011-5/+14
| | | | | | | | | | Implement "actual" argument types for the Intrinsic member functions. This involves changing the getName, getType, and getDeclaration methods to have optional parameters for the actual types. These are necessary in order for the type/name to be constructed properly for overloaded intrinsics. Only the caller knows the actual argument types desired. llvm-svn: 35541
* Implement Function::getIntrinsicID without it needing to call Value::getName,Chris Lattner2007-02-151-3/+6
| | | | | | which allocates a string. This speeds up instcombine on 447.dealII by 5%. llvm-svn: 34318
* Switch ValueSymbolTable to use StringMap<Value*> instead of ↵Chris Lattner2007-02-121-1/+2
| | | | | | | | | std::map<std::string, Value*> as its main datastructure. There are many improvements yet to be made, but this speeds up opt --std-compile-opts on 447.dealII by 7.3%. llvm-svn: 34193
* Automatically generating intrinsic declarations from Dan Gohman. ModifiedJim Laskey2007-02-071-0/+19
| | | | | | | to construct FunctionType in separate function, and, have getDeclaration return a Function instead of a Constant. llvm-svn: 34008
* For PR411:Reid Spencer2007-02-051-4/+2
| | | | | | | | | | This patch replaces the SymbolTable class with ValueSymbolTable which does not support types planes. This means that all symbol names in LLVM must now be unique. The patch addresses the necessary changes to deal with this and removes code no longer needed as a result. This completes the bulk of the changes for this PR. Some cleanup patches will follow. llvm-svn: 33918
* For PR645:Reid Spencer2007-01-261-39/+0
| | | | | | | Remove the Function::renameLocalSymbols function as it is no longer needed. llvm-svn: 33522
* For PR411:Reid Spencer2007-01-061-2/+2
| | | | | | | | | Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. llvm-svn: 32956
* For PR950:Reid Spencer2006-12-311-1/+1
| | | | | | Change signed integer type names to unsigned equivalents. llvm-svn: 32780
* For PR950:Reid Spencer2006-11-271-2/+2
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* Remove unused variable.Reid Spencer2006-11-021-1/+1
| | | | llvm-svn: 31376
* Implement Intrinsic::getNameChris Lattner2006-03-251-0/+11
| | | | llvm-svn: 27108
* Use the function name matcher autogenerated from the .td file.Chris Lattner2006-03-091-76/+3
| | | | llvm-svn: 26664
* remove dbg_declare, it's not used yet.Chris Lattner2006-03-091-1/+0
| | | | llvm-svn: 26659
* remove the read/write port/io intrinsics.Chris Lattner2006-03-031-6/+0
| | | | llvm-svn: 26479
* Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolvingChris Lattner2006-03-021-3/+6
| | | | | | | | | | | PR709, and paving the way for future progress. Significantly refactor autoupgrading code, to handle the more complex case (where we upgrade one argument in a function), and fix some bugs in it. Testcase here: llvm/test/Regression/Bytecode/memcpy.ll llvm-svn: 26474
* For PR411:Reid Spencer2006-01-161-42/+56
| | | | | | | | | | | | | | | | This patch is an incremental step towards supporting a flat symbol table. It de-overloads the intrinsic functions by providing type-specific intrinsics and arranging for automatically upgrading from the old overloaded name to the new non-overloaded name. Specifically: llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64 llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64 llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64 llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64 llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64 New code should not use the overloaded intrinsic names. Warnings will be emitted if they are used. llvm-svn: 25366
* add a missing break that Reid noticed.Chris Lattner2006-01-151-0/+1
| | | | llvm-svn: 25328
* Add bswap intrinsics as documented in the Language ReferenceNate Begeman2006-01-141-0/+5
| | | | llvm-svn: 25309
* Add recognition and verification of new llvm.stacksave/llvm.stackrestore ↵Chris Lattner2006-01-131-4/+6
| | | | | | intrinsics llvm-svn: 25266
* continued readcyclecounter supportAndrew Lenharth2005-11-111-3/+4
| | | | llvm-svn: 24300
* add support for explicit calling conventionsChris Lattner2005-05-061-0/+1
| | | | llvm-svn: 21746
* Implement count leading zeros (ctlz), count trailing zeros (cttz), and countAndrew Lenharth2005-05-031-0/+5
| | | | | | | | | population (ctpop). Generic lowering is implemented, however only promotion is implemented for SelectionDAG at the moment. More coming soon. llvm-svn: 21676
OpenPOWER on IntegriCloud