summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
...
* Store intrinsic ID by value in Function instead of a string lookup. NFC.Pete Cooper2015-05-193-35/+16
| | | | | | | | | | | | On 64-bit targets, Function has 4-bytes of padding in its struct layout. This uses the space for the intrinsic ID. It is set and recalculated whenever the function name is set. This is similar to the current behavior which clears the function from the intrinsic ID cache when its renamed. The intrinsic cache itself is removed as the only purpose was to speedup calls to getIntrinsicID() which now just reading the new field in the struct. Reviewed by Duncan. http://reviews.llvm.org/D9836 llvm-svn: 237642
* Move Function::lookupIntrinsicID to a static method. NFCPete Cooper2015-05-191-15/+14
| | | | llvm-svn: 237641
* Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced ↵David Blaikie2015-05-181-15/+12
| | | | | | init only llvm-svn: 237624
* Fix some odd whitespace and formatting errors while makingEric Christopher2015-05-181-35/+23
| | | | | | changes in ConstantsContext.h. llvm-svn: 237620
* Extract the load/store type verification to a separate function.Filipe Cabecinhas2015-05-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Added isLoadableOrStorableType to PointerType. We were doing some checks in some places, occasionally assert()ing instead of telling the caller. With this patch, I'm putting all type checking in the same place for load/store type instructions, and verifying the same thing every time. I also added a check for load/store of a function type. Applied extracted check to Load, Store, and Cmpxcg. I don't have exhaustive tests for all of these, but all Error() calls in TypeCheckLoadStoreInst are being tested (in invalid.test). Reviewers: dblaikie, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9785 llvm-svn: 237619
* [Verifier] Assert gc_relocate always return a pointer type Chen Li2015-05-181-2/+12
| | | | | | | | | | | | | | Summary: Add an assertion in verifier.cpp to make sure gc_relocate relocate a gc pointer, and its return type has the same address space with the relocated pointer. Reviewers: reames, AndyAyers, sanjoy, pgavlin Reviewed By: pgavlin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9695 llvm-svn: 237605
* While in GlobalValue fix the function(s) that don't follow theEric Christopher2015-05-152-5/+5
| | | | | | naming convention and update users. llvm-svn: 237461
* Add a speculative execution passJingyue Wu2015-05-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is a pass for speculative execution of instructions for simple if-then (triangle) control flow. It's aimed at GPUs, but could perhaps be used in other contexts. Enabling this pass gives us a 1.0% geomean improvement on Google benchmark suites, with one benchmark improving 33%. Credit goes to Jingyue Wu for writing an earlier version of this pass. Patched by Bjarke Roune. Test Plan: This patch adds a set of tests in test/Transforms/SpeculativeExecution/spec.ll The pass is controlled by a flag which defaults to having the pass not run. Reviewers: eliben, dberlin, meheff, jingyue, hfinkel Reviewed By: jingyue, hfinkel Subscribers: majnemer, jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D9360 llvm-svn: 237459
* [opaque pointer type] Use GlobalVariable::getValueType rather than accessing ↵David Blaikie2015-05-131-1/+1
| | | | | | it through the GV's pointee type llvm-svn: 237311
* [Safepoints][Verifier] Fix a tautological Assert.Sanjoy Das2015-05-131-1/+1
| | | | llvm-svn: 237287
* [opaque pointer type] Constant Folding: Use GEPOperator to access the ↵David Blaikie2015-05-131-2/+2
| | | | | | pointee source type rather than going through the first operand's pointer type llvm-svn: 237274
* [opaque pointer type] Pass the explicit function type down to the ↵David Blaikie2015-05-131-3/+4
| | | | | | instruction constructor when parsing invoke instructions llvm-svn: 237273
* Add function entry count metadata.Diego Novillo2015-05-133-0/+62
| | | | | | | | | | | | | | | | | | | | Summary: This adds three Function methods to handle function entry counts: setEntryCount() and getEntryCount(). Entry counts are stored under the MD_prof metadata node with the name "function_entry_count". They are unsigned 64 bit values set by profilers (instrumentation and sample profiler changes coming up). Added documentation for new profile metadata and tests. Reviewers: dexonsmith, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9628 llvm-svn: 237260
* [Statepoints] Support for "patchable" statepoints.Sanjoy Das2015-05-122-40/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change adds two new parameters to the statepoint intrinsic, `i64 id` and `i32 num_patch_bytes`. `id` gets propagated to the ID field in the generated StackMap section. If the `num_patch_bytes` is non-zero then the statepoint is lowered to `num_patch_bytes` bytes of nops instead of a call (the spill and reload code remains unchanged). A non-zero `num_patch_bytes` is useful in situations where a language runtime requires complete control over how a call is lowered. This change brings statepoints one step closer to patchpoints. With some additional work (that is not part of this patch) it should be possible to get rid of `TargetOpcode::STATEPOINT` altogether. PlaceSafepoints generates `statepoint` wrappers with `id` set to `0xABCDEF00` (the old default value for the ID reported in the stackmap) and `num_patch_bytes` set to `0`. This can be made more sophisticated later. Reviewers: reames, pgavlin, swaroop.sridhar, AndyAyers Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9546 llvm-svn: 237214
* Convert PHI getIncomingValue() to foreach over incoming_values(). NFC.Pete Cooper2015-05-121-2/+2
| | | | | | | | We already had a method to iterate over all the incoming values of a PHI. This just changes all eligible code to use it. Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB. llvm-svn: 237169
* Changed renaming of local symbols by inserting a dot vefore the numeric suffix.Sunil Srivastava2015-05-121-1/+1
| | | | | | | One code change and several test changes to match that details in http://reviews.llvm.org/D9481 llvm-svn: 237150
* Rename variables in gc_relocate related functions to follow LLVM's naming ↵Sanjoy Das2015-05-111-8/+8
| | | | | | | | | | | | | | | | | | | | conventions. Summary: This patch is to rename some variables to CamelCase in gc_relocate related functions. There is no functionality change. Patch by Chen Li! Reviewers: reames, AndyAyers, sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9681 llvm-svn: 237069
* Simplify a return expression and an access to an alloca's allocated typeDavid Blaikie2015-05-111-3/+3
| | | | llvm-svn: 237065
* [RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to ↵Sanjoy Das2015-05-111-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vector of pointers Summary: In RewriteStatepointsForGC pass, we create a gc_relocate intrinsic for each relocated pointer, and the gc_relocate has the same type with the pointer. During the creation of gc_relocate intrinsic, llvm requires to mangle its type. However, llvm does not support mangling of all possible types. RewriteStatepointsForGC will hit an assertion failure when it tries to create a gc_relocate for pointer to vector of pointers because mangling for vector of pointers is not supported. This patch changes the way RewriteStatepointsForGC pass creates gc_relocate. For each relocated pointer, we erase the type of pointers and create an unified gc_relocate of type i8 addrspace(1)*. Then a bitcast is inserted to convert the gc_relocate to the correct type. In this way, gc_relocate does not need to deal with different types of pointers and the unsupported type mangling is no longer a problem. This change would also ease further merge when LLVM erases types of pointers and introduces an unified pointer type. Some minor changes are also introduced to gc_relocate related part in InstCombineCalls, CodeGenPrepare, and Verifier accordingly. Patch by Chen Li! Reviewers: reames, AndyAyers, sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9592 llvm-svn: 237009
* AVX-512: Changed CC parameter in "cmp" intrinsicElena Demikhovsky2015-05-111-89/+0
| | | | | | | | from i8 to i32 according to the Intel Spec by Igor Breger (igor.breger@intel.com) llvm-svn: 236979
* Revert r236912.Quentin Colombet2015-05-091-4/+4
| | | | | | | | | | | | | | Author: dblaikie Date: Fri May 8 17:47:50 2015 New Revision: 236912 URL: http://llvm.org/viewvc/llvm-project?rev=236912&view=rev Log: [opaque pointer type] Cleanup a few references to pointee types using nearby non-pointee types of the same value & cleanup a convoluted return expression while I'm here llvm-svn: 236919
* [opaque pointer type] Cleanup a few references to pointee types using nearby ↵David Blaikie2015-05-081-4/+4
| | | | | | | | non-pointee types of the same value & cleanup a convoluted return expression while I'm here llvm-svn: 236912
* Replace branch-to-unreachable with assertion.David Blaikie2015-05-081-4/+2
| | | | llvm-svn: 236893
* Extend the statepoint intrinsic to allow statepoints to be marked as ↵Pat Gavlin2015-05-082-8/+33
| | | | | | | | | | | | | | | | | | | | | | transitions from GC-aware code to code that is not GC-aware. This changes the shape of the statepoint intrinsic from: @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 unused, ...call args, i32 # deopt args, ...deopt args, ...gc args) to: @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 flags, ...call args, i32 # transition args, ...transition args, i32 # deopt args, ...deopt args, ...gc args) This extension offers the backend the opportunity to insert (somewhat) arbitrary code to manage the transition from GC-aware code to code that is not GC-aware and back. In order to support the injection of transition code, this extension wraps the STATEPOINT ISD node generated by the usual lowering lowering with two additional nodes: GC_TRANSITION_START and GC_TRANSITION_END. The transition arguments that were passed passed to the intrinsic (if any) are lowered and provided as operands to these nodes and may be used by the backend during code generation. Eventually, the lowering of the GC_TRANSITION_{START,END} nodes should be informed by the GC strategy in use for the function containing the intrinsic call; for now, these nodes are instead replaced with no-ops. Differential Revision: http://reviews.llvm.org/D9501 llvm-svn: 236888
* [opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr.David Blaikie2015-05-085-19/+53
| | | | | | | Also a couple of other changes to avoid use of PointerType::getElementType here & there too. llvm-svn: 236799
* Recommit r236670: [opaque pointer type] Pass explicit pointer type through ↵David Blaikie2015-05-073-12/+34
| | | | | | | | | | GEP constant folding"" Clang regressions were caused by more stringent assertion checking introduced by this change. Small fix needed to clang has been committed in r236751. llvm-svn: 236752
* AVX-512: Added all forms of FP compare instructions for KNL and SKX.Elena Demikhovsky2015-05-071-23/+0
| | | | | | | | Added intrinsics for the instructions. CC parameter of the intrinsics was changed from i8 to i32 according to the spec. By Igor Breger (igor.breger@intel.com) llvm-svn: 236714
* Revert "[opaque pointer type] Pass explicit pointer type through GEP ↵David Blaikie2015-05-063-34/+12
| | | | | | | | | | constant folding" Causes regressions in Clang. Reverting while I investigate. This reverts commit r236670. llvm-svn: 236678
* Let llc and opt override "-target-cpu" and "-target-features" via command lineAkira Hatanaka2015-05-061-0/+13
| | | | | | | | | | | options. This commit fixes a bug in llc and opt where "-mcpu" and "-mattr" wouldn't override function attributes "-target-cpu" and "-target-features" in the IR. Differential Revision: http://reviews.llvm.org/D9537 llvm-svn: 236677
* [IRBuilder] Add a CreateGCStatepointInvoke.Sanjoy Das2015-05-061-21/+76
| | | | | | | | | | | Renames the original CreateGCStatepoint to CreateGCStatepointCall, and moves invoke creating functionality from PlaceSafepoints.cpp to IRBuilder.cpp. This changes the labels generated for PlaceSafepoints/invokes.ll so use a regex there to make the basic block labels more resilient. llvm-svn: 236672
* [opaque pointer type] Pass explicit pointer type through GEP constant foldingDavid Blaikie2015-05-063-12/+34
| | | | llvm-svn: 236670
* Change typeIncompatible to return an AttrBuilder instead of new-ing an ↵Pete Cooper2015-05-062-4/+5
| | | | | | | | | | AttributeSet. This makes use of the new API which can remove attributes from a set given a builder. This is much faster than creating a temporary set and reduces llc time by about 0.3% which was all spent creating temporary attributes sets on the context. llvm-svn: 236668
* Add remove method to operate on AttrBuilder instead of AttributeSet.Pete Cooper2015-05-061-3/+76
| | | | | | | | | | Prior to this change we would have to construct a temporary AttributeSet (which isn't temporary at all given that its allocated on the context), just to contain the attributes in the builder, then call remove on that. Now we can just remove any attributes from the (lightweight and really temporary) builder itself. Will be used in a future commit to remove some temporary attributes sets. llvm-svn: 236666
* Remove unnecessary #ifndef NDEBUG guard around assert. NFC.Pete Cooper2015-05-061-2/+0
| | | | | | Found by Hal Finkel in the review of AttributeSets. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150504/275058.html llvm-svn: 236662
* Add missing dereferenceable_or_null gettersSanjoy Das2015-05-063-0/+19
| | | | | | | | | | | | | | | | | Summary: Add missing dereferenceable_or_null getters required for http://reviews.llvm.org/D9253 change. Separated from the D9253 review. Patch by Artur Pilipenko! Reviewers: sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9499 llvm-svn: 236615
* [DomTree] verifyDomTree to unconditionally perform DT verificationAdam Nemet2015-05-061-4/+4
| | | | | | | | | | | | I folded the check for the flag -verify-dom-info into the only caller where I think it is supposed to be checked: verifyAnalysis. (The idea of the flag is to enable this expensive verification in verifyPreservedAnalysis.) I'm assuming that when manually scheduling the verification pass with -passes=verify<domtree>, we do want to perform the verification. llvm-svn: 236575
* [IRBuilder] Fix indentation. NFC.Sanjoy Das2015-05-061-20/+19
| | | | | | Whitespace-only change. llvm-svn: 236567
* [Statepoint] Clean up Statepoint.h: accessor names.Sanjoy Das2015-05-062-4/+4
| | | | | | Use getFoo() as accessors consistently and some other naming changes. llvm-svn: 236564
* [opaque pointer type] Track explicit GEP pointee type through in-memory IRDavid Blaikie2015-05-051-4/+5
| | | | llvm-svn: 236510
* Emit comment for gc.relocate showing base and derived pointers in human ↵Igor Laevsky2015-05-051-0/+21
| | | | | | | | readable form. Differential Revision: http://reviews.llvm.org/D9326 llvm-svn: 236497
* [IR/Diagnostic] Assert that DebugLoc is valid before accessing.Davide Italiano2015-05-041-0/+1
| | | | | | | | PR: 23380 Differential Revision: http://reviews.llvm.org/D9464 Reviewed by: dexonsmith llvm-svn: 236435
* [opaque pointer type] Store the value type of an allocaDavid Blaikie2015-04-291-8/+6
| | | | llvm-svn: 236175
* [NFC] Converting to range-based for.Chris Bieneman2015-04-291-2/+1
| | | | llvm-svn: 236163
* [opaque pointer type] Pass GlobalAlias the actual pointer type rather than ↵David Blaikie2015-04-292-21/+15
| | | | | | | | | | | | | decomposing it into pointee type + address space Many of the callers already have the pointer type anyway, and for the couple of callers that don't it's pretty easy to call PointerType::get on the pointee type and address space. This avoids LLParser from using PointerType::getElementType when parsing GlobalAliases from IR. llvm-svn: 236160
* Temporarily relax a check in the debug info verifier.Adrian Prantl2015-04-291-0/+9
| | | | | | | | | | | | The clang frontend helps out GDB by emitting the members of local anonymous unions as artificial local variables with shared storage. When SROA splits the storage for artificial local variables that are smaller than the entire union, the overhang piece will be outside of the allotted space for the variable and this check fails. rdar://problem/20730771 llvm-svn: 236124
* IR: Give 'DI' prefix to debug info metadataDuncan P. N. Exon Smith2015-04-298-640/+639
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finish off PR23080 by renaming the debug info IR constructs from `MD*` to `DI*`. The last of the `DIDescriptor` classes were deleted in r235356, and the last of the related typedefs removed in r235413, so this has all baked for about a week. Note: If you have out-of-tree code (like a frontend), I recommend that you get everything compiling and tests passing with the *previous* commit before updating to this one. It'll be easier to keep track of what code is using the `DIDescriptor` hierarchy and what you've already updated, and I think you're extremely unlikely to insert bugs. YMMV of course. Back to *this* commit: I did this using the rename-md-di-nodes.sh upgrade script I've attached to PR23080 (both code and testcases) and filtered through clang-format-diff.py. I edited the tests for test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns were off-by-three. It should work on your out-of-tree testcases (and code, if you've followed the advice in the previous paragraph). Some of the tests are in badly named files now (e.g., test/Assembler/invalid-mdcompositetype-missing-tag.ll should be 'dicompositetype'); I'll come back and move the files in a follow-up commit. llvm-svn: 236120
* DebugInfo: Support up to 2^16 arguments in a subprogramDuncan P. N. Exon Smith2015-04-281-5/+2
| | | | | | | | | Support up to 2^16 arguments to a function. If we do hit the limit, assert out rather than restarting at 0 as we've done historically. This fixes PR23332. A clang test will follow. llvm-svn: 235955
* Constfold insertelement to undef when index is out-of-boundsPawel Bylica2015-04-271-7/+14
| | | | | | | | | | | | | | | | | | | Summary: This patch adds constant folding of insertelement instruction to undef value when index operand is constant and is not less than vector size or is undef. InstCombine does not support this case, but I'm happy to add it there also if this change is accepted. Test Plan: Unittests and regression tests for ConstProp pass. Reviewers: majnemer Reviewed By: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9287 llvm-svn: 235854
* IR: Add assembly/bitcode support for function metadata attachmentsDuncan P. N. Exon Smith2015-04-241-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add serialization support for function metadata attachments (added in r235783). The syntax is: define @foo() !attach !0 { Metadata attachments are only allowed on functions with bodies. Since they come before the `{`, they're not really part of the body; since they require a body, they're not really part of the header. In `LLParser` I gave them a separate function called from `ParseDefine()`, `ParseOptionalFunctionMetadata()`. In bitcode, I'm using the same `METADATA_ATTACHMENT` record used by instructions. Instruction metadata attachments are included in a special "attachment" block at the end of a `Function`. The attachment records are laid out like this: InstID (KindID MetadataID)+ Note that these records always have an odd number of fields. The new code takes advantage of this to recognize function attachments (which don't need an instruction ID): (KindID MetadataID)+ This means we can use the same attachment block already used for instructions. This is part of PR23340. llvm-svn: 235785
* Verifier: Function metadata attachments require a bodyDuncan P. N. Exon Smith2015-04-241-0/+13
| | | | | | | | Add a verifier check that only functions with bodies have metadata attachments. This should help catch bugs in frontends and transformation passes. Part of PR23340. llvm-svn: 235784
OpenPOWER on IntegriCloud