Commit Graph

39 Commits

Author SHA1 Message Date
Tri Vo ca6d65812f [AArch64] Support reserving x1-7 registers.
Summary: Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7.

Reviewers: javed.absar, efriedma, nickdesaulniers, srhines, phosek

Reviewed By: nickdesaulniers

Subscribers: manojgupta, jfb, cfe-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D48581

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342100 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 23:45:04 +00:00
Vedant Kumar d95e5231fa [docs] Regenerate ClangCommandLineReference.rst
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340559 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 17:55:03 +00:00
Fangrui Song b89b5e148b [docs] Correct -fvisibility-inlines-hidden description
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337505 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-19 22:45:41 +00:00
Manoj Gupta cdd3c71916 [clang]: Add support for "-fno-delete-null-pointer-checks"
Summary:
Support for this option is needed for building Linux kernel.
This is a very frequently requested feature by kernel developers.

More details : https://lkml.org/lkml/2018/4/4/601

GCC option description for -fdelete-null-pointer-checks:
This Assume that programs cannot safely dereference null pointers,
and that no code or data element resides at address zero.

-fno-delete-null-pointer-checks is the inverse of this implying that
null pointer dereferencing is not undefined.

This feature is implemented in as the function attribute
"null-pointer-is-valid"="true".
This CL only adds the attribute on the function.
It also strips "nonnull" attributes from function arguments but
keeps the related warnings unchanged.

Corresponding LLVM change rL336613 already updated the
optimizations to not treat null pointer dereferencing
as undefined if the attribute is present.

Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv

Reviewed By: jyknight

Subscribers: drinkcat, xbolva00, cfe-commits

Differential Revision: https://reviews.llvm.org/D47894

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337433 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-19 00:44:52 +00:00
Piotr Padlewski 1452597f76 Add -fforce-emit-vtables
Summary:
 In many cases we can't devirtualize
 because definition of vtable is not present. Most of the
 time it is caused by inline virtual function not beeing
 emitted. Forcing emitting of vtable adds a reference of these
 inline virtual functions.
 Note that GCC was always doing it.

Reviewers: rjmccall, rsmith, amharc, kuhar

Subscribers: llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D47108

Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-13 13:55:42 +00:00
Petr Hosek c186f2243d [AArch64] Support reserving x20 register
Register x20 is a callee-saved register which may be used for other
purposes in certain contexts, for example to hold special variables
within the kernel. This change adds support for reserving this register
both to frontend and backend to make this register usable for these
purposes.

Differential Revision: https://reviews.llvm.org/D46552

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334531 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 20:00:50 +00:00
Alexander Ivchenko 4fb03d7680 This patch aims to match the changes introduced
in gcc by https://gcc.gnu.org/ml/gcc-cvs/2018-04/msg00534.html.
The -mibt feature flag is being removed, and the -fcf-protection
option now also defines a CET macro and causes errors when used
on non-X86 targets, while X86 targets no longer check for -mibt
and -mshstk to determine if -fcf-protection is supported. -mshstk
is now used only to determine availability of shadow stack intrinsics.

Comes with an LLVM patch (D46882).

Patch by mike.dvoretsky

Differential Revision: https://reviews.llvm.org/D46881



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332704 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 11:56:21 +00:00
Gabor Buella b7af214275 [X86] directstore and movdir64b intrinsics
Reviewers: spatel, craig.topper, RKSimon

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D45984


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331249 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 10:05:42 +00:00
Craig Topper 33f699d233 [Docs] Regenerate command line documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330654 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 21:41:06 +00:00
Jonas Hahnfeld fffb8f31fd [docs] Regenerate command line reference
This will correctly sort some manually added entries which should
generally be avoided!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330430 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 13:26:03 +00:00
Gabor Buella 633f56e921 [x86] wbnoinvd intrinsic
The WBNOINVD instruction writes back all modified
cache lines in the processor’s internal cache to main memory
but does not invalidate (flush) the internal caches.

Reviewers: craig.topper, zvi, ashlykov

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D43817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329848 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 20:09:09 +00:00
Artem Belevich f0da8db07f [CUDA] Added --[no-]cuda-include-ptx=sm_XX|all option.
Currently we always include PTX into the fatbin along
with the GPU code.It about doubles the size of the GPU binary
we need to carry in the executable. These options allow control
inclusion of PTX into GPU binary.

This patch does not change the defaults, though we may consider
making no-PTX the default in the future.

Differential Revision: https://reviews.llvm.org/D45495

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329737 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-10 18:38:22 +00:00
Krzysztof Parzyszek 231f0cb215 [Hexagon] Remove -mhvx-double and the corresponding subtarget feature
Specifying the HVX vector length should be done via the -mhvx-length
option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329077 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 15:59:10 +00:00
Heejin Ahn 15cf6cba4b [WebAssembly] Add exception handling option
Summary: Add exception handling option to clang.

Reviewers: dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, cfe-commits

Differential Revision: https://reviews.llvm.org/D43681

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326517 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02 00:39:16 +00:00
Scott Linder 7fab66ed2f [DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. This vendor extension to DWARF v5 allows source text to be
embedded directly in the line tables of the debug line section.

Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates
that source should be passed through to LLVM during CodeGen.

Differential Revision: https://reviews.llvm.org/D42766


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326102 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26 17:32:31 +00:00
Hans Wennborg dddfaa1e7a Support for the mno-stack-arg-probe flag
Adds support for this flag. There is also another piece for llvm
(separate review). More info:
https://bugs.llvm.org/show_bug.cgi?id=36221

By Ruslan Nikolaev!

Differential Revision: https://reviews.llvm.org/D43108

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325901 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 13:47:36 +00:00
Jonas Hahnfeld 8599389ce5 [docs] Regenerate command line reference
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325807 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-22 17:10:28 +00:00
Craig Topper b63f818982 [Docs] Re-generate command line documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323235 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 18:40:15 +00:00
Dan Gohman d91a0b81e5 [WebAssembly] Add target flags for sign-ext opcodes.
Add -msign-ext and -mno-sign-ext to control the new sign-ext target
feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322967 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-19 17:16:32 +00:00
Craig Topper 0a1e5835c1 [Docs] Re-generate command line documentation, primarily to get the icelake feature command line options in, but there were a couple other changes too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321749 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 18:29:12 +00:00
Craig Topper ce4e832999 [Driver][CodeGen] Add -mprefer-vector-width driver option and attribute during CodeGen.
This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend.

Clang will take the value and add it as a new function attribute during CodeGen.

This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html

The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values.

Differential Revision: https://reviews.llvm.org/D40230

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 21:09:19 +00:00
Craig Topper c9d3180bac [Docs] Regenerate command line documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 21:09:16 +00:00
Martell Malone dd9e3a3239 Toolchain: Normalize dwarf, sjlj and seh eh
This is a re-apply of r319294.

adds -fseh-exceptions and -fdwarf-exceptions flags

clang will check if the user has specified an exception model flag,
in the absense of specifying the exception model clang will then check
the driver default and append the model flag for that target to cc1

-fno-exceptions has a higher priority then specifying the model

move __SEH__ macro definitions out of Targets into InitPreprocessor
behind the -fseh-exceptions flag

move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into
InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check

remove unused USESEHExceptions from the MinGW Driver

fold USESjLjExceptions into a new GetExceptionModel function that
gives the toolchain classes more flexibility with eh models

Reviewers: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D39673

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319297 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 07:25:12 +00:00
Martell Malone e9d94f5b6c Revert "Toolchain: Normalize dwarf, sjlj and seh eh"
This reverts rL319294.
The windows sanitizer does not like seh on x86.
Will re apply with None type for x86

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319295 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 06:51:27 +00:00
Martell Malone e7eb264ed0 Toolchain: Normalize dwarf, sjlj and seh eh
adds -fseh-exceptions and -fdwarf-exceptions flags

clang will check if the user has specified an exception model flag,
in the absense of specifying the exception model clang will then check
the driver default and append the model flag for that target to cc1

clang cc1 assumes dwarf is the default if none is passed
and -fno-exceptions has a higher priority then specifying the model

move __SEH__ macro definitions out of Targets into InitPreprocessor
behind the -fseh-exceptions flag

move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into
InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check

remove unused USESEHExceptions from the MinGW Driver

fold USESjLjExceptions into a new GetExceptionModel function that
gives the toolchain classes more flexibility with eh models

Reviewers: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D39673

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 06:25:13 +00:00
Craig Topper 87ef79eb3b [Docs] Regenerate the command line option reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-20 18:07:43 +00:00
Vlad Tsyrklevich 746fd88cc6 [CFI] Add CFI-icall pointer type generalization
Summary:
This change allows generalizing pointers in type signatures used for
cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag.
This works by 1) emitting an additional generalized type signature
metadata node for functions and 2) llvm.type.test()ing for the
generalized type for translation units with the flag specified.

This flag is incompatible with -fsanitize-cfi-cross-dso because it would
require emitting twice as many type hashes which would increase artifact
size.

Reviewers: pcc, eugenis

Reviewed By: pcc

Subscribers: kcc

Differential Revision: https://reviews.llvm.org/D39358

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317044 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-31 22:39:44 +00:00
Boris Kolpackov 1bf18299cc [docs] Regenerate command line options reference
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30 09:15:53 +00:00
Craig Topper 20dd3343d9 [Docs] Regenerate the command line option reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308641 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20 17:52:48 +00:00
Richard Smith 11a09b4698 [docs] Fix a couple of typos in command line flag help text and regenerate documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 22:39:49 +00:00
Eric Christopher a776ed1122 Remove the -faltivec alias option and replace it with -maltivec everywhere.
The alias was only ever used on darwin and had some issues there,
and isn't used in practice much. Also fixes a problem with -mno-altivec
not turning off -maltivec.

Also add a diagnostic for faltivec/fno-altivec that directs users to use
maltivec options and include the altivec.h file explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 22:06:18 +00:00
Craig Topper 477c05d8f9 [X86] Add -mprefetchwt1/-mno-prefetchwt1 command line options and __PREFETCHWT1__ define to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 08:23:40 +00:00
Craig Topper ff3d222cce [X86] Add -msgx/-mno-sgx command line options and __SGX__ define to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 08:23:17 +00:00
Craig Topper 58210115d2 [X86] Update command line documentation for -mclwb and -mmovbe which I forgot in my previous commits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 07:57:01 +00:00
Craig Topper bc1dede5b7 [X86] Add -mmpx/-mno-mpx command line options and __MPX__ define to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 07:56:42 +00:00
Craig Topper c190c647b4 [X86] Add -mclflushopt/-mno-clflushopt command line support and __CLFLUSHOPT__ define to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 06:48:58 +00:00
Richard Smith 9e0150bf56 [docs] Add help text and refine grouping for various options.
Also accept -G= (and -msmall-data-threshold=) as an alias for -G on MIPS as well as Hexagon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27 02:08:37 +00:00
Richard Smith 029306869e Improve workaround for Sphinx's lack of support for command line options containing '+', '.' etc. to be more stable as the set of options changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27 01:54:42 +00:00
Richard Smith 9d48ebf07b [docs] Add TableGen-based generator for command line argument documentation,
and generate documentation for all (non-hidden) options supported by the
'clang' driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 19:39:46 +00:00