1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

604 Commits

Author SHA1 Message Date
David Blaikie
c65393b311 Split Disassembler.h in two to fix dependencies
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
2018-03-29 00:29:44 +00:00
David Blaikie
c00bf84e60 Reapply Support layering fixes.
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
2018-03-21 17:31:49 +00:00
Jonas Devlieghere
77069f6e11 Revert "Move DataTypes.h from Support to llvm-c to fix layering."
This reverts r328065.

I missed this one in r328085 and the bots were still failing.

llvm-svn: 328095
2018-03-21 13:28:37 +00:00
Jonas Devlieghere
823bd6fa89 Revert layering changes
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
2018-03-21 10:35:09 +00:00
David Blaikie
51ea31e4d7 Fix the actual user of DataTypes.h in llvm-c to avoid the circular dependency
(follow-up to r328065)

llvm-svn: 328073
2018-03-21 04:07:07 +00:00
David Blaikie
ad99de0952 Move DataTypes.h from Support to llvm-c to fix layering.
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
2018-03-21 00:48:05 +00:00
Jonas Devlieghere
4d0327e819 Revert "Fix layering between llvm-c and Support by factoring out some 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
2018-03-20 11:26:50 +00:00
David Blaikie
b224768f51 Fix layering between llvm-c and Support by factoring out some typedefs into 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
2018-03-20 02:14:50 +00:00
Lang Hames
1e6a98aff9 [ORC] Re-apply r327566 with a fix for test-global-ctors.ll.
Also clang-formats the patch, which I should have done the first time around.

llvm-svn: 327594
2018-03-15 00:30:14 +00:00
Reid Kleckner
f02357933a Revert "[ORC] Switch from shared_ptr to unique_ptr for addModule methods."
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
2018-03-14 21:32:34 +00:00
Lang Hames
481402ffd7 [ORC] Switch from shared_ptr to unique_ptr for addModule methods.
Layer implementations typically mutate module state, and this is better
reflected by having layers own the Module they are operating on.

llvm-svn: 327566
2018-03-14 20:29:45 +00:00
Reid Kleckner
e307bb0d2f [LLVM-C] [bindings/go] Add C and Golang bindings for COMDAT
Patch by Ben Clayton

Differential Revision: https://reviews.llvm.org/D44086

llvm-svn: 327551
2018-03-14 18:33:53 +00:00
Robert Widmann
da759a6ef9 [LLVM-C] Redo unnamed_address attribute bindings
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
2018-03-14 06:45:51 +00:00
Ekaterina Romanova
26e5ff8165 [ThinLTO] Added a couple of C LTO API interfaces to control the cache policy.
- 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
2018-03-02 03:51:27 +00:00
Ekaterina Romanova
307574be8f Allow 0 to be a valid value pruning interval in C LTO API. Value 0 will cause garbage collector to run. This matches the behavior in C++ LTO API.
llvm-svn: 325303
2018-02-15 23:29:21 +00:00
Lang Hames
59fbe357fd [ORC] Remove Layer handles from the layer concept.
Handles were returned by addModule and used as keys for removeModule,
findSymbolIn, and emitAndFinalize. Their job is now subsumed by VModuleKeys,
which simplify resource management by providing a consistent handle across all
layers.

llvm-svn: 324700
2018-02-09 02:30:40 +00:00
Robert Widmann
ad5ddca21c [LLVM-C] Add Accessors For A Module's Source File Name
Summary: Also unblocks some cleanup in the echo-test.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: harlanhaskins, llvm-commits

Differential Revision: https://reviews.llvm.org/D42618

llvm-svn: 323819
2018-01-30 21:34:29 +00:00
Hiroshi Inoue
7f54536b89 [NFC] fix trivial typos in comments and documents
"in in" -> "in", "on on" -> "on" etc.

llvm-svn: 323508
2018-01-26 08:15:29 +00:00
Hiroshi Inoue
2f37cdd743 [NFC] fix trivial typos in comments
"the the" -> "the"

llvm-svn: 323176
2018-01-23 05:49:30 +00:00
Adrian Prantl
ae8d4fe15f Debug Info: Support DW_AT_calling_convention on composite types.
This implements the DWARF 5 feature described at
http://www.dwarfstd.org/ShowIssue.php?issue=141215.1

This allows a consumer to understand whether a composite data type is
trivially copyable and thus should be passed by value instead of by
reference. The canonical example is being able to distinguish the
following two types:

  // S is not trivially copyable because of the explicit destructor.
  struct S {
     ~S() {}
  };

  // T is a POD type.
  struct T {
     ~T() = default;
  };

This patch adds two new (DI)flags to LLVM metadata: TypePassByValue
and TypePassByReference.

<rdar://problem/36034922>
Differential Revision: https://reviews.llvm.org/D41743

llvm-svn: 321844
2018-01-05 01:13:37 +00:00
Ben Dunbobbin
327736f089 [ThinLTO][CachePruning] explicitly disable pruning
In https://reviews.llvm.org/rL321077 and https://reviews.llvm.org/D41231 I fixed a regression in the c-api which prevented the pruning from being *effectively* disabled.

However this approach, helpfully recommended by @labath, is cleaner.
It is also nice to remove the weasel words about effectively disabling from the api comments.

Differential Revision: https://reviews.llvm.org/D41497

llvm-svn: 321376
2017-12-22 18:32:15 +00:00
Ben Dunbobbin
4a12e46f5f [ThinLTO][C-API] Correct api comments
Negative values never disabled the pruning - they simply set high values for the pruning interval.

The behaviour now is that negative values set the maximum pruning interval (which appears to have been the intention from the start) see https://reviews.llvm.org/D41231.

I have adjusted the comments to reflect this, removed any inaccurate statements, and corrected any typos I spotted in the English.

Differential Revision: https://reviews.llvm.org/D41279

llvm-svn: 321078
2017-12-19 14:49:33 +00:00
Harlan Haskins
fab532d4a0 Use code voice for DIBuilder in LLVM C API
(This is a test commit)

llvm-svn: 317422
2017-11-04 20:31:20 +00:00
Adrian Prantl
3022c20faf Clean up comments in include/llvm-c/DebugInfo.h
Patch by Harlan Haskins!

Differential Revision: https://reviews.llvm.org/D39568

llvm-svn: 317271
2017-11-02 21:35:37 +00:00
Adrian Prantl
2e3db2532b Add missing header guards.
llvm-svn: 317267
2017-11-02 20:58:58 +00:00
NAKAMURA Takumi
10f211b68b llvm-c/DebugInfo.h: Fix warning. [-Wdocumentation]
llvm-svn: 317191
2017-11-02 08:03:12 +00:00
whitequark
ee01810f86 [LLVM-C] Expose functions to create debug locations via DIBuilder.
These include:
  * Several functions for creating an LLVMDIBuilder,
  * LLVMDIBuilderCreateCompileUnit,
  * LLVMDIBuilderCreateFile,
  * LLVMDIBuilderCreateDebugLocation.

Patch by Harlan Haskins.

Differential Revision: https://reviews.llvm.org/D32368

llvm-svn: 317135
2017-11-01 22:18:52 +00:00
Sanjay Patel
ab3266d1be [SimplifyCFG] use pass options and remove the latesimplifycfg pass
This is no-functional-change-intended.

This is repackaging the functionality of D30333 (defer switch-to-lookup-tables) and 
D35411 (defer folding unconditional branches) with pass parameters rather than a named
"latesimplifycfg" pass. Now that we have individual options to control the functionality,
we could decouple when these fire (but that's an independent patch if desired). 

The next planned step would be to add another option bit to disable the sinking transform
mentioned in D38566. This should also make it clear that the new pass manager needs to
be updated to limit simplifycfg in the same way as the old pass manager.

Differential Revision: https://reviews.llvm.org/D38631

llvm-svn: 316835
2017-10-28 18:43:07 +00:00
whitequark
198497f55f [LLVM-C] Publicly expose getters of MetadataType, TokenType
Patch by Robert Widmann.

Expose getters for MetadataType and TokenType publicly in the C API.
Discovered a need for these while trying to wrap the intrinsics API.

Differential Revision: https://reviews.llvm.org/D38809

llvm-svn: 316762
2017-10-27 11:51:40 +00:00
Matthew Simpson
05237a905d Add CalledValuePropagation pass
This patch adds a new pass for attaching !callees metadata to indirect call
sites. The pass propagates values to call sites by performing an IPSCCP-like
analysis using the generic sparse propagation solver. For indirect call sites
having a small set of possible callees, the attached metadata indicates what
those callees are. The metadata can be used to facilitate optimizations like
intersecting the function attributes of the possible callees, refining the call
graph, performing indirect call promotion, etc.

Differential Revision: https://reviews.llvm.org/D37355

llvm-svn: 316576
2017-10-25 13:40:08 +00:00
Lang Hames
32a06c15d8 [ORC] Hook up the LLVMOrcAddObjectFile function in the Orc C Bindings.
This can be used to add a relocatable object to the JIT session.

llvm-svn: 313474
2017-09-17 03:25:03 +00:00
Lang Hames
94e6e7207c [ORC] Errorize the ORC APIs.
This patch updates the ORC layers and utilities to return and propagate
llvm::Errors where appropriate. This is necessary to allow ORC to safely handle
error cases in cross-process and remote JITing.

llvm-svn: 307350
2017-07-07 02:59:13 +00:00
Chandler Carruth
cd49bfab29 Remove the BBVectorize pass.
It served us well, helped kick-start much of the vectorization efforts
in LLVM, etc. Its time has come and past. Back in 2014:
http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html

Time to actually let go and move forward. =]

I've updated the release notes both about the removal and the
deprecation of the corresponding C API.

llvm-svn: 306797
2017-06-30 07:09:08 +00:00
Lang Hames
7b43a9c7c5 [ORC] Re-apply r306166 and r306168 with fix for regression test.
llvm-svn: 306182
2017-06-23 23:25:28 +00:00
Rafael Espindola
b766456220 This reverts commit r306166 and r306168.
Revert "[ORC] Remove redundant semicolons from DEFINE_SIMPLE_CONVERSION_FUNCTIONS uses."
Revert "[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the module type as std::shared_ptr<Module>."

They broke ExecutionEngine/OrcMCJIT/test-global-ctors.ll on linux.

llvm-svn: 306176
2017-06-23 22:50:24 +00:00
Lang Hames
1f6bb5ebe0 [ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the
module type as std::shared_ptr<Module>.

llvm-svn: 306166
2017-06-23 21:45:29 +00:00
Chandler Carruth
eb66b33867 Sort the remaining #include lines in include/... and lib/....
I did this a long time ago with a janky python script, but now
clang-format has built-in support for this. I fed clang-format every
line with a #include and let it re-sort things according to the precise
LLVM rules for include ordering baked into clang-format these days.

I've reverted a number of files where the results of sorting includes
isn't healthy. Either places where we have legacy code relying on
particular include ordering (where possible, I'll fix these separately)
or where we have particular formatting around #include lines that
I didn't want to disturb in this patch.

This patch is *entirely* mechanical. If you get merge conflicts or
anything, just ignore the changes in this patch and run clang-format
over your #include lines in the files.

Sorry for any noise here, but it is important to keep these things
stable. I was seeing an increasing number of patches with irrelevant
re-ordering of #include lines because clang-format was used. This patch
at least isolates that churn, makes it easy to skip when resolving
conflicts, and gets us to a clean baseline (again).

llvm-svn: 304787
2017-06-06 11:49:48 +00:00
whitequark
97186e1387 [LLVM-C] [OCaml] Expose Type::subtypes.
The C functions added are LLVMGetNumContainedTypes and
LLVMGetSubtypes.

The OCaml function added is Llvm.subtypes.

Patch by Ekaterina Vaartis.

Differential Revision: https://reviews.llvm.org/D33677

llvm-svn: 304709
2017-06-05 11:49:52 +00:00
Amaury Sechet
ccc85ebd6a Introduce LLVMDIBuilderRef
Summary:
This patch adds a definition of `LLVMDIBuilderRef` that represents an `llvm::DIBuilder`.

Authored by Harlan Haskins

Reviewers: deadalnix, aprantl, probinson, dblaikie, echristo, whitequark

Reviewed By: deadalnix, whitequark

Subscribers: CodaFi, loladiro

Differential Revision: https://reviews.llvm.org/D32122

llvm-svn: 300843
2017-04-20 14:22:47 +00:00
Amaury Sechet
5cbde7845f Introducing LLVMMetadataRef
Summary:
This seems like an uncontroversial first step toward providing access to the metadata hierarchy that now exists in LLVM. This should allow for good debug info support from C.

Future plans are to deprecate API that take mixed bags of values and metadata (mainly the LLVMMDNode family of functions) and migrate the rest toward the use of LLVMMetadataRef.

Once this is in place, mapping of DIBuilder will be able to start.

Reviewers: mehdi_amini, echristo, whitequark, jketema, Wallbraker

Reviewed By: Wallbraker

Subscribers: Eugene.Zelenko, axw, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D19448

llvm-svn: 300447
2017-04-17 11:52:54 +00:00
Mehdi Amini
59694f2f4e Reorganize libLTO C API header lto.h (NFC)
This just makes it easier to follow the Doxygen blocks

llvm-svn: 299814
2017-04-08 19:20:30 +00:00
Joerg Sonnenberger
a1971791a7 Split the SimplifyCFG pass into two variants.
The first variant contains all current transformations except
transforming switches into lookup tables. The second variant
contains all current transformations.

The switch-to-lookup-table conversion results in code that is more
difficult to analyze and optimize by other passes. Most importantly,
it can inhibit Dead Code Elimination. As such it is often beneficial to
only apply this transformation very late. A common example is inlining,
which can often result in range restrictions for the switch expression.

Changes in execution time according to LNT:
SingleSource/Benchmarks/Misc/fp-convert +3.03%
MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CrystalMk -11.20%
MultiSource/Benchmarks/Olden/perimeter/perimeter -10.43%
and a couple of smaller changes. For perimeter it also results 2.6%
a smaller binary.

Differential Revision: https://reviews.llvm.org/D30333

llvm-svn: 298799
2017-03-26 06:44:08 +00:00
Davide Italiano
bd0298b1e1 [GVN] Initial check-in of a new global value numbering algorithm.
The code have been developed by Daniel Berlin over the years, and
the new implementation goal is that of addressing shortcomings of
the current GVN infrastructure, i.e. long compile time for large
testcases, lack of phi predication, no load/store value numbering
etc...

The current code just implements the "core" GVN algorithm, although
other pieces (load coercion, phi handling, predicate system) are
already implemented in a branch out of tree. Once the core is stable,
we'll start adding pieces on top of the base framework.
The test currently living in test/Transform/NewGVN are a copy
of the ones in GVN, with proper `XFAIL` (missing features in NewGVN).
A flag will be added in a future commit to enable NewGVN, so that
interested parties can exercise this code easily.

Differential Revision:  https://reviews.llvm.org/D26224

llvm-svn: 290346
2016-12-22 16:03:48 +00:00
Mehdi Amini
1c61c19903 [ThinLTO] Add an API to trigger file-based API for returning objects to the linker
Summary:
The motivation is to support better the -object_path_lto option on
Darwin. The linker needs to write down the generate object files on
disk for later use by lldb or dsymutil (debug info are not present
in the final binary). We're moving this into libLTO so that we can
be smarter when a cache is enabled and hard-link when possible
instead of duplicating the files.

Reviewers: tejohnson, deadalnix, pcc

Subscribers: dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D27507

llvm-svn: 289631
2016-12-14 04:56:42 +00:00
Amaury Sechet
7edfecef90 Kill deprecated attribute API
Summary:
This kill various depreacated API related to attribute :
 - The deprecated C API attribute based on LLVMAttribute enum.
 - The Raw attribute set format (planned to be removed in 4.0).

Reviewers: bkramer, echristo, mehdi_amini, void

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D23039

llvm-svn: 286062
2016-11-06 07:48:46 +00:00
Manuel Jacob
461196daf3 [C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.
Summary:
These are analog to the existing LLVMConstExactSDiv and LLVMBuildExactSDiv
functions.

Reviewers: deadalnix, majnemer

Subscribers: majnemer, llvm-commits

Differential Revision: https://reviews.llvm.org/D25259

llvm-svn: 283269
2016-10-04 23:32:42 +00:00
Geoff Berry
7e649e3211 [EarlyCSE] Change C API pass interface for EarlyCSE w/ MemorySSA
Previous change broke the C API for creating an EarlyCSE pass w/
MemorySSA by adding a bool parameter to control whether MemorySSA was
used or not.  This broke the OCaml bindings.  Instead, change the old C
API entry point back and add a new one to request an EarlyCSE pass with
MemorySSA.

llvm-svn: 280379
2016-09-01 15:07:46 +00:00
Geoff Berry
4a45626e2f [EarlyCSE] Optionally use MemorySSA. NFC.
Summary:
Use MemorySSA, if requested, to do less conservative memory dependency
checking.

This change doesn't enable the MemorySSA enhanced EarlyCSE in the
default pipelines, so should be NFC.

Reviewers: dberlin, sanjoy, reames, majnemer

Subscribers: mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D19821

llvm-svn: 280279
2016-08-31 19:24:10 +00:00
Amaury Sechet
e2065b6cb3 Propery format doccomment in lto.h . NFC
llvm-svn: 276725
2016-07-26 04:20:30 +00:00
Amaury Sechet
e639831d0c Expose AttributeSetNode, use it to provide aggregate getter for attribute in the C API.
Summary: See D19181 for context.

Reviewers: whitequark, Wallbraker, jyknight, echristo, bkramer, void

Subscribers: mehdi_amini

Differential Revision: http://reviews.llvm.org/D21265

llvm-svn: 276236
2016-07-21 04:25:06 +00:00