Commit Graph

557 Commits

Author SHA1 Message Date
Geoff Berry
aa61209f48 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 19:24:10 +00:00
Amaury Sechet
7f21dd50bc Propery format doccomment in lto.h . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 04:20:30 +00:00
Amaury Sechet
8fad35613e 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 04:25:06 +00:00
Mehdi Amini
3b18241fca Do not use bool in C header lto.h, use lto_bool_t instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 23:55:01 +00:00
Mehdi Amini
45e997da60 Add a libLTO API to query a memory buffer and check if it contains ObjC categories
The linker supports a feature to force load an object from a static
archive if it defines an Objective-C category.
This API supports this feature by looking at every section in the
module to find if a category is defined in the module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 23:10:18 +00:00
Amaury Sechet
a2f727daf6 Add support for string attributes in the C API.
Summary: As per title. This completes the C API Attribute support.

Reviewers: Wallbraker, whitequark, echristo, rafael, jyknight

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 17:50:39 +00:00
Amaury Sechet
4e14c8337b Add support for callsite in the new C API for attributes
Summary: The second consumer of attributes.

Reviewers: Wallbraker, whitequark, echristo, rafael, jyknight

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 05:14:29 +00:00
David Majnemer
0c4f69f653 Remove the ScalarReplAggregates pass
Nearly all the changes to this pass have been done while maintaining and
updating other parts of LLVM.  LLVM has had another pass, SROA, which
has superseded ScalarReplAggregates for quite some time.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 00:19:09 +00:00
Amaury Sechet
58fd93ad90 Change () to (void) in the C API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 07:56:21 +00:00
Amaury Sechet
ca669104bf Make sure we have a Add/Remove/Has function for various thing that can have attribute.
Summary: This also deprecated the get attribute function familly.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight

Subscribers: axw, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 06:17:24 +00:00
Amaury Sechet
000b227286 Extract renaming from D19181
Summary: This needs to get in before anything is released concerning attribute. If the old name gets in the wild, then we are stuck with it forever. Putting it in its own diff should getting that part at least in fast.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 16:38:25 +00:00
Mehdi Amini
437f2fc22e ThinLTOCodeGenerator: ignore 0 values for the cache settings.
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 05:16:30 +00:00
Mehdi Amini
f4c5ea4908 Provide some default values for the ThinLTO Cache pruning
This control how the cache is pruned. The cache still has to
be explicitely enabled/disabled by providing a path.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 15:17:50 +00:00
Amaury Sechet
58e9430c5d Properly name LLVMSetIsInBounds's argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 02:23:14 +00:00
Amaury Sechet
3f89ecd798 Capitalize align argument in the C API as per convention. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 01:42:34 +00:00
Lang Hames
3869f2a5ab [ORC] clang-format code that was touched in r267457. NFC.
Commit r267457 made a lot of type-substitutions threw off code formatting and
alignment. This patch should tidy those changes up.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 21:21:20 +00:00
Lang Hames
1ddbb0f0b5 [ORC] Thread Error/Expected through the RPC library.
This replaces use of std::error_code and ErrorOr in the ORC RPC support library
with Error and Expected. This required updating the OrcRemoteTarget API, Client,
and server code, as well as updating the Orc C API.

This patch also fixes several instances where Errors were dropped.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-25 19:56:45 +00:00
Amaury Sechet
eeabfb0a05 Style fix in Core.h / Core.cpp. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 00:12:45 +00:00
Amaury Sechet
7b1322cacb Add LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAttribute
Summary:
LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

See D18749 for reference.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 01:02:12 +00:00
Amaury Sechet
609cf3b89c Revert "Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute"
This reverts commit 0bcfd95c268bcb180a525e1837e84475df8acdc7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13 23:01:39 +00:00
Amaury Sechet
2af3e8f798 Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute
Summary: LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

Reviewers: Wallbraker, whitequark, joker.eph, echristo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13 22:51:40 +00:00
Jeroen Ketema
9640ae7d9f [llvm-c] Expose LLVMContextGetDiagnostic{Handler,Context}
Differential Revision: http://reviews.llvm.org/D18820


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 09:19:02 +00:00
Dmitry Polukhin
ba4922356c [GCC] Attribute ifunc support in llvm
This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. Patch
for Clang http://reviews.llvm.org/D15524

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07 12:32:19 +00:00
Peter Zotov
2a41371ff7 [llvm-c] Add LLVMGetValueKind.
Patch by Nicole Mazzuca <npmazzuca@gmail.com>.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 22:21:29 +00:00
Peter Zotov
2b8aed70d6 [llvm-c] Expose LLVM{Get,Set}ModuleIdentifier
Patch by Nicole Mazzuca <npmazzuca@gmail.com>.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 13:56:59 +00:00
Amaury Sechet
45cace0d9a Style update in Core.h/Core.cpp . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 22:00:25 +00:00
NAKAMURA Takumi
6bb99d27bb Fixup r265277 [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 11:54:48 +00:00
Amaury Sechet
7527b8c02a Various style fix in Core.h/Core.cpp . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-03 21:06:04 +00:00
Manman Ren
4bda882517 Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an
AllocaInst.

This commit does not include any target-specific change. The target-specific
optimization will come as a follow-up patch.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:41:15 +00:00
Mehdi Amini
51f5548e2a Add a libLTO API to stop/restart ThinLTO between optimizations and CodeGen
This allows the linker to instruct ThinLTO to perform only the
optimization part or only the codegen part of the process.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 06:47:02 +00:00
Manman Ren
d9e9e2b717 Swift Calling Convention: add swiftself attribute.
Differential Revision: http://reviews.llvm.org/D17866


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29 17:37:21 +00:00
Eugene Zelenko
d0a33c410b Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes.
Differential revision: http://reviews.llvm.org/D18469


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264598 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28 17:40:08 +00:00
Mehdi Amini
e6cda0e9bc Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.
Summary: Also expose getters and setters in the C API, so that the change can be tested.

Reviewers: nhaehnle, axw, joker.eph

Subscribers: llvm-commits

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

From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 21:28:28 +00:00
Mehdi Amini
14e4632794 Const-correctness in libLTO
Looks like I was sloppy when bridging to C.
Thanks D. Blaikie for noticing!

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 21:28:18 +00:00
Amaury Sechet
439cd320e2 Use templated version of unwrap instead of cats in the Core.cpp. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-13 00:54:40 +00:00
Sean Silva
91639a80c3 Use lto_bool_t instead of a raw bool (fixup for r262977).
Hopefully this should bring
llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast back to life.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 04:05:28 +00:00
Mehdi Amini
5e01ef406b void foo() is not a valid C prototype, one has to write void foo(void)
Remove a warning introduced in r262977

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 02:36:09 +00:00
Mehdi Amini
73cf01b193 libLTO: add a ThinLTOCodeGenerator on the model of LTOCodeGenerator.
This is intended to provide a parallel (threaded) ThinLTO scheme
for linker plugin use through the libLTO C API.

The intent of this patch is to provide a first implementation as a
proof-of-concept and allows linker to start supporting ThinLTO by
definiing the libLTO C API. Some part of the libLTO API are left
unimplemented yet. Following patches will add support for these.

The current implementation can link all clang/llvm binaries.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 01:37:22 +00:00
Amaury Sechet
0439f740b2 Remove unused import in Orc C API
Summary: It is not used.

Reviewers: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 22:40:07 +00:00
Amaury Sechet
10ae0ad505 Add support for invoke/landingpad/resume in C API test
Summary: As per title. There was a lot of part missing in the C API, so I had to extend the invoke and landingpad API.

Reviewers: echristo, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 20:38:32 +00:00
Amaury Sechet
185aa0ed1a Add support for memory operations (load/store/gep) in C API echo test
Summary: As per title.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 22:51:03 +00:00
Amaury Sechet
47bce89899 Move LLVMCreateTargetData and LLVMDisposeTargetData together. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 22:41:09 +00:00
Amaury Sechet
b1fb18e8f7 Restore the capability to manipulate datalayout from the C API
Summary:
This consist in variosu addition to the C API:

  LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
  void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
  LLVMTargetDataRef LLVMCreateTargetMachineData(LLVMTargetMachineRef T);

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: axw

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 05:11:24 +00:00
Amaury Sechet
89e84d7221 Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr
Summary: The name is confusing as it matche another method on the module.

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:23:52 +00:00
Amaury Sechet
d0aed13e56 Kill LLVMAddTargetData
Summary: It's red, it's dead.

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits, axw

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:22:02 +00:00
Amaury Sechet
ab96d57a0b Rename LLVMSetDataLayout's argument to match what they stand for
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 23:40:06 +00:00
Amaury Sechet
a1d1faf8dd Fix star alignment in Core.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 08:58:49 +00:00
Benjamin Kramer
06016cc257 Remove LLVMGetTargetMachineData leftovers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 20:26:46 +00:00
Rafael Espindola
9234391598 Delete the deprecated LLVMLinkModules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 15:28:45 +00:00
Amaury Sechet
c2e77df6b8 Add support for phi nodes in the LLVM C API test
Summary: This required to add binding to Instruction::removeFromParent so that instruction can be forward declared and then moved at the right place.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 21:37:54 +00:00