1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

7931 Commits

Author SHA1 Message Date
serge-sans-paille
3db641e8fe 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
2020-02-08 14:26:22 +01:00
serge_sans_paille
a978f6dd05 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
2020-02-08 13:31:52 +01:00
David Blaikie
f21a88cbf6 IR Linking: Support merging Warning+Max module metadata flags
Summary:
Debug Info Version was changed to use "Max" instead of "Warning" per the
original design intent - but this maxes old/new IR unlinkable, since
mismatched merge styles are a linking failure.

It seems possible/maybe reasonable to actually support the combination
of these two flags: Warn, but then use the maximum value rather than the
first value/earlier module's value.

Reviewers: tejohnson

Differential Revision: https://reviews.llvm.org/D74257
2020-02-07 16:29:58 -08:00
Nico Weber
52288fac0f Revert "Support -fstack-clash-protection for x86"
This reverts commit 4a1a0690ad6813a4c8cdb8dc20ea6337aa1f61e0.
Breaks tests on mac and win, see https://reviews.llvm.org/D68720
2020-02-07 14:49:38 -05:00
serge_sans_paille
1c2da8e3af 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
2020-02-07 19:54:39 +01:00
Nuno Lopes
2966eb297b [docs] update mathjax path in doxygen 2020-02-07 16:26:35 +00:00
Dmitry Preobrazhensky
4132e08676 [AMDGPU][MC][DOC] Updated AMD GPU assembler syntax description.
Summary of changes:
- updated description of gfx906 and gfx908;
- added description of gfx1011 and gfx1012 subtargets.
2020-02-07 16:23:46 +03:00
serge-sans-paille
72fce5ce53 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.
2020-02-07 11:36:53 +01:00
serge_sans_paille
e540da26a6 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
2020-02-07 10:56:15 +01:00
Justin Lebar
5a0d33afcf Clarify how llvm-mca detects att vs intel syntax.
Reviewers: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72385
2020-02-06 19:35:09 -08:00
Sjoerd Meijer
f264bf3538 [doc] typo in optimisation remark example
Fix typo in the vectorisation optimisation remarks example:

  -Rpass-missed=loop-vectorized
=>
  -Rpass-missed=loop-vectorize
2020-02-06 14:55:18 +00:00
Clement Courbet
4d88ea7164 [llvm-exegesis] Document repetition-mode.
Reviewers: gchatelet

Subscribers: tschuett, mstojanovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74114
2020-02-06 13:42:12 +01:00
Miloš Stojanović
065908dec9 [NFC] Fix error handling documentation
The default Error constructor can't be used since rL286561.

Differential Revision: https://reviews.llvm.org/D74069
2020-02-06 10:20:00 +01:00
Francis Visoiu Mistrih
57aee84cb1 [Remarks] Extend the RemarkStreamer to support other emitters
This extends the RemarkStreamer to allow for other emitters (e.g.
frontends, SIL, etc.) to emit remarks through a common interface.

See changes in llvm/docs/Remarks.rst for motivation and design choices.

Differential Revision: https://reviews.llvm.org/D73676
2020-02-04 17:16:02 -08:00
Matt Arsenault
0e9ab3b9f6 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.
2020-02-04 12:59:21 -05:00
Cameron McInally
1f64f59a06 [NFC][LangRef][FPEnv] Fix whitespace for denormal-fp-math/denormal-fp-math-f32
Fix incorrect spacing for `denormal-fp-math` and `denormal-fp-math-f32`. No
other changes.
2020-02-04 11:21:03 -06:00
Max Moroz
641e31f422 [libFuzzer] Minor documentation fixes. 2020-02-03 14:41:06 -08:00
Juneyoung Lee
92f700c60b [llvm-extract] Add -keep-const-init commandline option
Summary:
This adds -keep-const-init option to llvm-extract which preserves initializers of
used global constants.

For example:

```
$ cat a.ll
@g = constant i32 0
define i32 @f() {
  %v = load i32, i32* @g
  ret i32 %v
}

$ llvm-extract --func=f a.ll -S -o -
@g = external constant i32
define i32 @f() { .. }

$ llvm-extract --func=f a.ll -keep-const-init -S -o -
@g = constant i32 0
define i32 @f() { .. }
```

This option is useful in checking whether a function that uses a constant global is optimized correctly.

Reviewers: jsji, MaskRay, david2050

Reviewed By: MaskRay

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73833
2020-02-03 14:30:28 +09:00
Francesco Petrogalli
87965b5f59 [llvm][docs] Fix formatting in LangRef. [NFC]
The syntax of the call site attribute "vector-function-abi-variant"
is rendered with fixed size fonts (verbatim text).
2020-01-29 22:32:11 -06:00
Sterling Augustine
0474d30343 Print discriminators when printing .debug_line in GNU style.
Summary:
gnu addr2line prints DWARF line table discriminators like so:

<file>:<line> (discriminator <Number>)

This matches that behavior.

Document how and when --output-style=GNU prints discriminators

Add test for new GNU-style discriminator printing.

Reviewers: rupprecht, labath, jhenderson

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73318
2020-01-29 12:22:12 -08:00
Francesco Petrogalli
35b4d14b7d [llvm][docs] LangRef for IR attribute vector-function-abi-variant.
Reviewers: jdoerfert, andwar, simoll, rengolin, hfinkel, xtian

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72798
2020-01-29 17:03:05 +00:00
Wang, Pengfei
f83f5a6e3c Fix sphinx build bot failure. NFCI. 2020-01-28 22:07:34 +08:00
Wang, Pengfei
5a4cadf22e [FPEnv] Add pragma FP_CONTRACT support under strict FP.
Summary: Support pragma FP_CONTRACT under strict FP.

Reviewers: craig.topper, andrew.w.kaylor, uweigand, RKSimon, LiuChen3

Subscribers: hiraditya, jdoerfert, cfe-commits, llvm-commits, LuoYuanke

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D72820
2020-01-28 20:43:43 +08:00
Benjamin Kramer
af311296b9 [docs] Clarify llvm.used semantics with less awkward wording 2020-01-28 12:13:57 +01:00
Guillaume Chatelet
1afb32cf33 [instrinsics] Add @llvm.memcpy.inline instrinsics
Summary:
This is a follow up on D61634. It adds an LLVM IR intrinsic to allow better implementation of memcpy from C++.
A follow up CL will add the intrinsics in Clang.

Reviewers: courbet, theraven, t.p.northover, jdoerfert, tejohnson

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71710
2020-01-28 09:42:01 +01:00
Eric Schweitz
377ffc3bc4 remove a trailing space character (test commit) 2020-01-27 15:01:55 -08:00
Guillaume Chatelet
5d96838bf7 [IR] masked gather/scatter alignment should be set
Summary: masked_load and masked_store instructions require the alignment to be specified and a power of two. It seems to me that this requirement applies to masked_gather and masked_scatter as well.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73179
2020-01-26 18:51:36 +01:00
Sergey Dmitriev
ce7722dd53 [llvm-objcopy][COFF] Add support for --set-section-flags
Reviewers: jhenderson, MaskRay, alexshap, rupprecht, mstorsjo

Reviewed By: jhenderson

Subscribers: abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73107
2020-01-24 07:12:55 -08:00
Thomas Preud'homme
d5ea9f022a FileCheck [9/12]: Add support for matching formats
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support for selecting a
matching format to match a numeric value against (ie. decimal, hex lower
case letters or hex upper case letters).

This commit allows to select what format a numeric value should be
matched against. The following formats are supported: decimal value,
lower case hex value and upper case hex value. Matching formats impact
both the format of numeric value to be matched as well as the format of
accepted numbers in a definition with empty numeric expression
constraint.

Default for absence of format is decimal value unless the numeric
expression constraint is non null and use a variable in which case the
format is the one used to define that variable. Conclict of format in
case of several variable being used is diagnosed and forces the user to
select a matching format explicitely.

This commit also enables immediates in numeric expressions to be in any
radix known to StringRef's GetAsInteger method, except for legacy
numeric expressions (ie [[@LINE+<offset>]] which only support decimal
immediates.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson

Reviewed By: jhenderson, arichardson

Subscribers: daltenty, MaskRay, hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60389
2020-01-24 14:15:28 +00:00
James Henderson
c46fcc1c0b [doc][llvm-objcopy] Remove redundant COFF-specific sub-heading
The sub-heading used to contain the --only-keep-debug switch as that
switch wasn't implemented for ELF at one point. Since the switch is now
in the generic options section, and there are no other options in this
sub-heading, it is pointless and can be deleted.
2020-01-24 10:25:39 +00:00
Sander de Smalen
c07e22a824 Add support for (expressing) vscale.
In LLVM IR, vscale can be represented with an intrinsic. For some targets,
this is equivalent to the constexpr:

  getelementptr <vscale x 1 x i8>, <vscale x 1 x i8>* null, i32 1

This can be used to propagate the value in CodeGenPrepare.

In ISel we add a node that can be legalized to one or more
instructions to materialize the runtime vector length.

This patch also adds SVE CodeGen support for VSCALE, which maps this
node to RDVL instructions (for scaled multiples of 16bytes) or CNT[HSD]
instructions (scaled multiples of 2, 4, or 8 bytes, respectively).

Reviewers: rengolin, cameron.mcinally, hfinkel, sebpop, SjoerdMeijer, efriedma, lattner

Reviewed by: efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68203
2020-01-22 10:09:27 +00:00
Guillaume Chatelet
e1fb81280e [Doc] Update requirements for masked load/store 2020-01-22 10:42:37 +01:00
Sunil Singh
a72248bbf0 Change the googlemock link
Summary:
This commit changes the googlemock link in the Testing Guide doc as googlemock is absorbed into the GoogleTest project

Reviewers: shafik, labath, JDevlieghere, mib

Reviewed By: labath

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73082
2020-01-22 10:14:47 +01:00
Kazuaki Ishizaki
09203c3fb4 [llvm] NFC: fix trivial typos in documents
Reviewers: hans, Jim

Reviewed By: Jim

Subscribers: jvesely, nhaehnle, mgorny, arphaman, bmahjour, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73017
2020-01-22 11:32:51 +08:00
Krzysztof Parzyszek
dcadf45acb Update spelling of {analyze,insert,remove}Branch in strings and comments
These names have been changed from CamelCase to camelCase, but there were
many places (comments mostly) that still used the old names.

This change is NFC.
2020-01-21 10:15:38 -06:00
Sergey Dmitriev
c4ed238e0b [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections
Summary: This patch adds support for setting SHF_EXCLUDE flag for ELF sections.

Reviewers: jhenderson, grimar, MaskRay, mstorsjo, espindola, alexshap, rupprecht

Reviewed By: jhenderson, MaskRay

Subscribers: emaste, abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72128
2020-01-20 18:56:45 -08:00
Reid Kleckner
82482e6354 Remove extra "\01" prefix in EH docs
These escapes haven't been necessary since f8b51c5f90c60. Remove them to
declutter the docs.
2020-01-19 08:20:17 -08:00
Matt Arsenault
857d566359 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.
2020-01-17 20:09:53 -05:00
Nico Weber
90a1a43a36 Remove AllTargetsAsmPrinters
It's been an empty target since r360498 and friends
(`git log --grep='Move InstPrinter files to MCTargetDesc.' llvm/lib/Target`),
but due to hwo the way these targets are structured it was silently
an empty target without anyone noticing.

No behavior change.
2020-01-17 19:04:06 -05:00
Lang Hames
0330b8cc1e [docs][ORC] Try to fix 'title-level inconsistent' error in ORCv2.rst. 2020-01-16 21:46:35 -08:00
Lang Hames
500792d823 [docs][ORC] Fix some RST errors in the ORCv2 doc. 2020-01-16 21:10:56 -08:00
Lang Hames
aaf8c6c148 [docs][ORC] Update the "utilities" section, tidy intro and fix typo.
This patch updates the formatting and language of the Features section of the
ORCv2 design document. It also fixes a TBD by adding discussion of the
absoluteSymbols, symbolAliases, and reexports utilities.

Typos found during editing were also fixed.
2020-01-16 20:08:39 -08:00
Nico Weber
6be5d5bda8 Make LLVM_APPEND_VC_REV=OFF affect clang, lld, and lldb as well.
When LLVM_APPEND_VC_REV=OFF is set, the current git hash is no
longer embedded into binaries (mostly for --version output).
Without it, most binaries need to relink after every single
commit, even if they didn't change otherwise (due to, say,
a documentation-only commit).

LLVM_APPEND_VC_REV is ON by default, so this doesn't change the
default behavior of anything.

With this, all clients of GenerateVersionFromVCS.cmake honor
LLVM_APPEND_VC_REV.

Differential Revision: https://reviews.llvm.org/D72855
2020-01-16 19:04:08 -05:00
Yuanfang Chen
b1c09bbef0 Revert "[Support] make report_fatal_error abort instead of exit"
This reverts commit 647c3f4e47de8a850ffcaa897db68702d8d2459a.

Got bots failure from sanitizer-windows and maybe others.
2020-01-15 17:52:25 -08:00
Yuanfang Chen
725cd0da61 [Support] make report_fatal_error abort instead of exit
Summary:
This patch could be treated as a rebase of D33960. It also fixes PR35547.
A fix for `llvm/test/Other/close-stderr.ll` is proposed in D68164. Seems
the consensus is that the test is passing by chance and I'm not
sure how important it is for us. So it is removed like in D33960 for now.
The rest of the test fixes are just adding `--crash` flag to `not` tool.

** The reason it fixes PR35547 is

`exit` does cleanup including calling class destructor whereas `abort`
does not do any cleanup. In multithreading environment such as ThinLTO or JIT,
threads may share states which mostly are ManagedStatic<>. If faulting thread
tearing down a class when another thread is using it, there are chances of
memory corruption. This is bad 1. It will stop error reporting like pretty
stack printer; 2. The memory corruption is distracting and nondeterministic in
terms of error message, and corruption type (depending one the timing, it
could be double free, heap free after use, etc.).

Reviewers: rnk, chandlerc, zturner, sepavloff, MaskRay, espindola

Reviewed By: rnk, MaskRay

Subscribers: wuzish, jholewinski, qcolombet, dschuff, jyknight, emaste, sdardis, nemanjai, jvesely, nhaehnle, sbc100, arichardson, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, lenary, s.egerton, pzheng, cfe-commits, MaskRay, filcab, davide, MatzeB, mehdi_amini, hiraditya, steven_wu, dexonsmith, rupprecht, seiya, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D67847
2020-01-15 17:05:13 -08:00
Lang Hames
284b455103 [docs][ORC] Update the laziness section of the ORCv2 design doc.
This updates the discussion of lazy reexports, fixes a TBD for a usage example,
and adds a reference to the fully worked lazy reexports example that was added
in e9e26c01cd865da678b1af6ba5f417c713956a66.
2020-01-15 11:32:20 -08:00
Djordje Todorovic
82df06c202 [llvm-locstats] Add the --compare option
Draw a plot showing the difference in debug loc coverage on two
files provided.

Differential Revision: https://reviews.llvm.org/D71870
2020-01-15 14:35:29 +01:00
Hans Wennborg
54ef354524 Bump the trunk major version to 11
and clear the release notes.
2020-01-15 13:38:01 +01:00
Djordje Todorovic
e09ba3bb82 [llvm-locstats] Fix the docs
Add the missing picture for the documentation.
2020-01-15 12:32:01 +01:00
Djordje Todorovic
260af8e320 [llvm-locstats] Add the --draw-plot option
When using the option, draw the histogram representing the debug
location buckets. The resulting histogram will be saved in a png
file.

Differential Revision: https://reviews.llvm.org/D71869
2020-01-15 12:00:43 +01:00