#
6a867303 |
| 10-May-2022 |
David Tenty <daltenty@ibm.com> |
Reland [clang][AIX] add option mdefault-visibility-export-mapping
The option mdefault-visibility-export-mapping is created to allow mapping default visibility to an explicit shared library export (e
Reland [clang][AIX] add option mdefault-visibility-export-mapping
The option mdefault-visibility-export-mapping is created to allow mapping default visibility to an explicit shared library export (e.g. dllexport). Exactly how and if this is manifested is target dependent (since it depends on how they map dllexport in the IR).
Three values are provided for the option:
* none: the default and behavior without the option, no additional export linkage information is created. * explicit: add the export for entities with explict default visibility from the source, including RTTI * all: add the export for all entities with default visibility
This option is useful for targets which do not export symbols as part of their usual default linkage behaviour (e.g. AIX), such targets traditionally specified such information in external files (e.g. export lists), but this mapping allows them to use the visibility information typically used for this purpose on other (e.g. ELF) platforms.
This relands commit: 8c8a2679a20f621994fa904bcfc68775e7345edc
with fixes for the compile time and assert problems that were reported by:
* making shouldMapVisibilityToDLLExport inline and provide an early return in the case where no mapping is in effect (aka non-AIX platforms) * don't try to export RTTI types which we will give internal linkage to
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D126340
show more ...
|
#
5ee38769 |
| 11-Jun-2022 |
Kazu Hirata <kazu@google.com> |
Use isa instead of dyn_cast (NFC)
|
#
f32ad570 |
| 07-Jun-2022 |
Vitaly Buka <vitalybuka@google.com> |
[NFC] Move part of SanitizerMetadata into private method
|
#
f49a5844 |
| 07-Jun-2022 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
[NFC][CodeGen] Rename method
Extracted from D84652.
|
#
5c3bde96 |
| 07-Jun-2022 |
Erich Keane <erich.keane@intel.com> |
[CodeGen] Fix an issue when the 'extern C' replacement names broke
Originally broken by me in D122608, this is a regression where we attempt to replace an extern-C thing with 'itself'. The problem
[CodeGen] Fix an issue when the 'extern C' replacement names broke
Originally broken by me in D122608, this is a regression where we attempt to replace an extern-C thing with 'itself'. The problem is that we end up deleting it, causing the value to fail when it gets put into llvm.used.
show more ...
|
#
47039a1a |
| 10-Jun-2020 |
Sam Clegg <sbc@chromium.org> |
[WebAssembly] Remove restriction on main name mangling
Summary: Emscripten now handles/supports this new mode.
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, cfe-commits
Tags: #clang
D
[WebAssembly] Remove restriction on main name mangling
Summary: Emscripten now handles/supports this new mode.
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75277
show more ...
|
#
d86a206f |
| 05-Jun-2022 |
Fangrui Song <i@maskray.me> |
Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options
|
#
dd2362a8 |
| 24-May-2022 |
Anders Waldenborg <anders@0x63.nu> |
[clang] Allow const variables with weak attribute to be overridden
A variable with `weak` attribute signifies that it can be replaced with a "strong" symbol link time. Therefore it must not emitted
[clang] Allow const variables with weak attribute to be overridden
A variable with `weak` attribute signifies that it can be replaced with a "strong" symbol link time. Therefore it must not emitted with "weak_odr" linkage, as that allows the backend to use its value in optimizations.
The frontend already considers weak const variables as non-constant (note_constexpr_var_init_weak diagnostic) so this change makes frontend and backend consistent.
This commit reverses the f49573d1 weak globals that are const should get weak_odr linkage. commit from 2009-08-05 which introduced this behavior. Unfortunately that commit doesn't provide any details on why the change was made.
This was discussed in https://discourse.llvm.org/t/weak-attribute-semantics-on-const-variables/62311
Differential Revision: https://reviews.llvm.org/D126324
show more ...
|
#
d42fe9aa |
| 02-Jun-2022 |
Hans Wennborg <hans@chromium.org> |
Revert "[clang][AIX] add option mdefault-visibility-export-mapping"
This caused assertions, see comment on the code review:
llvm/clang/lib/AST/Decl.cpp:1510: clang::LinkageInfo clang::LinkageComput
Revert "[clang][AIX] add option mdefault-visibility-export-mapping"
This caused assertions, see comment on the code review:
llvm/clang/lib/AST/Decl.cpp:1510: clang::LinkageInfo clang::LinkageComputer::getLVForDecl(const clang::NamedDecl *, clang::LVComputationKind): Assertion `D->getCachedLinkage() == LV.getLinkage()' failed.
> The option mdefault-visibility-export-mapping is created to allow > mapping default visibility to an explicit shared library export > (e.g. dllexport). Exactly how and if this is manifested is target > dependent (since it depends on how they map dllexport in the IR). > > Three values are provided for the option: > > * none: the default and behavior without the option, no additional export linkage information is created. > * explicit: add the export for entities with explict default visibility from the source, including RTTI > * all: add the export for all entities with default visibility > > This option is useful for targets which do not export symbols as part of > their usual default linkage behaviour (e.g. AIX), such targets > traditionally specified such information in external files (e.g. export > lists), but this mapping allows them to use the visibility information > typically used for this purpose on other (e.g. ELF) platforms. > > Reviewed By: MaskRay > > Differential Revision: https://reviews.llvm.org/D126340
This reverts commit 8c8a2679a20f621994fa904bcfc68775e7345edc.
show more ...
|
#
8c8a2679 |
| 10-May-2022 |
David Tenty <daltenty@ibm.com> |
[clang][AIX] add option mdefault-visibility-export-mapping
The option mdefault-visibility-export-mapping is created to allow mapping default visibility to an explicit shared library export (e.g. dll
[clang][AIX] add option mdefault-visibility-export-mapping
The option mdefault-visibility-export-mapping is created to allow mapping default visibility to an explicit shared library export (e.g. dllexport). Exactly how and if this is manifested is target dependent (since it depends on how they map dllexport in the IR).
Three values are provided for the option:
* none: the default and behavior without the option, no additional export linkage information is created. * explicit: add the export for entities with explict default visibility from the source, including RTTI * all: add the export for all entities with default visibility
This option is useful for targets which do not export symbols as part of their usual default linkage behaviour (e.g. AIX), such targets traditionally specified such information in external files (e.g. export lists), but this mapping allows them to use the visibility information typically used for this purpose on other (e.g. ELF) platforms.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D126340
show more ...
|
#
0a5cfbf7 |
| 25-May-2022 |
Mike Rice <michael.p.rice@intel.com> |
[OpenMP] Use the align clause value from 'omp allocate' for globals
Refactor the code that handles the align clause of 'omp allocate' so it can be used with globals as well as local variables.
Diff
[OpenMP] Use the align clause value from 'omp allocate' for globals
Refactor the code that handles the align clause of 'omp allocate' so it can be used with globals as well as local variables.
Differential Revision: https://reviews.llvm.org/D126426
show more ...
|
#
1bae02b7 |
| 18-May-2022 |
Joseph Huber <jhuber6@vols.utk.edu> |
[Cuda] Use fallback method to mangle externalized decls if no CUID given
CUDA requires that static variables be visible to the host when offloading. However, The standard semantics of a stiatc varia
[Cuda] Use fallback method to mangle externalized decls if no CUID given
CUDA requires that static variables be visible to the host when offloading. However, The standard semantics of a stiatc variable dictate that it should not be visible outside of the current file. In order to access it from the host we need to perform "externalization" on the static variable on the device. This requires generating a semi-unique name that can be affixed to the variable as to not cause linker errors.
This is currently done using the CUID functionality, an MD5 hash value set up by the clang driver. This allows us to achieve is mostly unique ID that is unique even between multiple compilations of the same file. However, this is not always availible. Instead, this patch uses the unique ID from the file to generate a unique symbol name. This will create a unique name that is consistent between the host and device side compilations without requiring the CUID to be entered by the driver. The one downside to this is that we are no longer stable under multiple compilations of the same file. However, this is a very niche use-case and is not supported by Nvidia's CUDA compiler so it likely to be good enough.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D125904
show more ...
|
#
7aa1fa0a |
| 18-May-2022 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
Reland "[dwarf] Emit a DIGlobalVariable for constant strings."
An upcoming patch will extend llvm-symbolizer to provide the source line information for global variables. The goal is to move AddressS
Reland "[dwarf] Emit a DIGlobalVariable for constant strings."
An upcoming patch will extend llvm-symbolizer to provide the source line information for global variables. The goal is to move AddressSanitizer off of internal debug info for symbolization onto the DWARF standard (and doing a clean-up in the process). Currently, ASan reports the line information for constant strings if a memory safety bug happens around them. We want to keep this behaviour, so we need to emit debuginfo for these variables as well.
Reviewed By: dblaikie, rnk, aprantl
Differential Revision: https://reviews.llvm.org/D123534
show more ...
|
#
ed2c3218 |
| 17-May-2022 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
Revert "[dwarf] Emit a DIGlobalVariable for constant strings."
This reverts commit 4680982b36a84770a1600fc438be8ec090671724.
Broke a fuchsia windows bot. More details in the review: https://reviews
Revert "[dwarf] Emit a DIGlobalVariable for constant strings."
This reverts commit 4680982b36a84770a1600fc438be8ec090671724.
Broke a fuchsia windows bot. More details in the review: https://reviews.llvm.org/D123534
show more ...
|
#
4680982b |
| 16-May-2022 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
[dwarf] Emit a DIGlobalVariable for constant strings.
An upcoming patch will extend llvm-symbolizer to provide the source line information for global variables. The goal is to move AddressSanitizer
[dwarf] Emit a DIGlobalVariable for constant strings.
An upcoming patch will extend llvm-symbolizer to provide the source line information for global variables. The goal is to move AddressSanitizer off of internal debug info for symbolization onto the DWARF standard (and doing a clean-up in the process). Currently, ASan reports the line information for constant strings if a memory safety bug happens around them. We want to keep this behaviour, so we need to emit debuginfo for these variables as well.
Reviewed By: dblaikie, rnk, aprantl
Differential Revision: https://reviews.llvm.org/D123534
show more ...
|
#
73417c51 |
| 15-Apr-2022 |
python3kgae <python3kgae@outlook.com> |
[HLSL][clang][Driver] Support validator version command line option.
The DXIL validator version option(/validator-version) decide the validator version when compile hlsl. The format is major.minor l
[HLSL][clang][Driver] Support validator version command line option.
The DXIL validator version option(/validator-version) decide the validator version when compile hlsl. The format is major.minor like 1.0.
In normal case, the value of validator version should be got from DXIL validator. Before we got DXIL validator ready for llvm/main, DXIL validator version option is added first to set validator version.
It will affect code generation for DXIL, so it is treated as a code gen option.
A new member std::string DxilValidatorVersion is added to clang::CodeGenOptions.
Then CGHLSLRuntime is added to clang::CodeGenModule. It is used to translate clang::CodeGenOptions::DxilValidatorVersion into a ModuleFlag under key "dx.valver" at end of clang code generation.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D123884
show more ...
|
#
57a210e5 |
| 26-Apr-2022 |
Yaxun (Sam) Liu <yaxun.liu@amd.com> |
[CUDA][HIP] Fix linkage of __clang_gpu_used_external
Different TU's may have this globl var. appending linkage can only be used with lld recognized special variables.
Change it to internal linkage.
[CUDA][HIP] Fix linkage of __clang_gpu_used_external
Different TU's may have this globl var. appending linkage can only be used with lld recognized special variables.
Change it to internal linkage.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D124466
show more ...
|
#
04fb8167 |
| 21-Apr-2022 |
Yaxun (Sam) Liu <yaxun.liu@amd.com> |
[CUDA][HIP] Externalize kernels with internal linkage
This patch is a continuation of https://reviews.llvm.org/D123353.
Not only kernels in anonymous namespace, but also template kernels with templ
[CUDA][HIP] Externalize kernels with internal linkage
This patch is a continuation of https://reviews.llvm.org/D123353.
Not only kernels in anonymous namespace, but also template kernels with template arguments in anonymous namespace need to be externalized.
To be more generic, this patch checks the linkage of a kernel assuming the kernel does not have __global__ attribute. If the linkage is internal then clang will externalize it.
This patch also fixes the postfix for externalized symbol since nvptx does not allow '.' in symbol name.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D124189
Fixes: https://github.com/llvm/llvm-project/issues/54560
show more ...
|
#
a57d16bf |
| 20-Apr-2022 |
Fangrui Song <i@maskray.me> |
[CodeGen] Fix -Wswitch after D116462
|
#
cac4e2fe |
| 18-Apr-2022 |
Yaxun (Sam) Liu <yaxun.liu@amd.com> |
[CUDA][HIP] Fix gpu.used.external
Rename gpu.used.external as __clang_gpu_used_external as ptxas does not allow . in global variable name.
Fixes: https://github.com/llvm/llvm-project/issues/54934
[CUDA][HIP] Fix gpu.used.external
Rename gpu.used.external as __clang_gpu_used_external as ptxas does not allow . in global variable name.
Fixes: https://github.com/llvm/llvm-project/issues/54934
Reviewed by: Joseph Huber, Artem Belevich
Differential Revision: https://reviews.llvm.org/D123946
show more ...
|
#
4802edd1 |
| 14-Apr-2022 |
Eli Friedman <efriedma@quicinc.com> |
Fix size of flexible array initializers, and re-enable assertions.
In D123649, I got the formula for getFlexibleArrayInitChars slightly wrong: the flexible array elements can be contained in the tai
Fix size of flexible array initializers, and re-enable assertions.
In D123649, I got the formula for getFlexibleArrayInitChars slightly wrong: the flexible array elements can be contained in the tail padding of the struct. Fix the formula to account for that.
With the fixed formula, we run into another issue: in some cases, we were emitting extra padding for flexible arrray initializers. Fix CGExprConstant so it uses a packed struct when necessary, to avoid this extra padding.
Differential Revision: https://reviews.llvm.org/D123826
show more ...
|
#
6cf0b1b3 |
| 14-Apr-2022 |
Eli Friedman <efriedma@quicinc.com> |
Comment out assertions about initializer size added in D123649.
They're causing failures in LLVM test-suite. Added some regression tests that explain the issue.
|
#
5955a0f9 |
| 14-Apr-2022 |
Eli Friedman <efriedma@quicinc.com> |
Allow flexible array initialization in C++.
Flexible array initialization is a C/C++ extension implemented in many compilers to allow initializing the flexible array tail of a struct type that conta
Allow flexible array initialization in C++.
Flexible array initialization is a C/C++ extension implemented in many compilers to allow initializing the flexible array tail of a struct type that contains a flexible array. In clang, this is currently restricted to C. But this construct is used in the Microsoft SDK headers, so I'd like to extend it to C++.
For now, this doesn't handle dynamic initialization; probably not hard to implement, but it's extra code, and I don't think it's necessary for the expected uses. And we explicitly fail out of constant evaluation.
I've added some additional code to assert that initializers have the correct size, with or without flexible array init. This might catch issues unrelated to flexible array init.
Differential Revision: https://reviews.llvm.org/D123649
show more ...
|
#
0424b511 |
| 09-Apr-2022 |
Yaxun (Sam) Liu <yaxun.liu@amd.com> |
[CUDA][HIP] Fix host used external kernel in archive
For -fgpu-rdc, a host function may call an external kernel which is defined in an archive of bitcode. Since this external kernel is only referenc
[CUDA][HIP] Fix host used external kernel in archive
For -fgpu-rdc, a host function may call an external kernel which is defined in an archive of bitcode. Since this external kernel is only referenced in host function, the device bitcode does not contain reference to this external kernel, then the linker will not try to resolve this external kernel in the archive.
To fix this issue, host-used external kernels and device variables are tracked. A global array containing pointers to these external kernels and variables is emitted which serves as an artificial references to the external kernels and variables used by host.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D123441
show more ...
|
#
b0343a38 |
| 13-Apr-2022 |
Daniel Kiss <daniel.kiss@arm.com> |
Support the min of module flags when linking, use for AArch64 BTI/PAC-RET
LTO objects might compiled with different `mbranch-protection` flags which will cause an error in the linker. Such a setup i
Support the min of module flags when linking, use for AArch64 BTI/PAC-RET
LTO objects might compiled with different `mbranch-protection` flags which will cause an error in the linker. Such a setup is allowed in the normal build with this change that is possible.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D123493
show more ...
|