summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* [IR] Cleanup indentation of EH instructionsDavid Majnemer2015-08-131-17/+15
| | | | | | No functional change is intended, just tidying up whitespace. llvm-svn: 244966
* Remove raw_svector_ostream::resync and users. It's no-op after r244870.Yaron Keren2015-08-131-1/+0
| | | | llvm-svn: 244888
* [IR] Verify EH pad predecessorsDavid Majnemer2015-08-111-14/+51
| | | | | | | Make sure that an EH pad's predecessors are using their unwind edge to transfer control to the EH pad. llvm-svn: 244563
* Print vectorization analysis when loop hint is specified.Tyler Nowicki2015-08-111-2/+5
| | | | | | This patch and a relatec clang patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints. llvm-svn: 244555
* Extend late diagnostics to include late test for runtime pointer checks.Tyler Nowicki2015-08-101-0/+9
| | | | | | This patch moves checking the threshold of runtime pointer checks to the vectorization requirements (late diagnostics) and emits a diagnostic that infroms the user the loop would be vectorized if not for exceeding the pointer-check threshold. Clang will also append the options that can be used to allow vectorization. llvm-svn: 244523
* Late evaluation of the fast-math vectorization requirement.Tyler Nowicki2015-08-102-0/+14
| | | | | | This patch moves the verification of fast-math to just before vectorization is done. This way we can tell clang to append the command line options would that allow floating-point commutativity. Specifically those are enableing fast-math or specifying a loop hint. llvm-svn: 244489
* Fix some comment typos.Benjamin Kramer2015-08-081-1/+1
| | | | llvm-svn: 244402
* [IR] Remove TerminateInst's "NameStr" argumentDavid Majnemer2015-08-061-11/+7
| | | | | | | TerminateInst can't have a name because it doesn't produce a result. No functionality change is intended, this is just a cleanup. llvm-svn: 244276
* Convert a bunch of loops to foreach. NFC.Pete Cooper2015-08-061-2/+1
| | | | | | | | After r244074, we now have a successors() method to iterate over all the successors of a TerminatorInst. This commit changes a bunch of eligible loops to use it. llvm-svn: 244260
* llvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, ↵NAKAMURA Takumi2015-08-061-2/+2
| | | | | | introduced in r244164. [-Wdocumentation] llvm-svn: 244204
* Add a TrailingObjects template class.James Y Knight2015-08-052-26/+24
| | | | | | | | | | This is intended to help support the idiom of a class that has some other objects (or multiple arrays of different types of objects) appended on the end, which is used quite heavily in clang. Differential Revision: http://reviews.llvm.org/D11272 llvm-svn: 244164
* If the "CodeView" module flag is set, emit codeview instead of DWARFReid Kleckner2015-08-051-1/+8
| | | | | | | | | | | | | | Summary: Emit both DWARF and CodeView if "CodeView" and "Dwarf Version" module flags are set. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11756 llvm-svn: 244158
* [IR] Simplify code with ArrayRef::copy. No functionality change.Benjamin Kramer2015-08-051-7/+3
| | | | llvm-svn: 244043
* Avoid passing nullptr to std::equal. Yaron Keren2015-08-041-1/+2
| | | | | | | | | | | As documented in the LLVM Coding Standards, indeed MSVC incorrectly asserts on this in Debug mode. This happens when building clang with Visual C++ and -triple i686-pc-windows-gnu on these clang regression tests: clang/test/CodeGen/2011-03-08-ZeroFieldUnionInitializer.c clang/test/CodeGen/empty-union-init.c llvm-svn: 243996
* Drive-by fixes for LandingPad -> EHPadDavid Majnemer2015-08-041-1/+4
| | | | | | | | This change was done as an audit and is by inspection. The new EH system is still very much a work in progress. NFC for the landingpad case. llvm-svn: 243965
* Introduce enum value for previously defined metadata -- make.implicit Chen Li2015-08-041-0/+6
| | | | | | | | | | | | Summary: This patch adds enum value for an existing metadata type -- make.implicit. Using preassigned enum will be helpful to get compile time type checking and avoid string construction and comparison. The patch also changes uses of make.implicit from string metadata to enum metadata. There is no functionality change. Reviewers: reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11698 llvm-svn: 243954
* [UB] Don't allocate space for contained types and then try to copy theChandler Carruth2015-08-041-0/+6
| | | | | | | | | | | contained types into the space when we have no contained types. This fixes the UB stemming from a call to memcpy with a null pointer. This also reduces the calls to allocate because this actually happens in a notable client - Clang. Found by UBSan. llvm-svn: 243944
* DI: Disallow uniquable DICompileUnitsDuncan P. N. Exon Smith2015-08-036-77/+41
| | | | | | | | | | | | | | | | | | Since r241097, `DIBuilder` has only created distinct `DICompileUnit`s. The backend is liable to start relying on that (if it hasn't already), so make uniquable `DICompileUnit`s illegal and automatically upgrade old bitcode. This is a nice cleanup, since we can remove an unnecessary `DenseSet` (and the associated uniquing info) from `LLVMContextImpl`. Almost all the testcases were updated with this script: git grep -e '= !DICompileUnit' -l -- test | grep -v test/Bitcode | xargs sed -i '' -e 's,= !DICompileUnit,= distinct !DICompileUnit,' I imagine something similar should work for out-of-tree testcases. llvm-svn: 243885
* Add support to set/get ordering for load/store from the C APIAndrew Wilkins2015-08-021-1/+34
| | | | | | | | | | | | Summary: As per title Reviewers: chandlerc, bogner, majnemer, axw Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11141 llvm-svn: 243847
* Mark CompositeType::getTypeAtIndex as const. NFCCraig Topper2015-08-011-5/+7
| | | | llvm-svn: 243845
* Mark Type::getPointerTo as const. Unfortunately, this requires a const_cast ↵Craig Topper2015-08-011-2/+2
| | | | | | inside, but at least it makes all methods on Type const. NFC llvm-svn: 243844
* Merge the const and non-const Type::getScalarType to a const version that ↵Craig Topper2015-08-011-9/+3
| | | | | | returns a non-const pointer. Since we don't put const on Types all places were already calling the non-const version. llvm-svn: 243843
* De-constify pointers to Type since they can't be modified. NFCCraig Topper2015-08-015-37/+34
| | | | | | This was already done in most places a while ago. This just fixes the ones that crept in over time. llvm-svn: 243842
* DI: Remove DW_TAG_arg_variable and DW_TAG_auto_variableDuncan P. N. Exon Smith2015-07-315-34/+25
| | | | | | | | | | | | | | | | | | | | | | | | Remove the fake `DW_TAG_auto_variable` and `DW_TAG_arg_variable` tags, using `DW_TAG_variable` in their place Stop exposing the `tag:` field at all in the assembly format for `DILocalVariable`. Most of the testcase updates were generated by the following sed script: find test/ -name "*.ll" -o -name "*.mir" | xargs grep -l 'DILocalVariable' | xargs sed -i '' \ -e 's/tag: DW_TAG_arg_variable, //' \ -e 's/tag: DW_TAG_auto_variable, //' There were only a handful of tests in `test/Assembly` that I needed to update by hand. (Note: a follow-up could change `DILocalVariable::DILocalVariable()` to set the tag to `DW_TAG_formal_parameter` instead of `DW_TAG_variable` (as appropriate), instead of having that logic magically in the backend in `DbgVariable`. I've added a FIXME to that effect.) llvm-svn: 243774
* New EH representation for MSVC compatibilityDavid Majnemer2015-07-315-6/+567
| | | | | | | | | | This introduces new instructions neccessary to implement MSVC-compatible exception handling support. Most of the middle-end and none of the back-end haven't been audited or updated to take them into account. Differential Revision: http://reviews.llvm.org/D11097 llvm-svn: 243766
* DI: Rewrite the DIBuilder local variable APIDuncan P. N. Exon Smith2015-07-311-3/+23
| | | | | | | | | | | | Replace the general `createLocalVariable()` with two more specific functions: `createParameterVariable()` and `createAutoVariable()`, and rewrite the documentation. Besides cleaning up the API, this avoids exposing the fake DWARF tags `DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is preparation for removing them completely. llvm-svn: 243764
* [opaque pointers] Remove use of PointerType::getElementType in favor of ↵David Blaikie2015-07-291-4/+1
| | | | | | GEPOperator::getSourceElementType llvm-svn: 243566
* [Statepoints] Let patchable statepoints have a symbolic call target.Sanjoy Das2015-07-281-6/+0
| | | | | | | | | | | | | | | | | | | | Summary: As added initially, statepoints required their call targets to be a constant pointer null if ``numPatchBytes`` was non-zero. This turns out to be a problem ergonomically, since there is no way to mark patchable statepoints as calling a (readable) symbolic value. This change remove the restriction of requiring ``null`` call targets for patchable statepoints, and changes PlaceSafepoints to maintain the symbolic call target through its transformation. Reviewers: reames, swaroop.sridhar Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11550 llvm-svn: 243502
* Remove unnecessary const_casts. NFCCraig Topper2015-07-281-6/+4
| | | | llvm-svn: 243380
* [opaque pointer type] Avoid using pointee types to retrieve InlineAsm's ↵David Blaikie2015-07-282-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | function type As a stop-gap, retrieving the InlineAsm's function type was done via the pointee type of its (pointer) Value type. Instead, pass down and store the FunctionType in the InlineAsm object. The only wrinkle with this is the ConstantUniqueMap, which then needs to ferry the FunctionType down through the InlineAsmKeyType. This could be done a bit differently if the ConstantInfo trait were broadened a bit to provide an extension point for access to the TypeClass object from the ValType objects, so that the ConstantUniqueMap<InlineAsm> would then be keyed on FunctionTypes instead of PointerTypes that point to FunctionTypes. This drops the number of IR tests that don't roundtrip through bitcode* without calling PointerType::getElementType from 416 to 8 (out of 10733). 3 of those crash when roundtripping at ToT anyway. * modulo various unavoidable uses of pointer types when validating IR (for now) and in the way globals are parsed, unfortunately. These cases will either go away (because such validation will no longer be necessary or possible when pointee types are opaque), or have to be made simultaneously with the removal of pointee types. llvm-svn: 243356
* IR: Expose the method 'getLocalSlot' in the module slot tracker.Alex Lorenz2015-07-271-0/+5
| | | | | | | | | | | This commit publicly exposes the method 'getLocalSlot' in the 'ModuleSlotTracker' class. This change is useful for MIR serialization, to serialize the unnamed basic block and unnamed alloca references. Reviewers: Duncan P. N. Exon Smith llvm-svn: 243336
* Revert "Add const to a bunch of Type* in DataLayout. NFC."Pete Cooper2015-07-271-13/+13
| | | | | | | | This reverts commit r243135. Feedback from Craig Topper and David Blaikie was that we don't put const on Type as it has no mutable state. llvm-svn: 243283
* DI/Verifier: Fix argument bitrot in DILocalVariableDuncan P. N. Exon Smith2015-07-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add a verifier check that `DILocalVariable`s of tag `DW_TAG_arg_variable` always have a non-zero 'arg:' field, and those of tag `DW_TAG_auto_variable` always have a zero 'arg:' field. These are the only configurations that are properly understood by the backend. (Also, fix the bad examples in LangRef and test/Assembler, and fix the bug in Kaleidoscope Ch8.) A large number of testcases seem to have bitrotted their way forward from some ancient version of the debug info hierarchy that didn't have `arg:` parameters. If you have out-of-tree testcases that start failing in the verifier and you don't care enough to get the `arg:` right, you may have some luck just calling: sed -e 's/, arg: 0/, arg: 1/' or some such, but I hand-updated the ones in tree. llvm-svn: 243183
* Use make_range(rbegin(), rend()) to allow foreach loops. NFC.Pete Cooper2015-07-241-2/+1
| | | | | | | | | | | Instead of the pattern for (auto I = x.rbegin(), E = x.end(); I != E; ++I) we can use make_range to construct the reverse range and iterate using that instead. llvm-svn: 243163
* DI: Remove unnecessary DICompositeTypeBaseDuncan P. N. Exon Smith2015-07-241-2/+1
| | | | | | | | | | | | Remove unnecessary and confusing common base class for `DICompositeType` and `DISubroutineType`. While at a high-level `DISubroutineType` is a sort of composite of other types, it has no shared code paths, and its fields are completely disjoint. This relationship was left over from the old debug info hierarchy. llvm-svn: 243160
* DI: Simplify DebugInfoFinder::processType(), NFCDuncan P. N. Exon Smith2015-07-241-7/+9
| | | | | | | | | | | Handle `DISubroutineType` up-front rather than as part of a branch for `DICompositeTypeBase`. The only shared code path was looking through the base type, but `DISubroutineType` can never have a base type. This also removes the last use of `DICompositeTypeBase`, since we can strengthen the cast to `DICompositeType`. llvm-svn: 243159
* DI: Remove dead code: getDICompositeType()Duncan P. N. Exon Smith2015-07-241-15/+0
| | | | llvm-svn: 243158
* DI: Remove DIDerivedTypeBaseDuncan P. N. Exon Smith2015-07-241-13/+11
| | | | | | | | | Remove an unnecessary (and confusing) common subclass for `DIDerivedType` and `DICompositeType`. These classes aren't really related, and even in the old debug info hierarchy, there was a long-standing FIXME to separate them. llvm-svn: 243152
* Verifier: Sink filename check into visitMDCompositeType(), NFCDuncan P. N. Exon Smith2015-07-241-19/+6
| | | | | | | | We really only want to check this for unions and classes (all the other tags have been ruled out), so simplify the check and move it to the right place. llvm-svn: 243150
* Verifier: Remove unnecessary references to DW_TAG_subroutine_type, NFCDuncan P. N. Exon Smith2015-07-241-2/+0
| | | | | | | | | Remove unnecessary references to `DW_TAG_subroutine_type` in `visitDICompositeType()` and `visitDIDerivedTypeBase()`, since `visitDISubroutineType()` doesn't call either of those (and shouldn't, since subroutine types are really quite special). llvm-svn: 243149
* DI: Strengthen some dyn_casts to DIDerivedType, NFCDuncan P. N. Exon Smith2015-07-241-2/+2
| | | | | | | | The surrounding code proves in both cases that these must be `DIDerivedType` if they're `DIDerivedTypeBase`, so strengthen the `dyn_cast`s to the more specific type. llvm-svn: 243143
* Add const to a bunch of Type* in DataLayout. NFC.Pete Cooper2015-07-241-13/+13
| | | | | | | | Almost all methods in DataLayout took mutable pointers but didn't need to. These were only accessing constant methods of the types, or using the Type* to key a map. Neither of these needs a mutable pointer. llvm-svn: 243135
* Fix -Wextra-semi warnings.Hans Wennborg2015-07-221-1/+1
| | | | | | | | Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D11400 llvm-svn: 242930
* IR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC.Alex Lorenz2015-07-211-14/+26
| | | | | | | | | | | | | This commit extracts the code that prints out a name of an LLVM value without a prefix from a function 'PrintLLVMName' into a publicly accessible function named 'printLLVMNameWithoutPrefix'. This change would be useful for MIR serialization, as it would allow the MIR printer to reuse this function to print out the names of the external symbol machine operands. Reviewers: Duncan P. N. Exon Smith llvm-svn: 242803
* fix formatting; NFCSanjay Patel2015-07-211-2/+2
| | | | llvm-svn: 242796
* Revert "Update LLVM bindings after r239940. ..."Reid Kleckner2015-07-161-1/+8
| | | | | | | | | | | Revert the changes to the C API LLVMBuildLandingPad that were part of the personality function move. We now set the personality on the parent function when the C API attempts to construct a landingpad with a personality. This reverts commit r240010. llvm-svn: 242372
* Debug Info: Add basic support for external types references.Adrian Prantl2015-07-151-0/+12
| | | | | | | | | | | | | | This is a necessary prerequisite for bootstrapping the emission of debug info inside modules. - Adds a FlagExternalTypeRef to DICompositeType. External types must have a unique identifier. - External type references are emitted using a forward declaration with a DW_AT_signature([DW_FORM_ref_sig8]) based on the UID. http://reviews.llvm.org/D9612 llvm-svn: 242302
* Add capability to get and set the personalitty function from the C APIAndrew Wilkins2015-07-141-0/+8
| | | | | | | | | | | | | | | Summary: The capability was lost with D10429 where the personality function was set at function level rather than landing pad level. Now there is no way to get/set the personality function from the C API. That is a problem. Note that the whole thing could be avoided by improving the C API testing, as started by D10725 Reviewers: chandlerc, bogner, majnemer, andrew.w.kaylor, rafael, rnk, axw Subscribers: rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D10946 llvm-svn: 242104
* Remove macro guards for extern template instantiations.Benjamin Kramer2015-07-131-12/+8
| | | | | | | This is a C++11 feature that both GCC and MSVC have supported as ane extension long before C++11 was approved. llvm-svn: 242042
* Add argmemonly attribute.Igor Laevsky2015-07-112-4/+12
| | | | | | | | This change adds new attribute called "argmemonly". Function marked with this attribute can only access memory through it's argument pointers. This attribute directly corresponds to the "OnlyAccessesArgumentPointees" ModRef behaviour in alias analysis. Differential Revision: http://reviews.llvm.org/D10398 llvm-svn: 241979
OpenPOWER on IntegriCloud