#
db1cec37 |
| 29-Apr-2022 |
Joao Moreira <joao.moreira@intel.com> |
[X86] Fix CodeGen Module Flag for -mibt-seal
When assertions are enabled, clang will perform RoundTrip for CompilerInvocation argument generation. ibt-seal flags are currently missing in this argume
[X86] Fix CodeGen Module Flag for -mibt-seal
When assertions are enabled, clang will perform RoundTrip for CompilerInvocation argument generation. ibt-seal flags are currently missing in this argument generation, and because of that, the feature doesn't get enabled for these cases. Performing RoundTrip is the default for assert builds, rendering the feature broken in these scenarios.
This patch fixes this and adds a test to properly verify that modules are being generated with the flag when -mibt-seal is used.
Please, add any known relevant reviewer which I may have missed.
[1] - https://reviews.llvm.org/D116070
Reviewed By: pengfei, gftg, aaron.ballman, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D118052
show more ...
|
Revision tags: llvmorg-14.0.1 |
|
#
bac6cd5b |
| 01-Apr-2022 |
Paul Kirth <paulkirth@google.com> |
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch weights are populated depending on the profiling method used, and emit the correct diagnostics. If these invariants are ever invalidated, the MisExpect related checks would need to be updated, potentially by re-introducing MD_misexpect metadata, and ensuring it always will be transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by introducing a new CodeGen option, and checking if the -Wmisexpect flag has been passed on the command line.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D115907
show more ...
|
#
2978d026 |
| 11-Apr-2022 |
Nikita Popov <npopov@redhat.com> |
[Clang] Remove support for legacy pass manager
This removes the -flegacy-pass-manager and -fno-experimental-new-pass-manager options, and the corresponding support code in BackendUtil. The -fno-lega
[Clang] Remove support for legacy pass manager
This removes the -flegacy-pass-manager and -fno-experimental-new-pass-manager options, and the corresponding support code in BackendUtil. The -fno-legacy-pass-manager and -fexperimental-new-pass-manager options are retained as no-ops.
Differential Revision: https://reviews.llvm.org/D123609
show more ...
|
#
93471e65 |
| 08-Apr-2022 |
Haojian Wu <hokein.wu@gmail.com> |
[clang] NFC, move CompilerInvocation::setLangDefaults to LangOptions.h
The function is moved from clangFrontend to clangBasic, which allows tools (e.g. clang pseudoparser) which don't depend on clan
[clang] NFC, move CompilerInvocation::setLangDefaults to LangOptions.h
The function is moved from clangFrontend to clangBasic, which allows tools (e.g. clang pseudoparser) which don't depend on clangFrontend to use.
Differential Revision: https://reviews.llvm.org/D121375
show more ...
|
#
30b1c1f2 |
| 10-Apr-2022 |
Fangrui Song <i@maskray.me> |
[Driver] Simplify -f[no-]diagnostics-color handling. NFC
Make them aliases for -f[no-]color-diagnostics.
|
#
d74039fa |
| 10-Apr-2022 |
Fangrui Song <i@maskray.me> |
[Frontend] Simplify -finline* handling. NFC
|
#
7aa8c38a |
| 09-Apr-2022 |
Connor Kuehl <cipkuehl@gmail.com> |
[randstruct] Add randomize structure layout support
The Randstruct feature is a compile-time hardening technique that randomizes the field layout for designated structures of a code base. Admittedly
[randstruct] Add randomize structure layout support
The Randstruct feature is a compile-time hardening technique that randomizes the field layout for designated structures of a code base. Admittedly, this is mostly useful for closed-source releases of code, since the randomization seed would need to be available for public and open source applications.
Why implement it? This patch set enhances Clang’s feature parity with that of GCC which already has the Randstruct feature. It's used by the Linux kernel in certain structures to help thwart attacks that depend on structure layouts in memory.
This patch set is a from-scratch reimplementation of the Randstruct feature that was originally ported to GCC. The patches for the GCC implementation can be found here:
https://www.openwall.com/lists/kernel-hardening/2017/04/06/14
Link: https://lists.llvm.org/pipermail/cfe-dev/2019-March/061607.html Co-authored-by: Cole Nixon <nixontcole@gmail.com> Co-authored-by: Connor Kuehl <cipkuehl@gmail.com> Co-authored-by: James Foster <jafosterja@gmail.com> Co-authored-by: Jeff Takahashi <jeffrey.takahashi@gmail.com> Co-authored-by: Jordan Cantrell <jordan.cantrell@mail.com> Co-authored-by: Nikk Forbus <nicholas.forbus@gmail.com> Co-authored-by: Tim Pugh <nwtpugh@gmail.com> Co-authored-by: Bill Wendling <isanbard@gmail.com> Signed-off-by: Bill Wendling <isanbard@gmail.com>
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D121556
show more ...
|
#
a58d0af0 |
| 09-Apr-2022 |
Fangrui Song <i@maskray.me> |
Revert D121556 "[randstruct] Add randomize structure layout support"
This reverts commit 3f0587d0c668202bb89d29a25432aa290e551a31.
Not all tests pass after a few rounds of fixes.
I spot one failur
Revert D121556 "[randstruct] Add randomize structure layout support"
This reverts commit 3f0587d0c668202bb89d29a25432aa290e551a31.
Not all tests pass after a few rounds of fixes.
I spot one failure that std::shuffle (potentially different results with different STL implementations) was misused and replaced it with llvm::shuffle, but there appears to be another failure in a Windows build.
The latest failure is reported on https://reviews.llvm.org/D121556#3440383
show more ...
|
#
3f0587d0 |
| 08-Apr-2022 |
Connor Kuehl <cipkuehl@gmail.com> |
[randstruct] Add randomize structure layout support
The Randstruct feature is a compile-time hardening technique that randomizes the field layout for designated structures of a code base. Admittedly
[randstruct] Add randomize structure layout support
The Randstruct feature is a compile-time hardening technique that randomizes the field layout for designated structures of a code base. Admittedly, this is mostly useful for closed-source releases of code, since the randomization seed would need to be available for public and open source applications.
Why implement it? This patch set enhances Clang’s feature parity with that of GCC which already has the Randstruct feature. It's used by the Linux kernel in certain structures to help thwart attacks that depend on structure layouts in memory.
This patch set is a from-scratch reimplementation of the Randstruct feature that was originally ported to GCC. The patches for the GCC implementation can be found here:
https://www.openwall.com/lists/kernel-hardening/2017/04/06/14
Link: https://lists.llvm.org/pipermail/cfe-dev/2019-March/061607.html Co-authored-by: Cole Nixon <nixontcole@gmail.com> Co-authored-by: Connor Kuehl <cipkuehl@gmail.com> Co-authored-by: James Foster <jafosterja@gmail.com> Co-authored-by: Jeff Takahashi <jeffrey.takahashi@gmail.com> Co-authored-by: Jordan Cantrell <jordan.cantrell@mail.com> Co-authored-by: Nikk Forbus <nicholas.forbus@gmail.com> Co-authored-by: Tim Pugh <nwtpugh@gmail.com> Co-authored-by: Bill Wendling <isanbard@gmail.com> Signed-off-by: Bill Wendling <isanbard@gmail.com>
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D121556
show more ...
|
#
be937165 |
| 08-Apr-2022 |
Aaron Ballman <aaron@aaronballman.com> |
Clarify language option default value behavior; NFC
The LANGOPT macro allows you to specify a default value for the langauge option. However, it's expected that these values be constant rather than
Clarify language option default value behavior; NFC
The LANGOPT macro allows you to specify a default value for the langauge option. However, it's expected that these values be constant rather than depending on other language options (because the constructor setting the default values does not know the language mode at the time it's being constructed).
Some of our language options were abusing this and passing in other language mode options which were then set correctly by other parts of frontend initialization. This removes the default values for the language options, and then ensures they're consistently set from the same place when setting language standard defaults.
show more ...
|
#
15a17696 |
| 04-Apr-2022 |
Shangwu Yao <shangwuyao@gmail.com> |
Emit OpenCL metadata when targeting SPIR-V
This is required for converting function calls such as get_global_id() into SPIR-V builtins.
Differential Revision: https://reviews.llvm.org/D123049
|
#
4d165ad7 |
| 03-Apr-2022 |
Zahira Ammarguellat <zahira.ammarguellat@intel.com> |
In fast-math mode, when unsafe math optimizations are enabled, the compiler is allowed to use optimizations that allow reassociation and transformations that don’t guaranty accuracy. For example (x+y
In fast-math mode, when unsafe math optimizations are enabled, the compiler is allowed to use optimizations that allow reassociation and transformations that don’t guaranty accuracy. For example (x+y)+z is transformed into x+(y+z) . Although mathematically equivalent, these two expressions may not lead to the same final result due to errors of summation. Or x/x is transformed into 1.0 but x could be 0.0, INF or NaN. And so this transformation also may not lead to the same final result. Setting the eval method 'ffp-eval-method' or via '#pragma clang fp eval_method' in this mode, doesn’t have any effect. This patch adds code to warn the user of this.
Differential Revision: https://reviews.llvm.org/D122155
show more ...
|
#
fc7573f2 |
| 31-Mar-2022 |
Jorge Gorbe Moya <jgorbe@google.com> |
Revert "[misexpect] Re-implement MisExpect Diagnostics"
This reverts commit 46774df307159444d65083c2fd82f8574f0ab1d9.
|
#
46774df3 |
| 29-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch weights are populated depending on the profiling method used, and emit the correct diagnostics. If these invariants are ever invalidated, the MisExpect related checks would need to be updated, potentially by re-introducing MD_misexpect metadata, and ensuring it always will be transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by introducing a new CodeGen option, and checking if the -Wmisexpect flag has been passed on the command line.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D115907
show more ...
|
#
90cb325a |
| 29-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
Revert "[misexpect] Re-implement MisExpect Diagnostics"
This reverts commit 2add3fbd976d7b80a3a7fc14ef0deb9b1ca6beee.
|
#
2add3fbd |
| 19-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch weights are populated depending on the profiling method used, and emit the correct diagnostics. If these invariants are ever invalidated, the MisExpect related checks would need to be updated, potentially by re-introducing MD_misexpect metadata, and ensuring it always will be transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by introducing a new CodeGen option, and checking if the -Wmisexpect flag has been passed on the command line.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D115907
show more ...
|
#
d394f9f8 |
| 28-Mar-2022 |
Chris Bieneman <chris.bieneman@me.com> |
Add HLSL Language Option and Preprocessor
Bringing in HLSL as a language as well as language options for each of the HLSL language standards.
While the HLSL language is unimplemented, this patch ad
Add HLSL Language Option and Preprocessor
Bringing in HLSL as a language as well as language options for each of the HLSL language standards.
While the HLSL language is unimplemented, this patch adds the HLSL-specific preprocessor defines which enables testing of the command line options through the driver.
Reviewed By: pete, rnk
Differential Revision: https://reviews.llvm.org/D122087
show more ...
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2 |
|
#
85b13540 |
| 31-Jul-2020 |
Iain Sandoe <iain@sandoe.co.uk> |
[C++20][Modules][HU 5/5] Add fdirectives-only mode for preprocessing output.
When the -fdirectives-only option is used together with -E, the preprocessor output reflects evaluation of if/then/else d
[C++20][Modules][HU 5/5] Add fdirectives-only mode for preprocessing output.
When the -fdirectives-only option is used together with -E, the preprocessor output reflects evaluation of if/then/else directives.
As such, it preserves defines and undefs of macros that are still live after such processing. The intent is that this output could be consumed as input to generate considered a C++20 header unit.
We strip out any (unused) defines that come from built-in, built-in-file or command line; these are re-added when the preprocessed source is consumed.
Differential Revision: https://reviews.llvm.org/D121099
show more ...
|
#
06875787 |
| 10-Jan-2021 |
Iain Sandoe <iain@sandoe.co.uk> |
[C++20][Modules][HU 2/5] Support searching Header Units in user or system search paths.
This is support for the user-facing options to create importable header units from headers in the user or syst
[C++20][Modules][HU 2/5] Support searching Header Units in user or system search paths.
This is support for the user-facing options to create importable header units from headers in the user or system search paths (or to be given an absolute path).
This means that an incomplete header path will be passed by the driver and the lookup carried out using the search paths present when the front end is run.
To support this, we introduce file fypes for c++-{user,system,header-unit}-header. These terms are the same as the ones used by GCC, to minimise the differences for tooling (and users).
The preprocessor checks for headers before issuing a warning for "#pragma once" in a header build. We ensure that the importable header units are recognised as headers in order to avoid such warnings.
Differential Revision: https://reviews.llvm.org/D121096
show more ...
|
#
c37accf0 |
| 26-Mar-2022 |
Fangrui Song <i@maskray.me> |
[Option] Avoid using the default argument for the 3-argument hasFlag. NFC
The default argument true is error-prone: I think many would think the default is false.
|
#
6c0e60e8 |
| 20-Sep-2020 |
Iain Sandoe <iain@sandoe.co.uk> |
[C++20][Modules][HU 1/5] Introduce header units as a module type.
This is the first in a series of patches that introduce C++20 importable header units.
These differ from clang header modules in th
[C++20][Modules][HU 1/5] Introduce header units as a module type.
This is the first in a series of patches that introduce C++20 importable header units.
These differ from clang header modules in that: (a) they are identifiable by an internal name (b) they represent the top level source for a single header - although that might include or import other headers.
We name importable header units with the path by which they are specified (although that need not be the absolute path for the file).
So "foo/bar.h" would have a name "foo/bar.h". Header units are made a separate module type so that we can deal with diagnosing places where they are permitted but a named module is not.
Differential Revision: https://reviews.llvm.org/D121095
show more ...
|
#
964398cc |
| 18-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
Revert "Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics"""
This reverts commit 6cf560d69a222bff4af4e1d092437fd77f0f981c.
|
#
6cf560d6 |
| 18-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics""
I mistakenly reverted my commit, so I'm relanding it.
This reverts commit 10866a1df4a82cdc54187330c509a2d46235455d.
|
#
10866a1d |
| 17-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
Revert "[misexpect] Re-implement MisExpect Diagnostics"
This reverts commit e7749d4713a5ec886011ceb0fc821c6723061724.
|
#
e7749d47 |
| 09-Mar-2022 |
Paul Kirth <paulkirth@google.com> |
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its original checking methodology only using MD_prof branch_weights metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch weights are populated depending on the profiling method used, and emit the correct diagnostics. If these invariants are ever invalidated, the MisExpect related checks would need to be updated, potentially by re-introducing MD_misexpect metadata, and ensuring it always will be transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by introducing a new CodeGen option, and checking if the -Wmisexpect flag has been passed on the command line.
Differential Revision: https://reviews.llvm.org/D115907
show more ...
|