summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* [C API] Add LLVMStructGetTypeAtIndex.Peter Zotov2015-06-041-0/+5
| | | | | | Patch by deadalnix (Amaury SECHET). llvm-svn: 239029
* [ConstantFold] Don't skip the first gep index when folding gepsDavid Majnemer2015-06-041-3/+3
| | | | | | | | | We neglected to check if the first index made the GEP ineligible for 'inbounds'. This fixes PR23753. llvm-svn: 239015
* Int128 is also a built-in preconstructed type.Nick Lewycky2015-06-021-6/+7
| | | | llvm-svn: 238889
* [IR/AsmWriter] Output escape sequences if the first character isdigit()Filipe Cabecinhas2015-06-022-9/+11
| | | | | | | | | | | | | | | If the first character in a metadata attachment's name is a digit, it has to be output using an escape sequence, otherwise it's not valid text IR. Removed an over-zealous assert from LLVMContext which didn't allow this. The rule should only apply to text IR. Actual names can have any sequence of non-NUL bytes. Also added some documentation on accepted names. Bug found with AFL fuzz. llvm-svn: 238867
* clang-format a few functions. NFCFilipe Cabecinhas2015-06-022-10/+8
| | | | llvm-svn: 238865
* Move the name pointer out of Value into a map that lives on theOwen Anderson2015-06-013-10/+41
| | | | | | | | | | | | | | | | LLVMContext. Production builds of clang do not set names on most Value's, so this is wasted space on almost all subclasses of Value. This reduces the size of all Value subclasses by 8 bytes on 64 bit hosts. The one tricky part of this change is averting compile time regression by keeping Value::hasName() fast. This required stealing bits out of NumOperands. With this change, peak memory usage on verify-uselistorder-nodbg.lto.bc is decreased by approximately 2.3% (~3MB absolute on my machine). llvm-svn: 238791
* Add isConstant argument to MDBuilder::createTBAAStructTagNodeArtur Pilipenko2015-06-011-4/+11
| | | | | | | | | | According to the TBAA description struct-path tag node can have an optional IsConstant field. Add corresponding argument to MDBuilder::createTBAAStructTagNode. Reviewed By: hfinkel Differential Revision: http://reviews.llvm.org/D10160 llvm-svn: 238749
* [opaque pointer type] Explicitly store the pointee type of the result of a GEPDavid Blaikie2015-06-011-1/+2
| | | | | | | | Alternatively, this type could be derived on-demand whenever getResultElementType is called - if someone thinks that's the better choice (simple time/space tradeoff), I'm happy to give it a go. llvm-svn: 238716
* [IR] fptrunc-of-fptrunc isn't an EliminableCastPair.Ahmed Bougacha2015-05-291-1/+1
| | | | | | | Double and single rounding can produce different results. This is the IR counterpart to r228911. llvm-svn: 238531
* Add initial support for the convergent attribute.Owen Anderson2015-05-262-1/+5
| | | | llvm-svn: 238264
* [PlaceSafepoints] Cleanup InsertSafepointPoll functionPhilip Reames2015-05-262-0/+9
| | | | | | While working on another change, I noticed that the naming in this function was mildly deceptive. While fixing that, I took the oppurtunity to modernize some of the code. NFC intended. llvm-svn: 238252
* This patch adds support for the vector quadword add/sub instructions introducedKit Barton2015-05-251-1/+5
| | | | | | | | | | | | | | | | | | | | in POWER8: vadduqm vaddeuqm vaddcuq vaddecuq vsubuqm vsubeuqm vsubcuq vsubecuq In addition to adding the instructions themselves, it also adds support for the v1i128 type for intrinsics (Intrinsics.td, Function.cpp, and IntrinsicEmitter.cpp). http://reviews.llvm.org/D9081 llvm-svn: 238144
* Simplify and rename function overrideFunctionAttributes. NFC.Akira Hatanaka2015-05-231-13/+0
| | | | | | | This is in preparation to making changes needed to stop resetting NoFramePointerElim in resetTargetOptions. llvm-svn: 238079
* Use Op<0> accessor instead of OperandList for Instructions. NFCPete Cooper2015-05-212-6/+6
| | | | | | This is consistent with other uses of the operand list. I'm planning a future commit where this will actually matter. llvm-svn: 237967
* Put GEPOperator member function definition in the appropriate .cpp fileDavid Blaikie2015-05-212-30/+31
| | | | | | Last commit put it in Constants.cpp instead of Operator.cpp llvm-svn: 237960
* [opaque pointer type] Allow gep_type_iterator to work with the pointee type ↵David Blaikie2015-05-211-0/+30
| | | | | | | | | | | from the GEP instruction The raw non-instruction/constant form of this is still relying on being able to access the pointee type from a pointer type - those will be cleaned up later. For now, just focus on the cases where the pointee type is easily accessible. llvm-svn: 237958
* IR / debug info: Add a DWOId field to DICompileUnit,Adrian Prantl2015-05-214-10/+14
| | | | | | | | | | | | | | | | | | | | | | so DWARF skeleton CUs can be expression in IR. A skeleton CU is a (typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info. This is a prerequisite for clang module debugging as discussed in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html. In order to refer to external types stored in split DWARF (dwo) objects, such as clang modules, we need to emit skeleton CUs, which identify the dwarf object (i.e., the clang module) by filename (the SplitDebugFilename) and a hash value, the dwo_id. This patch only contains the IR changes. The idea is that a CUs with a non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name and DW_AT_GNU_dwo_id attribute. http://reviews.llvm.org/D9488 rdar://problem/20091852 llvm-svn: 237949
* [opaque pointer type] Pass explicit pointee type in another case of GEP ↵David Blaikie2015-05-211-1/+1
| | | | | | constant folding llvm-svn: 237860
* [opaque pointer type] Pass explicit type to Load instruction creation in ↵David Blaikie2015-05-203-11/+11
| | | | | | AutoUpgrade llvm-svn: 237838
* [opaque pointer type] LoadInst: assert that the explicit type matches the ↵David Blaikie2015-05-201-0/+1
| | | | | | implicit one llvm-svn: 237830
* Change Function::getIntrinsicID() to return an Intrinsic::ID. NFC.Pete Cooper2015-05-203-6/+5
| | | | | | | | Now that Intrinsic::ID is a typed enum, we can forward declare it and so return it from this method. This updates all users which were either using an unsigned to store it, or had a now unnecessary cast. llvm-svn: 237810
* Dereferenceable, dereferenceable_or_null metadata for loadsSanjoy Das2015-05-191-1/+12
| | | | | | | | | | | | | | | | | | | | Summary: Introduce dereferenceable, dereferenceable_or_null metadata for loads with the same semantic as corresponding attributes. This patch depends on http://reviews.llvm.org/D9253 Patch by Artur Pilipenko! Reviewers: hfinkel, sanjoy, reames Reviewed By: sanjoy, reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9365 llvm-svn: 237720
* As r237678 was reverted, this is no longer needed.Yaron Keren2015-05-191-2/+1
| | | | llvm-svn: 237687
* Fix Visual C++ errors C2784, C2780, C2782 after r237678.Yaron Keren2015-05-191-1/+2
| | | | | | It does not like std::min(unsigned, uint32_t). llvm-svn: 237683
* 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
OpenPOWER on IntegriCloud