#
c3dfe908 |
| 26-Jun-2019 |
Yaxun Liu <Yaxun.Liu@amd.com> |
[HIP] Support attribute hip_pinned_shadow
This patch introduces support of hip_pinned_shadow variable for HIP.
A hip_pinned_shadow variable is a global variable with attribute hip_pinned_shadow. It
[HIP] Support attribute hip_pinned_shadow
This patch introduces support of hip_pinned_shadow variable for HIP.
A hip_pinned_shadow variable is a global variable with attribute hip_pinned_shadow. It has external linkage on device side and has no initializer. It has internal linkage on host side and has initializer or static constructor. It can be accessed in both device code and host code.
This allows HIP runtime to implement support of HIP texture reference.
Differential Revision: https://reviews.llvm.org/D62738
llvm-svn: 364381
show more ...
|
#
15e678e8 |
| 24-Jun-2019 |
Konstantin Pyzhov <konstantin.pyzhov@gmail.com> |
[CUDA][HIP] Don't set comdat attribute for CUDA device stub functions.\nDifferential Revision: https://reviews.llvm.org/D63277
llvm-svn: 364183
|
#
0034e84a |
| 20-Jun-2019 |
Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> |
[OpenMP] Add support for handling declare target to clause when unified memory is required
Summary: This patch adds support for the handling of the variables under the declare target to clause.
The
[OpenMP] Add support for handling declare target to clause when unified memory is required
Summary: This patch adds support for the handling of the variables under the declare target to clause.
The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63108
llvm-svn: 363959
show more ...
|
#
e40f879e |
| 17-Jun-2019 |
Michael Liao <michael.hliao@gmail.com> |
[HIP] Add the interface deriving the stub name of device kernels.
Summary: - Revise the interface to derive the stub name and simplify the assertion of it.
Reviewers: yaxunl, tra
Subscribers: cf
[HIP] Add the interface deriving the stub name of device kernels.
Summary: - Revise the interface to derive the stub name and simplify the assertion of it.
Reviewers: yaxunl, tra
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63335
llvm-svn: 363553
show more ...
|
#
6cb2d9db |
| 14-Jun-2019 |
Akira Hatanaka <ahatanaka@apple.com> |
[CodeGen][ObjC] Annotate retain-agnostic ObjC globals with attribute 'objc_arc_inert'
The attribute enables the ARC optimizer to delete ObjC ARC runtime calls on the annotated globals (see https://r
[CodeGen][ObjC] Annotate retain-agnostic ObjC globals with attribute 'objc_arc_inert'
The attribute enables the ARC optimizer to delete ObjC ARC runtime calls on the annotated globals (see https://reviews.llvm.org/D62433). We currently only annotate global variables for string literals and global blocks with the attribute.
rdar://problem/49839633
Differential Revision: https://reviews.llvm.org/D62831
llvm-svn: 363467
show more ...
|
#
e08e68de |
| 07-Jun-2019 |
Peter Collingbourne <peter@pcc.me.uk> |
Driver, IRGen: Set partitions on GlobalValues according to -fsymbol-partition flag.
Differential Revision: https://reviews.llvm.org/D62636
llvm-svn: 362829
|
#
f61b5481 |
| 30-May-2019 |
Anastasia Stulova <anastasia.stulova@arm.com> |
[OpenCL] Fix OpenCL/SPIR version metadata in C++ mode.
C++ is derived from OpenCL v2.0 therefore set the versions identically.
Differential Revision: https://reviews.llvm.org/D62657
llvm-svn: 3621
[OpenCL] Fix OpenCL/SPIR version metadata in C++ mode.
C++ is derived from OpenCL v2.0 therefore set the versions identically.
Differential Revision: https://reviews.llvm.org/D62657
llvm-svn: 362102
show more ...
|
#
4b7a713a |
| 29-May-2019 |
Michael Liao <michael.hliao@gmail.com> |
[CUDA][HIP] Skip setting `externally_initialized` for static device variables.
Summary: - By declaring device variables as `static`, we assume they won't be addressable from the host side. Thus, n
[CUDA][HIP] Skip setting `externally_initialized` for static device variables.
Summary: - By declaring device variables as `static`, we assume they won't be addressable from the host side. Thus, no `externally_initialized` is required.
Reviewers: yaxunl
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62603
llvm-svn: 361994
show more ...
|
#
02afe4e0 |
| 28-May-2019 |
Yaxun Liu <Yaxun.Liu@amd.com> |
[CUDA][HIP] Emit dependent libs for host only
Recently D60274 was introduced to allow lld to handle dependent libs. However current usage of dependent libs (e.g. pragma comment(lib, *) in windows he
[CUDA][HIP] Emit dependent libs for host only
Recently D60274 was introduced to allow lld to handle dependent libs. However current usage of dependent libs (e.g. pragma comment(lib, *) in windows header files) are intended for host only. Emitting the metadata in device IR causes link error in device path.
Until there is a way to different it dependent libs for device or host, metadata for dependent libs should be emitted for host only. This patch enforces that.
Differential Revision: https://reviews.llvm.org/D62483
llvm-svn: 361880
show more ...
|
#
e637cbe4 |
| 21-May-2019 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Refactor: split Uninitialized state on APValue into an "Absent" state representing no such object, and an "Indeterminate" state representing an uninitialized object. The latter is not yet used, but s
Refactor: split Uninitialized state on APValue into an "Absent" state representing no such object, and an "Indeterminate" state representing an uninitialized object. The latter is not yet used, but soon will be.
llvm-svn: 361328
show more ...
|
#
66cdbb47 |
| 21-May-2019 |
Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> |
[OpenMP] Add support for registering requires directives with the runtime
Summary: This patch adds support for the registration of the requires directives with the runtime.
Each requires directive
[OpenMP] Add support for registering requires directives with the runtime
Summary: This patch adds support for the registration of the requires directives with the runtime.
Each requires directive clause will enable a particular flag to be set.
The set of flags is passed to the runtime to be checked for compatibility with other such flags coming from other object files.
The registration function is called whenever OpenMP is present even if a requires directive is not present. This helps detect cases in which requires directives are used inconsistently.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev, AlexEichenberger
Subscribers: jholewinski, guansong, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60568
llvm-svn: 361298
show more ...
|
#
6b21c4a4 |
| 21-May-2019 |
Alexey Bataev <a.bataev@hotmail.com> |
[OPENMP]Use the attributes for dso locality when building for device.
Currently, we ignore all dso locality attributes/info when building for the device and thus all symblos are externally visible a
[OPENMP]Use the attributes for dso locality when building for device.
Currently, we ignore all dso locality attributes/info when building for the device and thus all symblos are externally visible and can be preemted at the runtime. It may lead to incorrect results. We need to follow the same logic, compiler uses for static/pie builds.
llvm-svn: 361283
show more ...
|
#
1d16515f |
| 17-May-2019 |
Ben Dunbobbin <bd1976llvm@gmail.com> |
[ELF] Implement Dependent Libraries Feature
This patch implements a limited form of autolinking primarily designed to allow either the --dependent-library compiler option, or "comment lib" pragmas (
[ELF] Implement Dependent Libraries Feature
This patch implements a limited form of autolinking primarily designed to allow either the --dependent-library compiler option, or "comment lib" pragmas ( https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=vs-2017) in C/C++ e.g. #pragma comment(lib, "foo"), to cause an ELF linker to automatically add the specified library to the link when processing the input file generated by the compiler.
Currently this extension is unique to LLVM and LLD. However, care has been taken to design this feature so that it could be supported by other ELF linkers.
The design goals were to provide:
- A simple linking model for developers to reason about. - The ability to to override autolinking from the linker command line. - Source code compatibility, where possible, with "comment lib" pragmas in other environments (MSVC in particular).
Dependent library support is implemented differently for ELF platforms than on the other platforms. Primarily this difference is that on ELF we pass the dependent library specifiers directly to the linker without manipulating them. This is in contrast to other platforms where they are mapped to a specific linker option by the compiler. This difference is a result of the greater variety of ELF linkers and the fact that ELF linkers tend to handle libraries in a more complicated fashion than on other platforms. This forces us to defer handling the specifiers to the linker.
In order to achieve a level of source code compatibility with other platforms we have restricted this feature to work with libraries that meet the following "reasonable" requirements:
1. There are no competing defined symbols in a given set of libraries, or if they exist, the program owner doesn't care which is linked to their program. 2. There may be circular dependencies between libraries.
The binary representation is a mergeable string section (SHF_MERGE, SHF_STRINGS), called .deplibs, with custom type SHT_LLVM_DEPENDENT_LIBRARIES (0x6fff4c04). The compiler forms this section by concatenating the arguments of the "comment lib" pragmas and --dependent-library options in the order they are encountered. Partial (-r, -Ur) links are handled by concatenating .deplibs sections with the normal mergeable string section rules. As an example, #pragma comment(lib, "foo") would result in:
.section ".deplibs","MS",@llvm_dependent_libraries,1 .asciz "foo"
For LTO, equivalent information to the contents of a the .deplibs section can be retrieved by the LLD for bitcode input files.
LLD processes the dependent library specifiers in the following way:
1. Dependent libraries which are found from the specifiers in .deplibs sections of relocatable object files are added when the linker decides to include that file (which could itself be in a library) in the link. Dependent libraries behave as if they were appended to the command line after all other options. As a consequence the set of dependent libraries are searched last to resolve symbols. 2. It is an error if a file cannot be found for a given specifier. 3. Any command line options in effect at the end of the command line parsing apply to the dependent libraries, e.g. --whole-archive. 4. The linker tries to add a library or relocatable object file from each of the strings in a .deplibs section by; first, handling the string as if it was specified on the command line; second, by looking for the string in each of the library search paths in turn; third, by looking for a lib<string>.a or lib<string>.so (depending on the current mode of the linker) in each of the library search paths. 5. A new command line option --no-dependent-libraries tells LLD to ignore the dependent libraries.
Rationale for the above points:
1. Adding the dependent libraries last makes the process simple to understand from a developers perspective. All linkers are able to implement this scheme. 2. Error-ing for libraries that are not found seems like better behavior than failing the link during symbol resolution. 3. It seems useful for the user to be able to apply command line options which will affect all of the dependent libraries. There is a potential problem of surprise for developers, who might not realize that these options would apply to these "invisible" input files; however, despite the potential for surprise, this is easy for developers to reason about and gives developers the control that they may require. 4. This algorithm takes into account all of the different ways that ELF linkers find input files. The different search methods are tried by the linker in most obvious to least obvious order. 5. I considered adding finer grained control over which dependent libraries were ignored (e.g. MSVC has /nodefaultlib:<library>); however, I concluded that this is not necessary: if finer control is required developers can fall back to using the command line directly.
RFC thread: http://lists.llvm.org/pipermail/llvm-dev/2019-March/131004.html.
Differential Revision: https://reviews.llvm.org/D60274
llvm-svn: 360984
show more ...
|
#
ab8cde44 |
| 12-May-2019 |
Lubos Lunak <l.lunak@centrum.cz> |
make -ftime-trace also print template arguments
Without this, I get e.g. 'PerformPendingInstantiations' -> 'std::fill', now I get 'std::fill<unsigned long *, int>'.
Differential Revision: https://r
make -ftime-trace also print template arguments
Without this, I get e.g. 'PerformPendingInstantiations' -> 'std::fill', now I get 'std::fill<unsigned long *, int>'.
Differential Revision: https://reviews.llvm.org/D61822
llvm-svn: 360539
show more ...
|
#
e6cf6c78 |
| 09-May-2019 |
Anastasia Stulova <anastasia.stulova@arm.com> |
[OpenCL] Make global ctor init function a kernel
We need to be able to enqueue internal function that initializes global constructors on the host side. Therefore it has to be converted to a kernel.
[OpenCL] Make global ctor init function a kernel
We need to be able to enqueue internal function that initializes global constructors on the host side. Therefore it has to be converted to a kernel.
This change factors out common logic for adding kernel metadata and moves it from CodeGenFunction to CodeGenModule in order to make it accessible for the extra use case.
Differential revision: https://reviews.llvm.org/D61488
llvm-svn: 360342
show more ...
|
#
eba9a6e0 |
| 09-May-2019 |
Anastasia Stulova <anastasia.stulova@arm.com> |
[SPIR] Simplified target checking.
Switched to Triple::isSPIR() helper to simplify code.
Patch by kpet (Kevin Petit)!
Differential revision: https://reviews.llvm.org/D61639
llvm-svn: 360325
|
#
6bf108d7 |
| 07-May-2019 |
Reid Kleckner <rnk@google.com> |
[COFF] Use COFF stubs for extern_weak functions
Summary: A COFF stub indirects the reference to a symbol through memory. A .refptr.$sym global variable pointer is created to refer to $sym. Typically
[COFF] Use COFF stubs for extern_weak functions
Summary: A COFF stub indirects the reference to a symbol through memory. A .refptr.$sym global variable pointer is created to refer to $sym. Typically mingw uses these for external global variable declarations, but we can use them for weak function declarations as well.
Updates the dso_local classification to add a special case for extern_weak symbols on COFF in both clang and LLVM.
Fixes PR37598
Reviewers: smeenai, mstorsjo
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D61615
llvm-svn: 360207
show more ...
|
#
1808c02c |
| 29-Apr-2019 |
Reid Kleckner <rnk@google.com> |
Re-land r359250, [COFF] Statically link certain runtime library functions
Reverts the revert of r359251, this time with fixed tests.
Differential Revision: https://reviews.llvm.org/D55229
llvm-svn
Re-land r359250, [COFF] Statically link certain runtime library functions
Reverts the revert of r359251, this time with fixed tests.
Differential Revision: https://reviews.llvm.org/D55229
llvm-svn: 359513
show more ...
|
#
1be5369a |
| 25-Apr-2019 |
Reid Kleckner <rnk@google.com> |
Revert [COFF] Statically link certain runtime library functions
This reverts r359250 (git commit 4730604bd3a361c68b92b18bf73a5daa15afe9f4)
The newly added test should use -cc1 and -emit-llvm and th
Revert [COFF] Statically link certain runtime library functions
This reverts r359250 (git commit 4730604bd3a361c68b92b18bf73a5daa15afe9f4)
The newly added test should use -cc1 and -emit-llvm and there are other test failures that need fixing.
llvm-svn: 359251
show more ...
|
#
4730604b |
| 25-Apr-2019 |
Reid Kleckner <rnk@google.com> |
[COFF] Statically link certain runtime library functions
Statically link certain runtime library functions for MSVC/GNU Windows environments. This is consistent with MSVC behavior.
Fixes LNK4286 an
[COFF] Statically link certain runtime library functions
Statically link certain runtime library functions for MSVC/GNU Windows environments. This is consistent with MSVC behavior.
Fixes LNK4286 and LNK4217 warnings from link.exe when linking the static CRT: LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-calls.o' LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-calls.o' LINK : warning LNK4217: symbol '_CxxThrowException' defined in 'libvcruntime.lib(throw.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-calls.o' in function '"int `public: static class UnitTest::GetInstance * __cdecl testing::UnitTest::GetInstance(void)'::`1'::dtor$5" (?dtor$5@?0??GetInstance@UnitTest@testing@@SAPEAV12@XZ@4HA)'
Reviewers: mstorsjo, efriedma, TomTan, compnerd, smeenai, mgrang
Subscribers: abdulras, theraven, smeenai, pcc, mehdi_amini, javed.absar, inglorion, kristof.beyls, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D55229
llvm-svn: 359250
show more ...
|
#
899d1392 |
| 24-Apr-2019 |
Fangrui Song <maskray@google.com> |
Use llvm::stable_sort
llvm-svn: 359098
|
#
fb59fef7 |
| 23-Apr-2019 |
Scott Linder <scott@scottlinder.com> |
Move setTargetAttributes after setGVProperties in SetFunctionAttributes
AMDGPU currently relies on global properties being set before setTargetProperties is called. Existing targets like MIPS which
Move setTargetAttributes after setGVProperties in SetFunctionAttributes
AMDGPU currently relies on global properties being set before setTargetProperties is called. Existing targets like MIPS which rely on setTargetProperties do not rely on the current behavior, so this patch moves the call later in SetFunctionAttributes.
Differential Revision: https://reviews.llvm.org/D60967
llvm-svn: 359039
show more ...
|
#
d880de2d |
| 30-Mar-2019 |
Anton Afanasyev <anton.a.afanasyev@gmail.com> |
Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` compatible JSON profiling output dumps.
This change adds hierarchical "time trace" profiling blocks that can be visualized
Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` compatible JSON profiling output dumps.
This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc.
This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2
Patch by Aras Pranckevičius.
Differential Revision: https://reviews.llvm.org/D58675
llvm-svn: 357340
show more ...
|
#
d1c5b28c |
| 22-Mar-2019 |
Peter Collingbourne <peter@pcc.me.uk> |
IRGen: Remove StructorType; thread GlobalDecl through more code. NFCI.
This should make it easier to add more structor variants.
Differential Revision: https://reviews.llvm.org/D59724
llvm-svn: 35
IRGen: Remove StructorType; thread GlobalDecl through more code. NFCI.
This should make it easier to add more structor variants.
Differential Revision: https://reviews.llvm.org/D59724
llvm-svn: 356822
show more ...
|
#
c5687258 |
| 21-Mar-2019 |
Alexey Bataev <a.bataev@hotmail.com> |
[OPENMP]Codegen support for allocate directive on global variables.
For the global variables the allocate directive must specify only the predefined allocator. This allocator must be translated into
[OPENMP]Codegen support for allocate directive on global variables.
For the global variables the allocate directive must specify only the predefined allocator. This allocator must be translated into the correct form of the address space for the targets that support different address spaces.
llvm-svn: 356702
show more ...
|