#
cac06860 |
| 04-Mar-2020 |
hsmahesha <mahesha.comp@gmail.com> |
[HIP] Make sure, unused hip-pinned-shadow global var is kept within device code
Summary: hip-pinned-shadow global var should remain in the final code object irrespective of whether it is used or not
[HIP] Make sure, unused hip-pinned-shadow global var is kept within device code
Summary: hip-pinned-shadow global var should remain in the final code object irrespective of whether it is used or not within the code. Add it to used list, so that it will not get eliminated when it is unused.
Reviewers: yaxunl, tra, hliao
Reviewed By: yaxunl
Subscribers: hliao, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75402
show more ...
|
#
00072c08 |
| 25-Nov-2019 |
Dan Gohman <sunfish@mozilla.com> |
[WebAssembly] Mangle the argc/argv `main` as `__wasm_argc_argv`.
WebAssembly enforces a rule that caller and callee signatures must match. This means that the traditional technique of passing `main`
[WebAssembly] Mangle the argc/argv `main` as `__wasm_argc_argv`.
WebAssembly enforces a rule that caller and callee signatures must match. This means that the traditional technique of passing `main` `argc` and `argv` even when it doesn't need them doesn't work.
Currently the backend renames `main` to `__original_main`, however this doesn't interact well with LTO'ing libc, and the name isn't intuitive. This patch allows us to transition to `__main_argc_argv` instead.
This implements the proposal in https://github.com/WebAssembly/tool-conventions/pull/134 with a flag to disable it when targeting Emscripten, though this is expected to be temporary, as discussed in the proposal comments.
Differential Revision: https://reviews.llvm.org/D70700
show more ...
|
#
3dd5a298 |
| 25-Feb-2020 |
Roman Lebedev <lebedev.ri@gmail.com> |
[clang] Annotating C++'s `operator new` with more attributes
Summary: Right now we annotate C++'s `operator new` with `noalias` attribute, which very much is healthy for optimizations.
However as p
[clang] Annotating C++'s `operator new` with more attributes
Summary: Right now we annotate C++'s `operator new` with `noalias` attribute, which very much is healthy for optimizations.
However as per [[ http://eel.is/c++draft/basic.stc.dynamic.allocation | `[basic.stc.dynamic.allocation]` ]], there are more promises on global `operator new`, namely: * non-`std::nothrow_t` `operator new` *never* returns `nullptr` * If `std::align_val_t align` parameter is taken, the pointer will also be `align`-aligned * ~~global `operator new`-returned pointer is `__STDCPP_DEFAULT_NEW_ALIGNMENT__`-aligned ~~ It's more caveated than that.
Supplying this information may not cause immediate landslide effects on any specific benchmarks, but it for sure will be healthy for optimizer in the sense that the IR will better reflect the guarantees provided in the source code.
The caveat is `-fno-assume-sane-operator-new`, which currently prevents emitting `noalias` attribute, and is automatically passed by Sanitizers ([[ https://bugs.llvm.org/show_bug.cgi?id=16386 | PR16386 ]]) - should it also cover these attributes? The problem is that the flag is back-end-specific, as seen in `test/Modules/explicit-build-flags.cpp`. But while it is okay to add `noalias` metadata in backend, we really should be adding at least the alignment metadata to the AST, since that allows us to perform sema checks on it.
Reviewers: erichkeane, rjmccall, jdoerfert, eugenis, rsmith
Reviewed By: rsmith
Subscribers: xbolva00, jrtc27, atanasyan, nlopes, cfe-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D73380
show more ...
|
#
8bee52bd |
| 24-Feb-2020 |
Xiangling Liao <Xiangling.Liao@ibm.com> |
[AIX][Frontend] C++ ABI customizations for AIX boilerplate
This PR enables "XL" C++ ABI in frontend AST to IR codegen. And it is driven by static init work. The current kind in Clang by default is G
[AIX][Frontend] C++ ABI customizations for AIX boilerplate
This PR enables "XL" C++ ABI in frontend AST to IR codegen. And it is driven by static init work. The current kind in Clang by default is Generic Itanium, which has different behavior on static init with IBM xlclang compiler on AIX.
Differential Revision: https://reviews.llvm.org/D74015
show more ...
|
#
e67cbac8 |
| 09-Sep-2019 |
serge_sans_paille <sguelton@redhat.com> |
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynami
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic allocation to make sure the page guard, if any, is touched when touching the stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'. Technically the former uses function call before stack allocation while this patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt [1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
This a recommit of 39f50da2a357a8f685b3540246c5d762734e035f with proper LiveIn declaration, better option handling and more portable testing.
Differential Revision: https://reviews.llvm.org/D68720
show more ...
|
#
45462116 |
| 09-Feb-2020 |
serge-sans-paille <sguelton@redhat.com> |
Revert "Support -fstack-clash-protection for x86"
This reverts commit 0fd51a4554f5f4f90342f40afd35b077f6d88213.
Failures:
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/4354
|
#
0fd51a45 |
| 09-Sep-2019 |
serge_sans_paille <sguelton@redhat.com> |
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynami
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic allocation to make sure the page guard, if any, is touched when touching the stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'. Technically the former uses function call before stack allocation while this patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt [1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
This a recommit of 39f50da2a357a8f685b3540246c5d762734e035f with proper LiveIn declaration, better option handling and more portable testing.
Differential Revision: https://reviews.llvm.org/D68720
show more ...
|
#
658495e6 |
| 08-Feb-2020 |
serge-sans-paille <sguelton@redhat.com> |
Revert "Support -fstack-clash-protection for x86"
This reverts commit e229017732bcf1911210903ee9811033d5588e0d.
Failures:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debia
Revert "Support -fstack-clash-protection for x86"
This reverts commit e229017732bcf1911210903ee9811033d5588e0d.
Failures:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/2604 http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/4308
show more ...
|
#
e2290177 |
| 09-Sep-2019 |
serge_sans_paille <sguelton@redhat.com> |
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynami
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic allocation to make sure the page guard, if any, is touched when touching the stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'. Technically the former uses function call before stack allocation while this patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt [1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
This a recommit of 39f50da2a357a8f685b3540246c5d762734e035f with better option handling and more portable testing
Differential Revision: https://reviews.llvm.org/D68720
show more ...
|
#
b03c3d8c |
| 07-Feb-2020 |
Nico Weber <thakis@chromium.org> |
Revert "Support -fstack-clash-protection for x86"
This reverts commit 4a1a0690ad6813a4c8cdb8dc20ea6337aa1f61e0. Breaks tests on mac and win, see https://reviews.llvm.org/D68720
|
#
4a1a0690 |
| 09-Sep-2019 |
serge_sans_paille <sguelton@redhat.com> |
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynami
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic allocation to make sure the page guard, if any, is touched when touching the stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'. Technically the former uses function call before stack allocation while this patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt [1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
This a recommit of 39f50da2a357a8f685b3540246c5d762734e035f with correct option flags set.
Differential Revision: https://reviews.llvm.org/D68720
show more ...
|
#
f6d98429 |
| 07-Feb-2020 |
serge-sans-paille <sguelton@redhat.com> |
Revert "Support -fstack-clash-protection for x86"
This reverts commit 39f50da2a357a8f685b3540246c5d762734e035f.
The -fstack-clash-protection is being passed to the linker too, which is not intended
Revert "Support -fstack-clash-protection for x86"
This reverts commit 39f50da2a357a8f685b3540246c5d762734e035f.
The -fstack-clash-protection is being passed to the linker too, which is not intended.
Reverting and fixing that in a later commit.
show more ...
|
#
39f50da2 |
| 09-Sep-2019 |
serge_sans_paille <sguelton@redhat.com> |
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynami
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic allocation to make sure the page guard, if any, is touched when touching the stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'. Technically the former uses function call before stack allocation while this patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt [1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
Differential Revision: https://reviews.llvm.org/D68720
show more ...
|
#
a3c814d2 |
| 07-Nov-2019 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Separately track input and output denormal mode
AMDGPU and x86 at least both have separate controls for whether denormal results are flushed on output, and for whether denormals are implicitly treat
Separately track input and output denormal mode
AMDGPU and x86 at least both have separate controls for whether denormal results are flushed on output, and for whether denormals are implicitly treated as 0 as an input. The current DAGCombiner use only really cares about the input treatment of denormals.
show more ...
|
#
dbc96b51 |
| 03-Feb-2020 |
Fangrui Song <maskray@google.com> |
Revert "[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition"
This reverts commit 789a46f2d742e11edaade28cb59a0f4d2a1d770e.
Accidentally committed.
|
#
789a46f2 |
| 02-Feb-2020 |
Fangrui Song <maskray@google.com> |
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary: Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults to -fsemantic-interposition). Users need to sp
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary: Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults to -fsemantic-interposition). Users need to specify -fsemantic-interposition to get semantic interposition behavior.
Semantic interposition is currently a best-effort feature. There may still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
show more ...
|
#
fd09f12f |
| 16-Jan-2020 |
serge-sans-paille <sguelton@redhat.com> |
Implement -fsemantic-interposition
First attempt at implementing -fsemantic-interposition.
Rely on GlobalValue::isInterposable that already captures most of the expected behavior.
Rely on a Module
Implement -fsemantic-interposition
First attempt at implementing -fsemantic-interposition.
Rely on GlobalValue::isInterposable that already captures most of the expected behavior.
Rely on a ModuleFlag to state whether we should respect SemanticInterposition or not. The default remains no.
So this should be a no-op if -fsemantic-interposition isn't used, and if it is, isInterposable being already used in most optimisation, they should honor it properly.
Note that it only impacts architecture compiled with -fPIC and no pie.
Differential Revision: https://reviews.llvm.org/D72829
show more ...
|
#
adcd0268 |
| 28-Jan-2020 |
Benjamin Kramer <benny.kra@googlemail.com> |
Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here.
This is mostly m
Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here.
This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies.
This doesn't actually modify StringRef yet, I'll do that in a follow-up.
show more ...
|
#
458676db |
| 26-Dec-2019 |
Teresa Johnson <tejohnson@google.com> |
[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 <zakk.chen@sifive.com> |
[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 <Matthew.Arsenault@amd.com> |
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 <sguelton@redhat.com> |
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 <a.bataev@hotmail.com> |
[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 <llvm-dev@redking.me.uk> |
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 <akhuang@google.com> |
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 ...
|