summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* Fix MSVC 2012 warning about a 32-bit shift that should be 64-bitReid Kleckner2013-01-251-2/+2
| | | | llvm-svn: 173454
* Use the AttributeSet query instead of the Attribute query.Bill Wendling2013-01-251-2/+2
| | | | llvm-svn: 173434
* Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.Bill Wendling2013-01-242-6/+14
| | | | llvm-svn: 173313
* Cleanup the AttributeSetNodes that we create.Bill Wendling2013-01-241-0/+7
| | | | llvm-svn: 173311
* Create a new class: AttributeSetNode.Bill Wendling2013-01-243-1/+107
| | | | | | | | | | This is a helper class for the AttributeSetImpl class. It holds a set of attributes that apply to a single element: function, return type, or parameter. These are uniqued. llvm-svn: 173310
* Push down the conversion of the alignment from the bit mask to a real number ↵Bill Wendling2013-01-231-4/+6
| | | | | | into the attribute implementation class. llvm-svn: 173304
* Remove dead methods.Bill Wendling2013-01-232-23/+0
| | | | llvm-svn: 173302
* Add the IR attribute 'sspstrong'.Bill Wendling2013-01-231-0/+3
| | | | | | | | | | | | | | | | | | | | | SSPStrong applies a heuristic to insert stack protectors in these situations: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) This patch implements the SSPString attribute to be equivalent to SSPRequired. This will change in a subsequent patch. llvm-svn: 173230
* Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2013-01-233-17/+23
| | | | | | | | | attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173228
* Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKindBill Wendling2013-01-234-12/+33
| | | | | | when removing one attribute. This further encapsulates the use of the attributes. llvm-svn: 173214
* Use the AttributeSet when adding multiple attributes and an Attribute::AttrKindBill Wendling2013-01-231-7/+14
| | | | | | when adding a single attribute to the function. llvm-svn: 173210
* More encapsulation work.Bill Wendling2013-01-224-37/+36
| | | | | | | Use the AttributeSet when we're talking about more than one attribute. Add a function that adds a single attribute. No functionality change intended. llvm-svn: 173196
* Make APFloat constructor require explicit semantics.Tim Northover2013-01-222-5/+6
| | | | | | | | | Previously we tried to infer it from the bit width size, with an added IsIEEE argument for the PPC/IEEE 128-bit case, which had a default value. This default value allowed bugs to creep in, where it was inappropriate. llvm-svn: 173138
* Add a new method that adds the AttributeSet at the given index. No ↵Bill Wendling2013-01-221-8/+3
| | | | | | functional change. llvm-svn: 173109
* Add the attributes that are passed in instead of the ones we're merging into.Bill Wendling2013-01-221-2/+2
| | | | llvm-svn: 173108
* Use AttributeSet instead of Attribute to verify things.Bill Wendling2013-01-211-53/+52
| | | | llvm-svn: 173101
* Have AttributeSet::getRetAttributes() return an AttributeSet instead of ↵Bill Wendling2013-01-211-12/+23
| | | | | | | | | Attribute. This further restricts the use of the Attribute class to the Attribute family of classes. llvm-svn: 173098
* Make AttributeSet::getFnAttributes() return an AttributeSet instead of an ↵Bill Wendling2013-01-212-0/+22
| | | | | | | | | Attribute. This is more code to isolate the use of the Attribute class to that of just holding one attribute instead of a collection of attributes. llvm-svn: 173094
* Fix a latent bug exposed by recent static member debug info changes.David Blaikie2013-01-191-1/+2
| | | | | | | We weren't encoding boolean constants correctly due to modeling boolean as a signed type & then sign extending an i1 up to a byte & getting 255. llvm-svn: 172926
* If the attributes don't exist, just bail for now.Bill Wendling2013-01-181-1/+1
| | | | llvm-svn: 172854
* Use AttributeSet accessor methods instead of Attribute accessor methods.Bill Wendling2013-01-182-7/+11
| | | | | | | Further encapsulation of the Attribute object. Don't allow direct access to the Attribute object as an aggregate. llvm-svn: 172853
* Push some more methods down to hide the use of the Attribute class.Bill Wendling2013-01-182-31/+70
| | | | | | | | Because the Attribute class is going to stop representing a collection of attributes, limit the use of it as an aggregate in favor of using AttributeSet. This replaces some of the uses for querying the function attributes. llvm-svn: 172844
* [IR] Add 'Append' and 'AppendUnique' module flag behaviors.Daniel Dunbar2013-01-161-13/+33
| | | | llvm-svn: 172659
* Allow vectors in CreatePointerCast of constants.Evgeniy Stepanov2013-01-161-3/+4
| | | | llvm-svn: 172615
* Define metadata interfaces for describing a static data memberEric Christopher2013-01-162-3/+31
| | | | | | | | | | | of a class. Emit static data member declarations and definitions through correctly. Part of PR14471. Patch by Paul Robinson! llvm-svn: 172590
* [IR] Add verification for module flags with the "require" behavior.Daniel Dunbar2013-01-151-7/+35
| | | | llvm-svn: 172549
* Allow vectors in CreatePointerCast.Evgeniy Stepanov2013-01-151-3/+3
| | | | | | Both underlying IR operations support vectors of pointers already. llvm-svn: 172538
* [IR] Add verifier support for llvm.module.flags.Daniel Dunbar2013-01-151-0/+57
| | | | | | | - Also, update the LangRef documentation on module flags to match the implementation. llvm-svn: 172498
* Fix CastingDavid Greene2013-01-141-1/+1
| | | | | | Stop a gcc warning about casting away const. llvm-svn: 172465
* Support for half intrinsics. Pushes MMX into slower encoding path.Michael Ilseman2013-01-112-17/+23
| | | | llvm-svn: 172159
* CastInst::castIsValid should return true if the dest type is the same asEvan Cheng2013-01-101-0/+5
| | | | | | Value's current type. The casting is trivial even for aggregate type. llvm-svn: 172143
* Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test ↵Bill Wendling2013-01-093-21/+24
| | | | | | hangings. llvm-svn: 172020
* Alter the hasing computation when inserting into the folding set.Bill Wendling2013-01-091-2/+1
| | | | llvm-svn: 171960
* Add comment to the definition of Constant::isZeroValue(). Shuxin Yang2013-01-091-0/+2
| | | | | | | | (There already has a concise comment to the declaration.) Thank Eric Christopher for his feedback! llvm-svn: 171926
* Forgot the namespace identifier.Bill Wendling2013-01-091-2/+2
| | | | llvm-svn: 171924
* Add the integer value of the ConstantInt instead of the Constant* value.Bill Wendling2013-01-092-6/+9
| | | | | | This is causing some problems. The root cause is unknown at this time. llvm-svn: 171923
* Consider expression "0.0 - X" as the negation of X ifShuxin Yang2013-01-092-3/+15
| | | | | | | - this expression is explicitly marked no-signed-zero, or - no-signed-zero of this expression can be derived from some context. llvm-svn: 171922
* Remove the llvm-local DW_TAG_vector_type tag and add a test toEric Christopher2013-01-082-5/+7
| | | | | | make sure that vector types do work. llvm-svn: 171833
* Fix comment.Eric Christopher2013-01-081-1/+2
| | | | llvm-svn: 171832
* Mark artificial types as such in the annotated debug output.David Blaikie2013-01-081-0/+3
| | | | llvm-svn: 171826
* Remove what appears to be a dead llvm-specific debug tag.Eric Christopher2013-01-081-1/+0
| | | | llvm-svn: 171821
* Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.Chandler Carruth2013-01-072-2/+2
| | | | llvm-svn: 171749
* Rough out a new c'tor for the AttrBuilder class.Bill Wendling2013-01-072-3/+21
| | | | | | | | This c'tor takes the AttributeSet class as the parameter. It will eventually grab the attributes from the specified index and create a new attribute builder with those attributes. llvm-svn: 171712
* PR14759: Debug info support for C++ member pointers.David Blaikie2013-01-072-0/+20
| | | | | | | | This works fine with GDB for member variable pointers, but GDB's support for member function pointers seems to be quite unrelated to DW_TAG_ptr_to_member_type. (see GDB bug 14998 for details) llvm-svn: 171698
* Move the initialization to the Analysis library as well as the pass.Chandler Carruth2013-01-071-1/+0
| | | | | | | This was (somewhat distressingly) only caught be the ocaml bindings tests... llvm-svn: 171690
* Move TargetTransformInfo to live under the Analysis library. This noChandler Carruth2013-01-072-271/+0
| | | | | | | longer would violate any dependency layering and it is in fact an analysis. =] llvm-svn: 171686
* Switch TargetTransformInfo from an immutable analysis pass that requiresChandler Carruth2013-01-071-44/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a TargetMachine to construct (and thus isn't always available), to an analysis group that supports layered implementations much like AliasAnalysis does. This is a pretty massive change, with a few parts that I was unable to easily separate (sorry), so I'll walk through it. The first step of this conversion was to make TargetTransformInfo an analysis group, and to sink the nonce implementations in ScalarTargetTransformInfo and VectorTargetTranformInfo into a NoTargetTransformInfo pass. This allows other passes to add a hard requirement on TTI, and assume they will always get at least on implementation. The TargetTransformInfo analysis group leverages the delegation chaining trick that AliasAnalysis uses, where the base class for the analysis group delegates to the previous analysis *pass*, allowing all but tho NoFoo analysis passes to only implement the parts of the interfaces they support. It also introduces a new trick where each pass in the group retains a pointer to the top-most pass that has been initialized. This allows passes to implement one API in terms of another API and benefit when some other pass above them in the stack has more precise results for the second API. The second step of this conversion is to create a pass that implements the TargetTransformInfo analysis using the target-independent abstractions in the code generator. This replaces the ScalarTargetTransformImpl and VectorTargetTransformImpl classes in lib/Target with a single pass in lib/CodeGen called BasicTargetTransformInfo. This class actually provides most of the TTI functionality, basing it upon the TargetLowering abstraction and other information in the target independent code generator. The third step of the conversion adds support to all TargetMachines to register custom analysis passes. This allows building those passes with access to TargetLowering or other target-specific classes, and it also allows each target to customize the set of analysis passes desired in the pass manager. The baseline LLVMTargetMachine implements this interface to add the BasicTTI pass to the pass manager, and all of the tools that want to support target-aware TTI passes call this routine on whatever target machine they end up with to add the appropriate passes. The fourth step of the conversion created target-specific TTI analysis passes for the X86 and ARM backends. These passes contain the custom logic that was previously in their extensions of the ScalarTargetTransformInfo and VectorTargetTransformInfo interfaces. I separated them into their own file, as now all of the interface bits are private and they just expose a function to create the pass itself. Then I extended these target machines to set up a custom set of analysis passes, first adding BasicTTI as a fallback, and then adding their customized TTI implementations. The fourth step required logic that was shared between the target independent layer and the specific targets to move to a different interface, as they no longer derive from each other. As a consequence, a helper functions were added to TargetLowering representing the common logic needed both in the target implementation and the codegen implementation of the TTI pass. While technically this is the only change that could have been committed separately, it would have been a nightmare to extract. The final step of the conversion was just to delete all the old boilerplate. This got rid of the ScalarTargetTransformInfo and VectorTargetTransformInfo classes, all of the support in all of the targets for producing instances of them, and all of the support in the tools for manually constructing a pass based around them. Now that TTI is a relatively normal analysis group, two things become straightforward. First, we can sink it into lib/Analysis which is a more natural layer for it to live. Second, clients of this interface can depend on it *always* being available which will simplify their code and behavior. These (and other) simplifications will follow in subsequent commits, this one is clearly big enough. Finally, I'm very aware that much of the comments and documentation needs to be updated. As soon as I had this working, and plausibly well commented, I wanted to get it committed and in front of the build bots. I'll be doing a few passes over documentation later if it sticks. Commits to update DragonEgg and Clang will be made presently. llvm-svn: 171681
* Include access modifiers in subprogram metadata IR comment.David Blaikie2013-01-051-0/+5
| | | | | | | Based on code review feedback in r171604 from Chandler Carruth & Eric Christopher. llvm-svn: 171636
* Attribute: Make hashes match when looking up AttributeImpls.Benjamin Kramer2013-01-051-1/+2
| | | | | | | This isn't optimal either but fixes a massive compile time regression from the attribute uniquing work. llvm-svn: 171624
* Convert the TargetTransformInfo from an immutable pass with dynamicChandler Carruth2013-01-052-15/+248
| | | | | | | | | | | | | | | | | | | | | | | | | interfaces which could be extracted from it, and must be provided on construction, to a chained analysis group. The end goal here is that TTI works much like AA -- there is a baseline "no-op" and target independent pass which is in the group, and each target can expose a target-specific pass in the group. These passes will naturally chain allowing each target-specific pass to delegate to the generic pass as needed. In particular, this will allow a much simpler interface for passes that would like to use TTI -- they can have a hard dependency on TTI and it will just be satisfied by the stub implementation when that is all that is available. This patch is a WIP however. In particular, the "stub" pass is actually the one and only pass, and everything there is implemented by delegating to the target-provided interfaces. As a consequence the tools still have to explicitly construct the pass. Switching targets to provide custom passes and sinking the stub behavior into the NoTTI pass is the next step. llvm-svn: 171621
OpenPOWER on IntegriCloud