1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Commit Graph

9325 Commits

Author SHA1 Message Date
LLVM GN Syncbot
1a919179a5 [gn build] Port e025d09b216 2020-10-27 19:40:30 +00:00
LLVM GN Syncbot
c5ea71af15 [gn build] Port ce6900c6cb5 2020-10-27 19:40:29 +00:00
LLVM GN Syncbot
05d3fe531a [gn build] Port 46c3d5cb05d 2020-10-27 18:08:19 +00:00
LLVM GN Syncbot
3188a13350 [gn build] Port 850325348ae 2020-10-27 12:17:41 +00:00
Aaron Puchert
ec700eefc9 Add release tarballs for libclc
Fixes PR47917.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D90100
2020-10-26 20:33:24 +01:00
LLVM GN Syncbot
6d69d5bffc [gn build] Port 61bc18de0b2 2020-10-26 08:07:25 +00:00
Nathan Ridge
2f0a524fbb [clangd] Add a TestWorkspace utility
TestWorkspace allows easily writing tests involving multiple
files that can have inclusion relationships between them.

BackgroundIndexTest.RelationsMultiFile is refactored to use
TestWorkspace, and moved to FileIndexTest as it no longer
depends on BackgroundIndex.

Differential Revision: https://reviews.llvm.org/D89297
2020-10-24 20:15:17 -04:00
Arthur Eubanks
d924016b11 [gn build] Add missing comma 2020-10-23 12:01:23 -07:00
Nick Desaulniers
e95a065d26 [IR] add fn attr for no_stack_protector; prevent inlining on mismatch
It's currently ambiguous in IR whether the source language explicitly
did not want a stack a stack protector (in C, via function attribute
no_stack_protector) or doesn't care for any given function.

It's common for code that manipulates the stack via inline assembly or
that has to set up its own stack canary (such as the Linux kernel) would
like to avoid stack protectors in certain functions. In this case, we've
been bitten by numerous bugs where a callee with a stack protector is
inlined into an __attribute__((__no_stack_protector__)) caller, which
generally breaks the caller's assumptions about not having a stack
protector. LTO exacerbates the issue.

While developers can avoid this by putting all no_stack_protector
functions in one translation unit together and compiling those with
-fno-stack-protector, it's generally not very ergonomic or as
ergonomic as a function attribute, and still doesn't work for LTO. See also:
https://lore.kernel.org/linux-pm/20200915172658.1432732-1-rkir@google.com/
https://lore.kernel.org/lkml/20200918201436.2932360-30-samitolvanen@google.com/T/#u

Typically, when inlining a callee into a caller, the caller will be
upgraded in its level of stack protection (see adjustCallerSSPLevel()).
By adding an explicit attribute in the IR when the function attribute is
used in the source language, we can now identify such cases and prevent
inlining.  Block inlining when the callee and caller differ in the case that one
contains `nossp` when the other has `ssp`, `sspstrong`, or `sspreq`.

Fixes pr/47479.

Reviewed By: void

Differential Revision: https://reviews.llvm.org/D87956
2020-10-23 11:55:39 -07:00
Amara Emerson
a5ff88d2db [AArch64][GlobalISel] Introduce a new post-isel optimization pass.
There are two optimizations here:

1. Consider the following code:
 FCMPSrr %0, %1, implicit-def $nzcv
 %sel1:gpr32 = CSELWr %_, %_, 12, implicit $nzcv
 %sub:gpr32 = SUBSWrr %_, %_, implicit-def $nzcv
 FCMPSrr %0, %1, implicit-def $nzcv
 %sel2:gpr32 = CSELWr %_, %_, 12, implicit $nzcv
This kind of code where we have 2 FCMPs each feeding a CSEL can happen
when we have a single IR fcmp being used by two selects. During selection,
to ensure that there can be no clobbering of nzcv between the fcmp and the
csel, we have to generate an fcmp immediately before each csel is
selected.

However, often we can essentially CSE these together later in MachineCSE.
This doesn't work though if there are unrelated flag-setting instructions
in between the two FCMPs. In this case, the SUBS defines NZCV
but it doesn't have any users, being overwritten by the second FCMP.

Our solution here is to try to convert flag setting operations between
a interval of identical FCMPs, so that CSE will be able to eliminate one.

2. SelectionDAG imported patterns for arithmetic ops currently select the
flag-setting ops for CSE reasons, and add the implicit-def $nzcv operand
to those instructions. However if those impdef operands are not marked as
dead, the peephole optimizations are not able to optimize them into non-flag
setting variants. The optimization here is to find these dead imp-defs and
mark them as such.

This pass is only enabled when optimizations are enabled.

Differential Revision: https://reviews.llvm.org/D89415
2020-10-23 10:18:36 -07:00
LLVM GN Syncbot
df8c67668f [gn build] Port dbbc4f4e226 2020-10-23 17:06:41 +00:00
Alex Orlov
41781efce1 Added utility to launch tests on a target remotely.
Runs an executable on a remote host.
This is meant to be used as an executor when running the LLVM and the Libraries tests on a target.

Reviewed By: vvereschaka

Differential Revision: https://reviews.llvm.org/D89349
2020-10-23 20:52:30 +04:00
LLVM GN Syncbot
5b19aaf8b1 [gn build] Port 00255f41929 2020-10-23 16:19:55 +00:00
Paulo Matos
f7fc888024 [WebAssembly] Implementation of (most) table instructions
Implementation of instructions table.get, table.set, table.grow,
table.size, table.fill, table.copy.

Missing instructions are table.init and elem.drop as they deal with
element sections which are not yet implemented.

Added more tests to tables.s

Differential Revision: https://reviews.llvm.org/D89797
2020-10-23 08:42:54 -07:00
Nico Weber
45a7f324f8 [gn build] port 48e4b0f (__config_site revert)
This reverts commit b3ca53e14274642274be8fe7db8b43dc3c146366.
This reverts commit 8b7dac81d378c339d3e55f6f51cd0c42803903ad.
This reverts commit 37c030f81a9fdd7a7e1b6fa5407b277c1ab1afa1.
2020-10-23 09:45:34 -04:00
Nico Weber
ae1574313b [gn build] (semi-manually) port 147b9497e79 2020-10-22 18:19:59 -04:00
Arthur Eubanks
890b22aff8 [gn build] Add missing clangd dependencies
Fixes
$ ninja obj/build/rel/gen/clang-tools-extra/clangd/CompletionModel.CompletionModel.obj

Some tablegen include files from clang/include/clang/AST and
clang/include/clang/Sema need to be generated before CompletionModel is
compiled.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D89657
2020-10-22 09:04:30 -07:00
LLVM GN Syncbot
88e6dc86b8 [gn build] Port be39a6fe6fc 2020-10-22 09:39:53 +00:00
Nico Weber
dbdd52cab6 [gn build] try to fix clang build after 37c030f81a9fdd
37c030f81a9fdd made it so that depending on //libcxx/include
automatically added the copied header dir to the include search path.
For some reason, clang can't build against the copied libcxx headers
(it complains about ldiv_t not being a type). I don't have a mac
to debug right now, but for the clang target this change was
unintentional anyways -- only depend on the copies target, instead
of on the target that also adjusts the include path.
2020-10-21 14:11:18 -04:00
Nico Weber
31900dae4d [gn build] try to fix up deps of __config_site after 37c030f81a 2020-10-21 12:57:50 -04:00
Nico Weber
f565b5becd [gn build] (manually) port 5d796645d6c8cade (libcxx __config change) 2020-10-21 12:54:30 -04:00
Nico Weber
d803683939 [gn build] (manually) port 54fa9ecd3088 2020-10-21 12:54:30 -04:00
Ben Dunbobbin
02eba0fee9 [LIT] fixed up accidentally committed EOF problems. 2020-10-21 13:29:58 +01:00
Ben Dunbobbin
cf3dae7375 [LIT] error if directly named test won't be run indirectly
Currently, a LIT test named directly (on the command line) will
be run even if the name of the test file does not meet the rules
to be considered a test in the LIT test configuration files for
its test suite. For example, if the test does not have a
recognised file extension.

This makes it relatively easy to write a LIT test that won't
actually be run. I did in: https://reviews.llvm.org/D82567

This patch adds an error to avoid users doing that. There is a
small performance overhead for this check. A command line option
has been added so that users can opt into the old behaviour.

Differential Revision: https://reviews.llvm.org/D83069
2020-10-21 13:21:29 +01:00
LLVM GN Syncbot
da51f34f77 [gn build] Port 848a68a032d 2020-10-20 17:56:26 +00:00
Nico Weber
bb3716f11b [gn build] assert clang-format does not depend on AST, Frontend, Sema at gn time
To catch things like https://reviews.llvm.org/D69854 and
https://reviews.llvm.org/D89708 earlier next time they happen.
2020-10-20 10:23:42 -04:00
Nico Weber
edb91e97ed [gn build] belatedly port 3ddac7e56363 2020-10-20 10:20:11 -04:00
Nico Weber
1f88b0c5f5 [gn build] port a2214757e2ca more 2020-10-20 10:20:11 -04:00
LLVM GN Syncbot
806ad918a8 [gn build] Port c0cdd22c72f 2020-10-20 13:20:27 +00:00
LLVM GN Syncbot
ba971880b9 [gn build] Port a2214757e2c 2020-10-20 13:20:26 +00:00
Nico Weber
147c31910c Revert "Revert "[gn build] (manually) port d09b08919ca""
This reverts commit 6ca3dd97352013375f907d92a7e1aed7ab80fbc3.
d09b08919ca relanded in 53065c543fe3f1.
2020-10-20 09:09:30 -04:00
Nico Weber
659577b7a3 Revert "[gn build] (manually) port d09b08919ca"
This reverts commit 4d2d287a030fe81a5bf9d982ed8ea26fe3bcee6b.
d09b08919ca got reverted in 7ecd60bb702.
2020-10-19 20:01:06 -04:00
Atmn Patel
cbe95c4921 [LangRef] Define mustprogress attribute
LLVM IR currently assumes some form of forward progress. This form is
not explicitly defined anywhere, and is the cause of miscompilations
in most languages that are not C++11 or later. This implicit forward progress
guarantee can not be opted out of on a function level nor on a loop
level. Languages such as C (C11 and later), C++ (pre-C++11), and Rust
have different forward progress requirements and this needs to be
evident in the IR.

Specifically, C11 and onwards (6.8.5, Paragraph 6) states that "An
iteration statement whose controlling expression is not a constant
expression, that performs no input/output operations, does not access
volatile objects, and performs no synchronization or atomic operations
in its body, controlling expression, or (in the case of for statement)
its expression-3, may be assumed by the implementation to terminate."
C++11 and onwards does not have this assumption, and instead assumes
that every thread must make progress as defined in [intro.progress] when
it comes to scheduling.

This was initially brought up in [0] as a bug, a solution was presented
in [1] which is the current workaround, and the predecessor to this
change was [2].

After defining a notion of forward progress for IR, there are two
options to address this:
1) Set the default to assuming Forward Progress and provide an opt-out for functions and an opt-in for loops.
2) Set the default to not assuming Forward Progress and provide an opt-in for functions, and an opt-in for loops.

Option 2) has been selected because only C++11 and onwards have a
forward progress requirement and it makes sense for them to opt-into it
via the defined `mustprogress` function attribute.  The `mustprogress`
function attribute indicates that the function is required to make
forward progress as defined. This is sharply in contrast to the status
quo where this is implicitly assumed. In addition, `willreturn` implies `mustprogress`.

The background for why this definition was chosen is in [3] and for why
the option was chosen is in [4] and the corresponding thread(s). The implementation is in D85393, the
clang patch is in D86841, the LoopDeletion patch is in D86844, the
Inliner patches are in D87180 and D87262, and there will be more
incoming.

[0] https://bugs.llvm.org/show_bug.cgi?id=965#c25
[1] https://lists.llvm.org/pipermail/llvm-dev/2017-October/118558.html
[2] https://reviews.llvm.org/D65718
[3] https://lists.llvm.org/pipermail/llvm-dev/2020-September/144919.html
[4] https://lists.llvm.org/pipermail/llvm-dev/2020-September/145023.html

Reviewed By: jdoerfert, efriedma, nikic

Differential Revision: https://reviews.llvm.org/D86233
2020-10-19 13:34:27 -04:00
Alex Richardson
80cd8e218f [lit] Avoid calling realpath() for every printed message
I did some profiling of lit while trying to optimize the libc++ test
startup for remote hosts and it turns out that there is a realpath() call
for every message printed and this shows up in the profile.
The inspect.getframeinfo() function calls realpath() internally and
moreover we don't need most of the other information returned from it.
This patch uses inspect.getsourcefile() and os.path.abspath() to remove
../ from the path instead. Not resolving symlinks reduces the startup time
for running a single test with lit by about 50ms for me.

Reviewed By: ldionne, yln
Differential Revision: https://reviews.llvm.org/D89186
2020-10-19 16:21:34 +01:00
Evgeny Leviant
343576899e [ARM][SchedModels] Convert IsPredicatedPred to MCSchedPredicate
Differential revision: https://reviews.llvm.org/D89553
2020-10-19 11:37:54 +03:00
David Sherwood
4d9ff7d9d6 [SVE] Replace TypeSize comparison operators in llvm/utils/TableGen
In CodeGenDAGPatterns.cpp we were relying upon TypeSize comparison
operators for ordering types, when we can actually just use the known
minimum size since the scalable property is already being taken into
account. Also, in TypeInfer::EnforceSameSize I fixed some implicit
TypeSize->uint64_t casts by changing the code to test the equality
of TypeSize objects instead.

In other places I have replaced calls to getSizeInBits() with
getFixedSizeInBits() because we are only ever expecting integer values.

Differential Revision: https://reviews.llvm.org/D88947
2020-10-19 08:21:36 +01:00
LLVM GN Syncbot
c330f53100 [gn build] Port 6154c4115cd 2020-10-19 04:23:08 +00:00
LLVM GN Syncbot
3640a6462f [gn build] Port 0aec49c8531 2020-10-19 04:23:07 +00:00
Craig Topper
159c8567b3 [X86] Sort the tables before printing in X86FoldTablesEmitter.
This makes diffing with the manual tables easier. And if we ever
directly use the autogenerated tables instead of the manual tables
we'll need them to be in sorted order for the binary search.
2020-10-18 17:39:38 -07:00
Nico Weber
f99c52a3a0 [gn build] (manually) port d09b08919ca 2020-10-18 12:17:55 -04:00
Craig Topper
e59aedc474 [X86] Remove unnecessary defaulted argument from function in X86FoldTablesEmitter.cpp. NFC
Nothing ever calls it with anything other than the default value.
So just delete it and the code that handled the non-default value.
2020-10-17 22:21:32 -07:00
LLVM GN Syncbot
92111fd84e [gn build] Port 3d4bba302d2 2020-10-16 18:13:18 +00:00
Nico Weber
fac13d2341 [gn build] (manually) port 3d4bba302d246 2020-10-16 14:12:38 -04:00
Nico Weber
6865cba465 [gn bulid] Remove phantom WebAssembly tablegen() calls
Apparenlty I added these in https://reviews.llvm.org/rL350628 but
I'm not sure why. They never existed in the CMake build, and now
they're causing trouble.
2020-10-15 16:14:11 -04:00
Paul C. Anagnostopoulos
0c4c5ded27 [RISCV] [TableGen] Modify RISCVCompressInstEmitter.cpp to use getAllDerivedDefinitions(). 2020-10-15 10:11:12 -04:00
LLVM GN Syncbot
9f80ca3aba [gn build] Port f0875971249 2020-10-13 20:50:32 +00:00
LLVM GN Syncbot
3ab165d1a9 [gn build] Port 77bb3ebebbc 2020-10-13 19:14:10 +00:00
LLVM GN Syncbot
7af631872f [gn build] Port 662ed9e67ad 2020-10-13 19:14:09 +00:00
Ahsan Saghir
179c563da5 [PowerPC] Add assemble disassemble intrinsics for MMA
This patch adds support for assemble disassemble intrinsics
for MMA.

Reviewed By: bsaleil, #powerpc

Differential Revision: https://reviews.llvm.org/D88739
2020-10-13 13:21:58 -05:00
LLVM GN Syncbot
9b4c282db0 [gn build] Port b76dc111dd0 2020-10-13 17:53:40 +00:00