#
24ecd998 |
| 13-Feb-2023 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[NFC] Set C++20 Named Modules for CodeGen in ASTContext in the early place
Previously we'll set the named modules for ASTContext in ParseAST. But this is not intuitive and we need comments to tell t
[NFC] Set C++20 Named Modules for CodeGen in ASTContext in the early place
Previously we'll set the named modules for ASTContext in ParseAST. But this is not intuitive and we need comments to tell the intuition. This patch moves the code the right the place, where the corrresponding module is first created/loaded. Now it is more intuitive and we can use the value in the earlier places.
show more ...
|
#
71c7313f |
| 08-Feb-2023 |
Ramon de C Valle <rcvalle@users.noreply.github.com> |
Add CFI integer types normalization
This commit adds a new option (i.e., `-fsanitize-cfi-icall-normalize-integers`) for normalizing integer types as vendor extended types for cross-language LLVM CFI
Add CFI integer types normalization
This commit adds a new option (i.e., `-fsanitize-cfi-icall-normalize-integers`) for normalizing integer types as vendor extended types for cross-language LLVM CFI/KCFI support with other languages that can't represent and encode C/C++ integer types.
Specifically, integer types are encoded as their defined representations (e.g., 8-bit signed integer, 16-bit signed integer, 32-bit signed integer, ...) for compatibility with languages that define explicitly-sized integer types (e.g., i8, i16, i32, ..., in Rust).
``-fsanitize-cfi-icall-normalize-integers`` is compatible with ``-fsanitize-cfi-icall-generalize-pointers``.
This helps with providing cross-language CFI support with the Rust compiler and is an alternative solution for the issue described and alternatives proposed in the RFC https://github.com/rust-lang/rfcs/pull/3296.
For more information about LLVM CFI/KCFI and cross-language LLVM CFI/KCFI support for the Rust compiler, see the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653.
Relands b1e9ab7438a098a18fecda88fc87ef4ccadfcf1e with fixes.
Reviewed By: pcc, samitolvanen
Differential Revision: https://reviews.llvm.org/D139395
show more ...
|
#
5d07e044 |
| 06-Feb-2023 |
Wolfgang Pieb <wolfgang_pieb@playstation.sony.com> |
[TLS]: Clamp the alignment of TLS global variables if required by the target
Adding a module flag 'MaxTLSAlign' describing the maximum alignment a global TLS variable can have. Optimizers are preven
[TLS]: Clamp the alignment of TLS global variables if required by the target
Adding a module flag 'MaxTLSAlign' describing the maximum alignment a global TLS variable can have. Optimizers are prevented from increasing the alignment of such variables beyond this threshold.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D140123
show more ...
|
#
af128791 |
| 08-Feb-2023 |
Fangrui Song <i@maskray.me> |
[RISCV] Allow mismatched SmallDataLimit and use Min for conflicting values
Fix an issue about module linking with LTO.
When compiling with PIE, the small data limitation needs to be consistent with
[RISCV] Allow mismatched SmallDataLimit and use Min for conflicting values
Fix an issue about module linking with LTO.
When compiling with PIE, the small data limitation needs to be consistent with that in PIC, otherwise there will be linking errors due to conflicting values.
bar.c ``` int bar() { return 1; } ```
foo.c ``` int foo() { return 1; } ```
``` clang --target=riscv64-unknown-linux-gnu -flto -c foo.c -o foo.o -fPIE clang --target=riscv64-unknown-linux-gnu -flto -c bar.c -o bar.o -fPIC
clang --target=riscv64-unknown-linux-gnu -flto foo.o bar.o -flto -nostdlib -v -fuse-ld=lld ```
``` ld.lld: error: linking module flags 'SmallDataLimit': IDs have conflicting values in 'bar.o' and 'ld-temp.o' clang-15: error: linker command failed with exit code 1 (use -v to see invocation) ```
Use Min instead of Error for conflicting SmallDataLimit.
Authored by: @joshua-arch1 Signed-off-by: xiaojing.zhang <xiaojing.zhang@xcalibyte.com> Signed-off-by: jianxin.lai <jianxin.lai@xcalibyte.com>
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D131230
show more ...
|
#
62c7f035 |
| 07-Feb-2023 |
Archibald Elliott <archibald.elliott@arm.com> |
[NFC][TargetParser] Remove llvm/ADT/Triple.h
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
|
#
b590f997 |
| 03-Feb-2023 |
Archibald Elliott <archibald.elliott@arm.com> |
[NFC][TargetParser] Remove llvm/Support/X86TargetParser.h
|
#
3df16e6f |
| 07-Feb-2023 |
wangpc <pc.wang@linux.alibaba.com> |
Revert "[RISCV] Allow mismatched SmallDataLimit and use Min for conflicting values"
This reverts commit 28bd84f55fc087d4aefd3fe5360f8648d1d50980 because `CodeGen/RISCV/rvv-intrinsics-handcrafted/vle
Revert "[RISCV] Allow mismatched SmallDataLimit and use Min for conflicting values"
This reverts commit 28bd84f55fc087d4aefd3fe5360f8648d1d50980 because `CodeGen/RISCV/rvv-intrinsics-handcrafted/vlenb.c` hasn't been updated.
show more ...
|
#
28bd84f5 |
| 01-Feb-2023 |
AdityaK <1894981+hiraditya@users.noreply.github.com> |
[RISCV] Allow mismatched SmallDataLimit and use Min for conflicting values
Authored By: joshua-arch1 (Jun Sha) Reviewed By: shiva0217, apazos, luismarques, asb, jrtc27, MaskRay Reviewers: MaskRay, j
[RISCV] Allow mismatched SmallDataLimit and use Min for conflicting values
Authored By: joshua-arch1 (Jun Sha) Reviewed By: shiva0217, apazos, luismarques, asb, jrtc27, MaskRay Reviewers: MaskRay, jrtc27
Differential Revision: https://reviews.llvm.org/D131230
This patch is to fix an issue about module linking with LTO.
When compiling with PIE, the small data limitation needs to be consistent with that in PIC, otherwise there will be linking errors due to conflicting values.
bar.c
int bar() { return 1; } foo.c
int foo() { return 1; } clang --target=riscv64-unknown-linux-gnu -flto -c foo.c -o foo.o -fPIE clang --target=riscv64-unknown-linux-gnu -flto -c bar.c -o bar.o -fPIC
clang --target=riscv64-unknown-linux-gnu -flto foo.o bar.o -flto -nostdlib -v -fuse-ld=lld ld.lld: error: linking module flags 'SmallDataLimit': IDs have conflicting values in 'bar.o' and 'ld-temp.o' clang-15: error: linker command failed with exit code 1 (use -v to see invocation) What we are trying to do here is to use Min instead of Error for conflicting SmallDataLimit when combining -fno-PIC code with -fPIC code.
Signed-off-by: xiaojing.zhang <xiaojing.zhang@xcalibyte.com> Signed-off-by: jianxin.lai <jianxin.lai@xcalibyte.com>
show more ...
|
#
b88ebb3d |
| 02-Feb-2023 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
Revert "Add CFI integer types normalization"
This reverts commit b1e9ab7438a098a18fecda88fc87ef4ccadfcf1e.
Reason: Looks like it broke the MSan buildbot, more details in the phabricator review: htt
Revert "Add CFI integer types normalization"
This reverts commit b1e9ab7438a098a18fecda88fc87ef4ccadfcf1e.
Reason: Looks like it broke the MSan buildbot, more details in the phabricator review: https://reviews.llvm.org/D139395
show more ...
|
#
b1e9ab74 |
| 01-Feb-2023 |
Ramon de C Valle <rcvalle@users.noreply.github.com> |
Add CFI integer types normalization
This commit adds a new option (i.e., `-fsanitize-cfi-icall-normalize-integers`) for normalizing integer types as vendor extended types for cross-language LLVM CFI
Add CFI integer types normalization
This commit adds a new option (i.e., `-fsanitize-cfi-icall-normalize-integers`) for normalizing integer types as vendor extended types for cross-language LLVM CFI/KCFI support with other languages that can't represent and encode C/C++ integer types.
Specifically, integer types are encoded as their defined representations (e.g., 8-bit signed integer, 16-bit signed integer, 32-bit signed integer, ...) for compatibility with languages that define explicitly-sized integer types (e.g., i8, i16, i32, ..., in Rust).
``-fsanitize-cfi-icall-normalize-integers`` is compatible with ``-fsanitize-cfi-icall-generalize-pointers``.
This helps with providing cross-language CFI support with the Rust compiler and is an alternative solution for the issue described and alternatives proposed in the RFC https://github.com/rust-lang/rfcs/pull/3296.
For more information about LLVM CFI/KCFI and cross-language LLVM CFI/KCFI support for the Rust compiler, see the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653.
Reviewed By: pcc, samitolvanen
Differential Revision: https://reviews.llvm.org/D139395
show more ...
|
#
516e3017 |
| 01-Feb-2023 |
Steven Wu <stevenwu@apple.com> |
[NFC][Profile] Access profile through VirtualFileSystem
Make the access to profile data going through virtual file system so the inputs can be remapped. In the context of the caching, it can make su
[NFC][Profile] Access profile through VirtualFileSystem
Make the access to profile data going through virtual file system so the inputs can be remapped. In the context of the caching, it can make sure we capture the inputs and provided an immutable input as profile data.
Reviewed By: akyrtzi, benlangmuir
Differential Revision: https://reviews.llvm.org/D139052
show more ...
|
#
cd61d2ab |
| 25-Jan-2023 |
Michael Liao <michael.hliao@gmail.com> |
[clang][CodeGen][NFC] Fix `llvm-else-after-return`
|
#
6ad0788c |
| 14-Jan-2023 |
Kazu Hirata <kazu@google.com> |
[clang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h".
This is p
[clang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h".
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
a1580d7b |
| 14-Jan-2023 |
Kazu Hirata <kazu@google.com> |
[clang] Add #include <optional> (NFC)
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>.
I'll post a separate patch to actually replace llvm::Option
[clang] Add #include <optional> (NFC)
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>.
I'll post a separate patch to actually replace llvm::Optional with std::optional.
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
bf5c17ed |
| 13-Jan-2023 |
Guillaume Chatelet <gchatelet@google.com> |
[clang][NFC] Remove dependency on DataLayout::getPrefTypeAlignment
|
#
fd5e2627 |
| 11-Jan-2023 |
Sami Tolvanen <samitolvanen@google.com> |
[ModuleUtils][KCFI] Set patchable-function-prefix for synthesized functions
When -fpatchable-function-entry is used to emit prefix nops before functions, KCFI assumes all indirectly called functions
[ModuleUtils][KCFI] Set patchable-function-prefix for synthesized functions
When -fpatchable-function-entry is used to emit prefix nops before functions, KCFI assumes all indirectly called functions have the same number of prefix nops, because the nops are emitted between the KCFI type hash and the function entry. However, as patchable-function-prefix is a function attribute set by Clang, functions later synthesized by LLVM don't inherit this attribute and end up not having prefix nops. One of these functions is asan.module_ctor, which the Linux kernel ends up calling indirectly when KASAN is enabled.
In order to avoid tripping KCFI, save the expected prefix offset to a module flag, and use it when we're setting KCFI type for the relevant synthesized functions.
Link: https://github.com/ClangBuiltLinux/linux/issues/1742
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D141172
show more ...
|
#
a3c248db |
| 06-Jan-2023 |
serge-sans-paille <sguelton@mozilla.com> |
Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part
This is a follow-up to https://reviews.llvm.org/D140896, split into several parts as it touches a lot of files.
Differential
Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part
This is a follow-up to https://reviews.llvm.org/D140896, split into several parts as it touches a lot of files.
Differential Revision: https://reviews.llvm.org/D141139
show more ...
|
#
08f95780 |
| 09-Jan-2023 |
Chuanqi Xu <yedeng.yd@linux.alibaba.com> |
[C++20] [Modules] Don't generate global ctors/dtors for variables which are available externally
Closes https://github.com/llvm/llvm-project/issues/59765.
Currently we will generate the global ctor
[C++20] [Modules] Don't generate global ctors/dtors for variables which are available externally
Closes https://github.com/llvm/llvm-project/issues/59765.
Currently we will generate the global ctor/dtor for variables in importing modules. It will cause multiple initialization/destructions. It makes no sense. This patch tries to not generate global ctor/dtor for variables which are available externally. Note that the variables in header units and clang modules won't be available externally by default.
Reviewed By: iains
Differential Revision: https://reviews.llvm.org/D140867
show more ...
|
#
fe5cf480 |
| 21-Dec-2022 |
Pavel Iliin <Pavel.Iliin@arm.com> |
Reland "[AArch64] FMV support and necessary target features dependencies."
This relands commits e43924a75145d2f9e722f74b673145c3e62bfd07, a43f36142c501e2d3f4797ef938db4e0c5e0eeec, bf94eac6a3f7c5cd89
Reland "[AArch64] FMV support and necessary target features dependencies."
This relands commits e43924a75145d2f9e722f74b673145c3e62bfd07, a43f36142c501e2d3f4797ef938db4e0c5e0eeec, bf94eac6a3f7c5cd8941956d44c15524fa3751bd with MSan buildbot https://lab.llvm.org/buildbot/#/builders/5/builds/30139 use-of-uninitialized-value errors fixed.
Differential Revision: https://reviews.llvm.org/D127812
show more ...
|
#
69243cdb |
| 22-Dec-2022 |
Fangrui Song <i@maskray.me> |
Remove incorrectly implemented -mibt-seal
The option from D116070 does not work as intended and will not be needed when hidden visibility is used. A function needs ENDBR if it may be reached indirec
Remove incorrectly implemented -mibt-seal
The option from D116070 does not work as intended and will not be needed when hidden visibility is used. A function needs ENDBR if it may be reached indirectly. If we make ThinLTO combine the address-taken property (close to `!GV.use_empty() && !GV.hasAtLeastLocalUnnamedAddr()`), then the condition can be expressed with:
`AddressTaken || (!F.hasLocalLinkage() && (VisibleToRegularObj || !F.hasHiddenVisibility()))`
The current `F.hasAddressTaken()` condition does not take into acount of address-significance in another bitcode file or ELF relocatable file.
For the Linux kernel, it uses relocatable linking. lld/ELF uses a conservative approach by setting all `VisibleToRegularObj` to true. Using the non-relocatable semantics may under-estimate `VisibleToRegularObj`. As @pcc mentioned on https://github.com/ClangBuiltLinux/linux/issues/1737#issuecomment-1343414686 , we probably need a symbol list to supply additional `VisibleToRegularObj` symbols (not part of the relocatable LTO link).
Reviewed By: samitolvanen
Differential Revision: https://reviews.llvm.org/D140363
show more ...
|
#
2bb59549 |
| 21-Dec-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
clang: Respect function address space for __builtin_function_start
Fixes assertion.
|
#
71912323 |
| 21-Dec-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
clang: Fix another assert from not respecting function address spaces
|
#
947905a1 |
| 21-Dec-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
clang: Use correct address space for redeclared functions
Fixes assert/verifier error with AVR.
|
#
744486ec |
| 21-Dec-2022 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
Revert "[AArch64] FMV support and necessary target features dependencies."
This reverts commit e43924a75145d2f9e722f74b673145c3e62bfd07.
Reason: Patch broke the MSan buildbots. More information is
Revert "[AArch64] FMV support and necessary target features dependencies."
This reverts commit e43924a75145d2f9e722f74b673145c3e62bfd07.
Reason: Patch broke the MSan buildbots. More information is available on the original phabricator review: https://reviews.llvm.org/D127812
show more ...
|
#
e43924a7 |
| 15-Dec-2021 |
Pavel Iliin <Pavel.Iliin@arm.com> |
[AArch64] FMV support and necessary target features dependencies.
This is Function Multi Versioning (FMV) implementation for AArch64 target in accordance with Beta Arm C Language Extensions specific
[AArch64] FMV support and necessary target features dependencies.
This is Function Multi Versioning (FMV) implementation for AArch64 target in accordance with Beta Arm C Language Extensions specification https://github.com/ARM-software/acle/blob/main/main/acle.md#function-multi-versioning It supports new "target_version" function attribute and extends existing "target_clones" one. Also missing dependencies for target features were added.
Differential Revision: https://reviews.llvm.org/D127812
show more ...
|