| #
458676db |
| 26-Dec-2019 |
Teresa Johnson <[email protected]> |
[WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables
Summary: First patch to support Safe Whole Program Devirtualization Enablement, see RFC here: http://lists.llvm.org/piperm
[WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables
Summary: First patch to support Safe Whole Program Devirtualization Enablement, see RFC here: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html
Always emit !vcall_visibility metadata under -fwhole-program-vtables, and not just for -fvirtual-function-elimination. The vcall visibility metadata will (in a subsequent patch) be used to communicate to WPD which vtables are safe to devirtualize, and we will optionally convert the metadata to hidden visibility at link time. Subsequent follow on patches will help enable this by adding vcall_visibility metadata to the ThinLTO summaries, and always emit type test intrinsics under -fwhole-program-vtables (and not just for vtables with hidden visibility).
In order to do this safely with VFE, since for VFE all vtable loads must be type checked loads which will no longer be the case, this patch adds a new "Virtual Function Elim" module flag to communicate to GlobalDCE whether to perform VFE using the vcall_visibility metadata.
One additional advantage of using the vcall_visibility metadata to drive more WPD at LTO link time is that we can use the same mechanism to enable more aggressive VFE at LTO link time as well. The link time option proposed in the RFC will convert vcall_visibility metadata to hidden (aka linkage unit visibility), which combined with -fvirtual-function-elimination will allow it to be done more aggressively at LTO link time under the same conditions.
Reviewers: pcc, ostannard, evgeny777, steven_wu
Subscribers: mehdi_amini, Prazek, hiraditya, dexonsmith, davidxl, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71907
show more ...
|
| #
e15fb06e |
| 30-Dec-2019 |
Zakk Chen <[email protected]> |
[RISCV] Pass target-abi via module flag metadata
Reviewers: lenary, asb
Reviewed By: lenary
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72755
|
| #
a4451d88 |
| 02-Nov-2019 |
Matt Arsenault <[email protected]> |
Consolidate internal denormal flushing controls
Currently there are 4 different mechanisms for controlling denormal flushing behavior, and about as many equivalent frontend controls.
- AMDGPU uses
Consolidate internal denormal flushing controls
Currently there are 4 different mechanisms for controlling denormal flushing behavior, and about as many equivalent frontend controls.
- AMDGPU uses the fp32-denormals and fp64-f16-denormals subtarget features - NVPTX uses the nvptx-f32ftz attribute - ARM directly uses the denormal-fp-math attribute - Other targets indirectly use denormal-fp-math in one DAGCombine - cl-denorms-are-zero has a corresponding denorms-are-zero attribute
AMDGPU wants a distinct control for f32 flushing from f16/f64, and as far as I can tell the same is true for NVPTX (based on the attribute name).
Work on consolidating these into the denormal-fp-math attribute, and a new type specific denormal-fp-math-f32 variant. Only ARM seems to support the two different flush modes, so this is overkill for the other use cases. Ideally we would error on the unsupported positive-zero mode on other targets from somewhere.
Move the logic for selecting the flush mode into the compiler driver, instead of handling it in cc1. denormal-fp-math/denormal-fp-math-f32 are now both cc1 flags, but denormal-fp-math-f32 is not yet exposed as a user flag.
-cl-denorms-are-zero, -fcuda-flush-denormals-to-zero and -fno-cuda-flush-denormals-to-zero will be mapped to -fp-denormal-math-f32=ieee or preserve-sign rather than the old attributes.
Stop emitting the denorms-are-zero attribute for the OpenCL flag. It has no in-tree users. The meaning would also be target dependent, such as the AMDGPU choice to treat this as only meaning allow flushing of f32 and not f16 or f64. The naming is also potentially confusing, since DAZ in other contexts refers to instructions implicitly treating input denormals as zero, not necessarily flushing output denormals to zero.
This also does not attempt to change the behavior for the current attribute. The LangRef now states that the default is ieee behavior, but this is inaccurate for the current implementation. The clang handling is slightly hacky to avoid touching the existing denormal-fp-math uses. Fixing this will be left for a future patch.
AMDGPU is still using the subtarget feature to control the denormal mode, but the new attribute are now emitted. A future change will switch this and remove the subtarget features.
show more ...
|
| #
d437fba8 |
| 16-Jan-2020 |
serge-sans-paille <[email protected]> |
Reapply Allow system header to provide their own implementation of some builtin
This reverts commit 3d210ed3d1880c615776b07d1916edb400c245a6.
See https://reviews.llvm.org/D71082 for the patch and d
Reapply Allow system header to provide their own implementation of some builtin
This reverts commit 3d210ed3d1880c615776b07d1916edb400c245a6.
See https://reviews.llvm.org/D71082 for the patch and discussion that make it possible to reapply this patch.
show more ...
|
| #
25b542c6 |
| 16-Jan-2020 |
Alexey Bataev <[email protected]> |
[OPENMP]Do not emit RTTI descriptor for NVPTX devices.
Need to disable emission of RTTI descriptors for NVPTX devices to be able to use dynamic classes without unresolved symbols at link stage.
|
| #
19c5057e |
| 15-Jan-2020 |
Simon Pilgrim <[email protected]> |
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.
|
| #
3d210ed3 |
| 15-Jan-2020 |
Amy Huang <[email protected]> |
Revert "Allow system header to provide their own implementation of some builtin"
This reverts commit 921f871ac438175ca8fcfcafdfcfac4d7ddf3905 because it causes libc++ code to trigger __warn_memset_z
Revert "Allow system header to provide their own implementation of some builtin"
This reverts commit 921f871ac438175ca8fcfcafdfcfac4d7ddf3905 because it causes libc++ code to trigger __warn_memset_zero_len.
See https://reviews.llvm.org/D71082.
show more ...
|
| #
53539bb0 |
| 13-Jan-2020 |
Amy Huang <[email protected]> |
[DebugInfo] Add another level to DebugInfoKind called Constructor
The option will limit debug info by only emitting complete class type information when its constructor is emitted. This patch change
[DebugInfo] Add another level to DebugInfoKind called Constructor
The option will limit debug info by only emitting complete class type information when its constructor is emitted. This patch changes comparisons with LimitedDebugInfo to use the new level instead.
Differential Revision: https://reviews.llvm.org/D72427
show more ...
|
| #
921f871a |
| 05-Dec-2019 |
serge-sans-paille <[email protected]> |
Allow system header to provide their own implementation of some builtin
If a system header provides an (inline) implementation of some of their function, clang still matches on the function name and
Allow system header to provide their own implementation of some builtin
If a system header provides an (inline) implementation of some of their function, clang still matches on the function name and generate the appropriate llvm builtin, e.g. memcpy. This behavior is in line with glibc recommendation « users may not provide their own version of symbols » but doesn't account for the fact that glibc itself can provide inline version of some functions.
It is the case for the memcpy function when -D_FORTIFY_SOURCE=1 is on. In that case an inline version of memcpy calls __memcpy_chk, a function that performs extra runtime checks. Clang currently ignores the inline version and thus provides no runtime check.
This code fixes the issue by detecting functions whose name is a builtin name but also have an inline implementation.
Differential Revision: https://reviews.llvm.org/D71082
show more ...
|
| #
d35bcbbb |
| 23-Dec-2019 |
Craig Topper <[email protected]> |
[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize.
The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But t
[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize.
The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in.
This patch moves some of the code from CodeGen to create an appropriate feature map that we can pass to the function.
Differential Revision: https://reviews.llvm.org/D68627
show more ...
|
| #
e3d8ee35 |
| 22-Nov-2019 |
Yonghong Song <[email protected]> |
reland "[DebugInfo] Support to emit debugInfo for extern variables"
Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[DebugInfo] Support to emit debugInfo for extern variables") added deebugInfo fo
reland "[DebugInfo] Support to emit debugInfo for extern variables"
Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[DebugInfo] Support to emit debugInfo for extern variables") added deebugInfo for extern variables for BPF target. The commit is reverted by 891e25b02d760d0de18c7d46947913b3166047e7 as the committed tests using %clang instead of %clang_cc1 causing test failed in certain scenarios as reported by Reid Kleckner.
This patch fixed the tests by using %clang_cc1.
Differential Revision: https://reviews.llvm.org/D71818
show more ...
|
| #
891e25b0 |
| 22-Dec-2019 |
Reid Kleckner <[email protected]> |
Revert "[DebugInfo] Support to emit debugInfo for extern variables"
This reverts commit d77ae1552fc21a9f3877f3ed7e13d631f517c825.
The tests committed along with this change do not pass, and should
Revert "[DebugInfo] Support to emit debugInfo for extern variables"
This reverts commit d77ae1552fc21a9f3877f3ed7e13d631f517c825.
The tests committed along with this change do not pass, and should be changed to use %clang_cc1.
show more ...
|
| #
b3c06db4 |
| 05-Nov-2019 |
Johannes Doerfert <[email protected]> |
[OpenMP] Use the OpenMP-IR-Builder
This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19.
[1] http://lists.flang-comp
[OpenMP] Use the OpenMP-IR-Builder
This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19.
[1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html
Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim
Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69922
show more ...
|
|
Revision tags: llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2 |
|
| #
f21c081b |
| 05-Jun-2019 |
Nicolai Hähnle <[email protected]> |
CodeGen: Allow annotations on globals in non-zero address space
Summary: Attribute annotations are recorded in a special global composite variable that points to annotation strings and the annotated
CodeGen: Allow annotations on globals in non-zero address space
Summary: Attribute annotations are recorded in a special global composite variable that points to annotation strings and the annotated objects.
As a restriction of the LLVM IR type system, those pointers are all pointers to address space 0, so let's insert an addrspacecast when the annotated global is in a non-0 address space.
Since this addrspacecast is only reachable from the global annotations object, this should allow us to represent annotations on all globals regardless of which addrspacecasts are usually legal for the target.
Reviewers: rjmccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71208
show more ...
|
| #
d77ae155 |
| 22-Nov-2019 |
Yonghong Song <[email protected]> |
[DebugInfo] Support to emit debugInfo for extern variables
Extern variable usage in BPF is different from traditional pure user space application. Recent discussion in linux bpf mailing list has two
[DebugInfo] Support to emit debugInfo for extern variables
Extern variable usage in BPF is different from traditional pure user space application. Recent discussion in linux bpf mailing list has two use cases where debug info types are required to use extern variables: - extern types are required to have a suitable interface in libbpf (bpf loader) to provide kernel config parameters to bpf programs. https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t - extern types are required so kernel bpf verifier can verify program which uses external functions more precisely. This will make later link with actual external function no need to reverify. https://lore.kernel.org/bpf/[email protected]/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed
This patch added clang support to emit debuginfo for extern variables with a TargetInfo hook to enable it. The debuginfo for the extern variable is emitted only if that extern variable is referenced in the current compilation unit.
Currently, only BPF target enables to generate debug info for extern variables. The emission of such debuginfo is disabled for C++ at this moment since BPF only supports a subset of C language. Emission with C++ can be enabled later if an appropriate use case is identified.
-fstandalone-debug permits us to see more debuginfo with the cost of bloated binary size. This patch did not add emission of extern variable debug info with -fstandalone-debug. This can be re-evaluated if there is a real need.
Differential Revision: https://reviews.llvm.org/D70696
show more ...
|
| #
505aa241 |
| 09-Dec-2019 |
Craig Topper <[email protected]> |
[Attr] Move ParsedTargetAttr out of the TargetAttr class
Need to forward declare it in ASTContext.h for D68627, so it can't be a nested struct.
Differential Revision: https://reviews.llvm.org/D71159
|
| #
eff08f40 |
| 06-Dec-2019 |
Reid Kleckner <[email protected]> |
Revert "[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize."
This reverts commit e1578fd2b79fe5af5f80c0c166a8abd0f816c022.
It introduces a dependency
Revert "[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize."
This reverts commit e1578fd2b79fe5af5f80c0c166a8abd0f816c022.
It introduces a dependency on Attr.h which I am removing from ASTContext.h.
show more ...
|
| #
e1578fd2 |
| 06-Dec-2019 |
Craig Topper <[email protected]> |
[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize.
The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But t
[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize.
The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in.
This patch copies some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Probably need some refactoring here to share more code with Codegen. Is there a good place to do that? Also need to support the cpu_specific attribute as well.
Differential Revision: https://reviews.llvm.org/D68627
show more ...
|
| #
9c3f9b9c |
| 07-Sep-2019 |
Petr Hosek <[email protected]> |
[Clang] Define Fuchsia C++ABI
Currently, it is a modified version of the Itanium ABI, with the only change being that constructors and destructors return 'this'.
Differential Revision: https://revi
[Clang] Define Fuchsia C++ABI
Currently, it is a modified version of the Itanium ABI, with the only change being that constructors and destructors return 'this'.
Differential Revision: https://reviews.llvm.org/D70575
show more ...
|
| #
bbc328c6 |
| 21-Nov-2019 |
Alexey Bataev <[email protected]> |
[OPENMP]Fix PR41826: symbols visibility in device code.
Summary: Currently, we ignore all locality attributes/info when building for the device and thus all symblos are externally visible and can be
[OPENMP]Fix PR41826: symbols visibility in device code.
Summary: Currently, we ignore all 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. But in some cases changing of dso locality may lead to problems with codegen, so instead mark external symbols as hidden instead in the device code.
Reviewers: jdoerfert
Subscribers: guansong, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70549
show more ...
|
| #
e956952e |
| 23-Nov-2019 |
David Blaikie <[email protected]> |
DebugInfo: Flag Dwarf Version metadata for merging during LTO
When the Dwarf Version metadata was initially added (r184276) there was no support for Module::Max - though the comment suggested that w
DebugInfo: Flag Dwarf Version metadata for merging during LTO
When the Dwarf Version metadata was initially added (r184276) there was no support for Module::Max - though the comment suggested that was the desired behavior. The original behavior was Module::Warn which would warn and then pick whichever version came first - which is pretty arbitrary/luck-based if the consumer has some need for one version or the other.
Now that the functionality's been added (r303590) this change updates the implementation to match the desired goal.
The general logic here is - if you compile /some/ of your program with a more recent DWARF version, you must have a consumer that can handle it, so might as well use it for /everything/.
The only place where this might fall down is if you have a need to use an old tool (supporting only the older DWARF version) for some subset of your program. In which case now it'll all be the higher version. That seems pretty narrow (& the inverse could happen too - you specifically /need/ the higher DWARF version for some extra expressivity, etc, in some part of the program)
show more ...
|
| #
c63f1b16 |
| 07-Nov-2019 |
Ehud Katz <[email protected]> |
[DeclCXX] Remove unknown external linkage specifications
Partial revert of r372681 "Support for DWARF-5 C++ language tags".
The change introduced new external linkage languages ("C++11" and "C++14"
[DeclCXX] Remove unknown external linkage specifications
Partial revert of r372681 "Support for DWARF-5 C++ language tags".
The change introduced new external linkage languages ("C++11" and "C++14") which not supported in C++.
It also changed the definition of the existing enum to use the DWARF constants. The problem is that "LinkageSpecDeclBits.Language" (the field that reserves this enum) is actually defined as 3 bits length (bitfield), which cannot contain the new DWARF constants. Defining the enum as integer literals is more appropriate for maintaining valid values.
Differential Revision: https://reviews.llvm.org/D69935
show more ...
|
| #
b0561b33 |
| 17-Nov-2019 |
Tyker <[email protected]> |
[NFC] Refactor representation of materialized temporaries
Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63
[NFC] Refactor representation of materialized temporaries
Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718
Reviewers: rsmith, martong, shafik
Reviewed By: rsmith
Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69360
show more ...
|
| #
c9276fbf |
| 17-Nov-2019 |
Nico Weber <[email protected]> |
Revert "[NFC] Refactor representation of materialized temporaries"
This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982. It broke ./ClangdTests/FindExplicitReferencesTest.All on the bots, se
Revert "[NFC] Refactor representation of materialized temporaries"
This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982. It broke ./ClangdTests/FindExplicitReferencesTest.All on the bots, see comments on https://reviews.llvm.org/D69360
show more ...
|
| #
08ea1ee2 |
| 16-Nov-2019 |
Tyker <[email protected]> |
[NFC] Refactor representation of materialized temporaries
Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63
[NFC] Refactor representation of materialized temporaries
Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718
Reviewers: rsmith, martong, shafik
Reviewed By: rsmith
Subscribers: rnkovacs, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69360
show more ...
|