summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
Commit message (Collapse)AuthorAgeFilesLines
...
* [UnrollAndJam] Add a new Unroll and Jam passDavid Green2018-05-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a simple implementation of the unroll-and-jam classical loop optimisation. The basic idea is that we take an outer loop of the form: for i.. ForeBlocks(i) for j.. SubLoopBlocks(i, j) AftBlocks(i) Instead of doing normal inner or outer unrolling, we unroll as follows: for i... i+=2 ForeBlocks(i) ForeBlocks(i+1) for j.. SubLoopBlocks(i, j) SubLoopBlocks(i+1, j) AftBlocks(i) AftBlocks(i+1) Remainder So we have unrolled the outer loop, then jammed the two inner loops into one. This can lead to a simpler inner loop if memory accesses can be shared between the now-jammed loops. To do this we have to prove that this is all safe, both for the memory accesses (using dependence analysis) and that ForeBlocks(i+1) can move before AftBlocks(i) and SubLoopBlocks(i, j). Differential Revision: https://reviews.llvm.org/D41953 llvm-svn: 333358
* [C-API] Add functions to create GDB, Intel, Oprofile event listeners.Andres Freund2018-05-241-0/+6
| | | | | | | | | | The additions of Intel, Oprofile listeners were done blindly. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333230
* [ORC][C-API] Expose LLVMOrc{Unr,R}egisterJITEventListener().Andres Freund2018-05-242-0/+19
| | | | | | | | Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333229
* [ORC] Add findSymbolIn() wrapper to C bindings, take #2.Andres Freund2018-05-241-0/+9
| | | | | | | | | | | | | | | | Re-appply r333147, reverted in r333152 due to a pre-existing bug. As D47308 has been merged in r333206, the OSX issue should now be resolved. In many cases JIT users will know in which module a symbol resides. Avoiding to search other modules can be more efficient. It also allows to handle duplicate symbol names between modules. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44889 llvm-svn: 333215
* Revert r333147 "[ORC] Add findSymbolIn() wrapper to C bindings."Andres Freund2018-05-241-9/+0
| | | | | | | | | | | This reverts r333147 until https://reviews.llvm.org/D47308 is ready to be reviewed. r333147 exposed a behavioural difference between OrcCBindingsStack::findSymbolIn() and OrcCBindingsStack::findSymbol(), where only the latter does name mangling. After r333147 that causes a test failure on OSX, because the new test looks for main using findSymbolIn() but the mangled name is _main. llvm-svn: 333152
* [ORC] Add findSymbolIn() wrapper to C bindings.Andres Freund2018-05-241-0/+9
| | | | | | | | | | | | In many cases JIT users will know in which module a symbol resides. Avoiding to search other modules can be more efficient. It also allows to handle duplicate symbol names between modules. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44889 llvm-svn: 333147
* [LLVM-C] Add DIBuilder Bindings For ObjC ClassesRobert Widmann2018-05-211-1/+61
| | | | | | | | | | | | | | Summary: Add LLVMDIBuilderCreateObjCIVar, LLVMDIBuilderCreateObjCProperty, and LLVMDIBuilderCreateInheritance to allow declaring metadata for Objective-C class hierarchies and their associated properties and instance variables. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: harlanhaskins, llvm-commits Differential Revision: https://reviews.llvm.org/D47123 llvm-svn: 332850
* [LLVM-C] Improve Bindings For AliasesRobert Widmann2018-05-201-0/+50
| | | | | | | | | | | | | | Summary: Add wrappers for a module's alias iterators and a getter and setter for the aliasee value. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits, harlanhaskins Differential Revision: https://reviews.llvm.org/D46808 llvm-svn: 332826
* [LLVM-C] Use Length-Providing Value Name Getters and SettersRobert Widmann2018-05-191-2/+7
| | | | | | | | | | | | | | | | Summary: - Provide LLVMGetValueName2 and LLVMSetValueName2 that return and take the length of the provided C string respectively - Deprecate LLVMGetValueName and LLVMSetValueName Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits, harlanhaskins Differential Revision: https://reviews.llvm.org/D46890 llvm-svn: 332810
* [LLVM-C] Add Bindings For Module FlagsRobert Widmann2018-05-142-0/+114
| | | | | | | | | | | | | | | | | | | Summary: The first foray into merging debug info into the echo tests. - Add bindings to Module::getModuleFlagsMetadata() in the form of LLVMCopyModuleFlagsMetadata - Add the opaque type LLVMModuleFlagEntry to represent Module::ModuleFlagEntry - Add accessors for LLVMModuleFlagEntry's behavior, key, and metadata node. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: aprantl, JDevlieghere, llvm-commits, harlanhaskins Differential Revision: https://reviews.llvm.org/D46792 llvm-svn: 332219
* [LLVM-C] Consolidate llgo's DIBuilder BindingsRobert Widmann2018-05-101-0/+15
| | | | | | | | | | | | | | Summary: Move and correct LLVMDIBuilderCreateTypedef. This is the last API in DIBuilderBindings.h, so it is being removed and the C API will now be re-exported from IRBindings.h. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46725 llvm-svn: 332041
* [LLVM-C] Add Accessors for Common DIType and DILocation PropertiesRobert Widmann2018-05-101-0/+73
| | | | | | | | | | | | | | | | Summary: - Adds getters for the line, column, and scope of a DILocation - Adds getters for the name, size in bits, offset in bits, alignment in bits, line, and flags of a DIType Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46627 llvm-svn: 332014
* [LLVM-C] Move DIBuilder Bindings For Temporary MDNodesRobert Widmann2018-05-101-0/+27
| | | | | | | | | | | | | | Summary: Move LLVMTemporaryMDNode and LLVMMetadataReplaceAllUsesWith to the C bindings and add LLVMDeleteTemporaryMDNode for deleting non-RAUW'ed temporary nodes. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46632 llvm-svn: 332010
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-4/+4
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [LLVM-C] Add DIBuilder bindings to create import declarationsRobert Widmann2018-04-281-0/+66
| | | | | | | | | | | | | | Summary: Add bindings to create import declarations for modules, functions, types, and other entities. This wraps the conveniences available in the existing DIBuilder API, but these seem C++-specific. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46167 llvm-svn: 331123
* [LLVM-C] Miscellaneous Cleanups in DIBuilder BindingsRobert Widmann2018-04-281-33/+42
| | | | | | | | | | | | | | | | Summary: * rL328953 does not include bindings for LLVMDIBuilderCreateClassType and LLVMDIBuilderCreateBitFieldMemberType despite declaring their prototypes. Provide these bindings now. * Switch to more precise types with specific numeric limits matching the DIBuilder's C++ API. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46168 llvm-svn: 331114
* Fix Wdocumentation warnings. NFCI.Simon Pilgrim2018-04-241-3/+0
| | | | llvm-svn: 330716
* InstCombine: Fix layering by not including Scalar.h in InstCombineDavid Blaikie2018-04-241-0/+43
| | | | | | | | (notionally Scalar.h is part of libLLVMScalarOpts, so it shouldn't be included by InstCombine which doesn't/shouldn't need to depend on ScalarOpts) llvm-svn: 330669
* [AggressiveInstCombine] Add aggressive inst combiner to the LLVM C API.Craig Topper2018-04-242-0/+4
| | | | | | I just tried to copy what was done for regular InstCombine. Hopefully I didn't miss anything. llvm-svn: 330668
* [LLVM-C] DIBuilder Bindings For Variable ExpressionsRobert Widmann2018-04-231-0/+106
| | | | | | | | | | | | | | Summary: Add DIBuilder bindings for (global) variable expressions, variable value expressions, and debug value intrinsic insertion. Reviewers: harlanhaskins, deadalnix, whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45979 llvm-svn: 330661
* [LLVM-C] DIBuilderBindings for Subrange and ArraysRobert Widmann2018-04-231-0/+30
| | | | | | | | | | | | | | Summary: Move Go bindings for subranges and DINode arrays. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45933 llvm-svn: 330594
* [LLVM-C] Finish Up Scope BindingsRobert Widmann2018-04-231-7/+73
| | | | | | | | | | | | | | Summary: Adds bindings for Module and NameSpace scopes and LLVMDIBuilderCreateForwardDecl, a counterpart to LLVMDIBuilderCreateReplaceableCompositeType. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45934 llvm-svn: 330591
* [LLVM-C] Add DIBuilder Bindings For Variable CreationRobert Widmann2018-04-221-0/+74
| | | | | | | | | | | | | | Summary: Wrap LLVMDIBuilderCreateAutoVariable, LLVMDIBuilderCreateParameterVariable, LLVMDIBuilderCreateExpression, and move and correct LLVMDIBuilderInsertDeclareBefore and LLVMDIBuilderInsertDeclareAtEnd from the Go bindings to the C bindings. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: harlanhaskins, whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45928 llvm-svn: 330555
* [LLVM-C] Add LLVMGetHostCPU{Name,Features}.whitequark2018-04-111-0/+8
| | | | | | | | | | | | | | Without these functions it's hard to create a TargetMachine for Orc JIT that creates efficient native code. It's not sufficient to just expose LLVMGetHostCPUName(), because for some CPUs there's fewer features actually available than the CPU name indicates (e.g. AVX might be missing on some CPUs identified as Skylake). Differential Revision: https://reviews.llvm.org/D44861 llvm-svn: 329856
* [LLVM-C] Move DIBuilder Bindings For Block ScopesRobert Widmann2018-04-071-0/+64
| | | | | | | | | | | | | | Summary: Move LLVMDIBuilderCreateFunction , LLVMDIBuilderCreateLexicalBlock, and LLVMDIBuilderCreateLexicalBlockFile from Go to LLVM-C. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark, harlanhaskins Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45352 llvm-svn: 329488
* [LLVM-C] Fill Out LLVMCallConvRobert Widmann2018-04-061-7/+42
| | | | | | | | | | | | | | Summary: Bring LLVMCallConv up to date with latest [[ http://llvm.org/doxygen/CallingConv_8h_source.html | CallConv ]] Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45347 llvm-svn: 329373
* [LLVM-C] Audit Inline Assembly APIs for ConsistencyRobert Widmann2018-04-061-2/+37
| | | | | | | | | | | | | | | | | | Summary: - Add a missing getter for module-level inline assembly - Add a missing append function for module-level inline assembly - Deprecate LLVMSetModuleInlineAsm and replace it with LLVMSetModuleInlineAsm2 which takes an explicit length parameter - Deprecate LLVMConstInlineAsm and replace it with LLVMGetInlineAsm, a function that allows passing a dialect and is not mis-classified as a constant operation Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45346 llvm-svn: 329369
* Assume existence of inttypes.h and stdint.h in DataTypes.h.Nico Weber2018-04-021-45/+0
| | | | | | | | | | | | | These should exist in all toolchains LLVM supports nowadays. Enables making DataTypes.h a regular header instead of a .h.cmake file and allows deleting a bunch of cmake goop (which should also speed up cmake configure time a bit). All the code this removes is 9+ years old. https://reviews.llvm.org/D45155 llvm-svn: 328970
* Wdocumentation fix. NFCI.Simon Pilgrim2018-04-021-5/+5
| | | | llvm-svn: 328964
* Wdocumentation fixes. NFCI.Simon Pilgrim2018-04-021-19/+28
| | | | llvm-svn: 328963
* Add C API bindings for DIBuilder 'Type' APIsHarlan Haskins2018-04-021-0/+324
| | | | | | | | | | This patch adds a set of unstable C API bindings to the DIBuilder interface for creating structure, function, and aggregate types. This patch also removes the existing implementations of these functions from the Go bindings and updates the Go API to fit the new C APIs. llvm-svn: 328953
* [LLVM-C] Finish exception instruction bindings - Round 2Robert Widmann2018-03-301-6/+73
| | | | | | | | | | | | | | | | | | | Summary: Previous revision caused a leak in the echo test that got caught by the ASAN bots because of missing free of the handlers array and was reverted in r328759. Resubmitting the patch with that correction. Add support for cleanupret, catchret, catchpad, cleanuppad and catchswitch and their associated accessors. Test is modified from SimplifyCFG because it contains many diverse usages of these instructions. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits, vlad.tsyrklevich Differential Revision: https://reviews.llvm.org/D45100 llvm-svn: 328883
* Revert "[LLVM-C] Finish exception instruction bindings"Vlad Tsyrklevich2018-03-301-73/+6
| | | | | | This reverts commit r328759. It was causing LSan failures on sanitizer-x86_64-linux-bootstrap llvm-svn: 328858
* llvm-c: Split Utils out of Scalar.hDavid Blaikie2018-03-292-6/+50
| | | | | | | To fix layering (so that Scalar.h, a libScalarOpts header, isn't included from Utils - which libScalarOpts depends on). llvm-svn: 328839
* [LLVM-C] Finish exception instruction bindingsRobert Widmann2018-03-291-6/+73
| | | | | | | | | | | | | | | | | Summary: Add support for cleanupret, catchret, catchpad, cleanuppad and catchswitch and their associated accessors. Test is modified from SimplifyCFG because it contains many diverse usages of these instructions. Reviewers: whitequark, deadalnix, echristo Reviewed By: echristo Subscribers: llvm-commits, harlanhaskins Differential Revision: https://reviews.llvm.org/D44496 llvm-svn: 328759
* Split Disassembler.h in two to fix dependenciesDavid Blaikie2018-03-292-146/+161
| | | | | | | | | | | | | | Support includes this header for the typedefs - but logically it's part of the MC/Disassembler library that implements the functions. Split the header so as not to create a circular dependency. This is another case where probably inverting the llvm-c implementation might be best (rather than core llvm libraries implementing the parts of llvm-c - instead llvm-c could be its own library, depending on all the parts of LLVM's core libraries to then implement llvm-c on top of them... if that makes sense) llvm-svn: 328744
* Reapply Support layering fixes.David Blaikie2018-03-214-3/+138
| | | | | | | | | | | | | | | | | | | | Compiler.h is used by Demangle (which Support depends on) - so sink it into Demangle to avoid a circular dependency DataTypes.h is used by llvm-c (which Support depends on) - so sink it into llvm-c. DataTypes.h could probably be fixed the other way - making llvm-c depend on Support instead of Support depending on llvm-c - if anyone feels that's the better option, happy to work with them on that. I /think/ this'll address the layering issues that previous attempts to commit this have triggered in the Modules buildbot, but I haven't been able to reproduce that build so can't say for sure. If anyone's having trouble with this - it might be worth taking a look to see if there's a quick fix/something small I missed rather than revert, but no worries. llvm-svn: 328123
* Revert "Move DataTypes.h from Support to llvm-c to fix layering."Jonas Devlieghere2018-03-211-135/+0
| | | | | | | | This reverts r328065. I missed this one in r328085 and the bots were still failing. llvm-svn: 328095
* Revert layering changesJonas Devlieghere2018-03-211-1/+1
| | | | | | | | | | | | This reverts: r328072 "Move Compiler.h from Support to Demangler to fix layering." r328073 "Fix the actual user of DataTypes.h in llvm-c to avoid the circular dependency" Failing bots: http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/ http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/ llvm-svn: 328085
* Fix the actual user of DataTypes.h in llvm-c to avoid the circular dependencyDavid Blaikie2018-03-211-1/+1
| | | | | | (follow-up to r328065) llvm-svn: 328073
* Move DataTypes.h from Support to llvm-c to fix layering.David Blaikie2018-03-211-0/+135
| | | | | | | | | | | Support depends on llvm-c (a few typedefs, macros, etc - Types.h, Disassembler.h, and TargetMachine.h. This could be done the other way - those macros/typedefs/etc could be moved into Support and used from llvm-c instead. If someone feels that's a better direction to go, happy to discuss it/try it out/etc. llvm-svn: 328065
* Revert "Fix layering between llvm-c and Support by factoring out some ↵Jonas Devlieghere2018-03-201-1/+37
| | | | | | | | | | | typedefs into Support" This reverts r327940 because it fails on several GreenDragon bots. http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/ http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/ llvm-svn: 327968
* Fix layering between llvm-c and Support by factoring out some typedefs into ↵David Blaikie2018-03-201-37/+1
| | | | | | | | | | Support llvm-c depends on Support, but Support (TargetRegistry) uses some of llvm-c's typedefs. Move those into a Support header to be used from both llvm-c and Support. llvm-svn: 327940
* [ORC] Re-apply r327566 with a fix for test-global-ctors.ll.Lang Hames2018-03-151-32/+2
| | | | | | Also clang-formats the patch, which I should have done the first time around. llvm-svn: 327594
* Revert "[ORC] Switch from shared_ptr to unique_ptr for addModule methods."Reid Kleckner2018-03-141-2/+30
| | | | | | | | | | | | | This reverts commit r327566, it breaks test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll. The test doesn't crash with a stack trace, unfortunately. It merely returns 1 as the exit code. ASan didn't produce a report, and I reproduced this on my Linux machine and Windows box. llvm-svn: 327576
* [ORC] Switch from shared_ptr to unique_ptr for addModule methods.Lang Hames2018-03-141-30/+2
| | | | | | | Layer implementations typically mutate module state, and this is better reflected by having layers own the Module they are operating on. llvm-svn: 327566
* [LLVM-C] [bindings/go] Add C and Golang bindings for COMDATReid Kleckner2018-03-142-0/+80
| | | | | | | | Patch by Ben Clayton Differential Revision: https://reviews.llvm.org/D44086 llvm-svn: 327551
* [LLVM-C] Redo unnamed_address attribute bindingsRobert Widmann2018-03-141-0/+11
| | | | | | | | | | | | | | | | | | | Summary: The old bindings should have used an enum instead of a boolean. This deprecates LLVMHasUnnamedAddr and LLVMSetUnnamedAddr , replacing them with LLVMGetUnnamedAddress and LLVMSetUnnamedAddress respectively that do. Though it is unlikely LLVM will gain more supported global value linker hints, the new API can scale to accommodate this. Reviewers: deadalnix, whitequark Reviewed By: whitequark Subscribers: llvm-commits, harlanhaskins Differential Revision: https://reviews.llvm.org/D43448 llvm-svn: 327479
* [ThinLTO] Added a couple of C LTO API interfaces to control the cache policy.Ekaterina Romanova2018-03-021-1/+23
| | | | | | | | | | - thinlto_codegen_set_cache_size_bytes to control the absolute size of cache directory. - thinlto_codegen_set_cache_size_files the size and amount of files in cache directory. These functions have been supported in C++ LTO API for a long time, but were absent in C LTO API. Differential Revision: https://reviews.llvm.org/D42446 llvm-svn: 326537
* Allow 0 to be a valid value pruning interval in C LTO API. Value 0 will ↵Ekaterina Romanova2018-02-151-1/+1
| | | | | | cause garbage collector to run. This matches the behavior in C++ LTO API. llvm-svn: 325303
OpenPOWER on IntegriCloud