1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

186984 Commits

Author SHA1 Message Date
Alex Richardson
4c2f38b670 [update_cc_test_checks.py] Fix invalid python string escape sequence
This works with current python version but will be an error with 3.9
2019-10-30 09:28:51 +00:00
Karl-Johan Karlsson
d179aa00b3 [AddressSanitizer] Only instrument globals of default address space
The address sanitizer ignore memory accesses from different address
spaces, however when instrumenting globals the check for different
address spaces is missing. This result in assertion failure. The fault
was found in an out of tree target.

The patch skip all globals of non default address space.

Reviewed By: leonardchan, vitalybuka

Differential Revision: https://reviews.llvm.org/D68790
2019-10-30 09:32:19 +01:00
QingShan Zhang
6f49436f61 [PowerPC] Clear the sideeffect bit for those instructions that didn't have the match pattern
If the instruction have match pattern, llvm-tblgen will infer the sideeffect bit from the match pattern and it works well.
If not, the tblgen will set it as true that hurt the scheduling.

PowerPC has some instructions that didn't specify the match pattern(i.e. LXSD etc), which is manually selected post-ra according
to the register pressure. We need to clear the sideeffect flag for these instructions.

Differential Revision: https://reviews.llvm.org/D69232
2019-10-30 07:59:32 +00:00
Craig Topper
0ad4d87942 [Target] Change PATCHABLE_EVENT_CALL/PATCHABLE_TYPED_EVENT_CALL to use unknown instead of i8imm/i16imm/i32imm in its definition.
These instructions don't use immediates, they use registers. But
the register class needed is target specific. So just use unknown.
2019-10-30 00:36:01 -07:00
Craig Topper
f04a9f7eb5 [X86] Add test case for PR43758. NFC 2019-10-30 00:36:01 -07:00
Seiya Nuta
455ce8b8e6 [llvm-objcopy] Add REQUIRES directive to fix a test
Buildbot failure log: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/11164
2019-10-30 16:21:00 +09:00
David Zarzycki
67e76cc404 [X86] Make memcmp vector lowering handle arbitrary expansions
Teach combineVectorSizedSetCCEquality() to handle arbitrary memcmp
expansions but do not change any default policy for now.

This also fixes a bug in the memcmp expansion itself when large
displacements are needed.

https://reviews.llvm.org/D69507
2019-10-30 09:12:57 +02:00
Seiya Nuta
975fa8af18 [llvm-objcopy][MachO] Support indirect symbol table
Summary:
Parse the indirect symbol table and update the indexes of
symbol entries in the table in the writer in case they have
been changed.

Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap, rupprecht

Subscribers: jakehehrlich, abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66280
2019-10-30 15:12:22 +09:00
Fangrui Song
055fd79f92 [Orc][test] Fix -DBUILD_SHARED_LIBS=on build 2019-10-29 22:55:17 -07:00
Fangrui Song
c7a3165562 [lli-child-target] Fix -DBUILD_SHARED_LIBS=on build 2019-10-29 22:46:13 -07:00
Fangrui Song
75e150df0b [lli] Fix -DBUILD_SHARED_LIBS=on build
This fixes:

  ld.lld: error: undefined symbol: vtable for llvm::orc::rpc::ResponseAbandoned
  >>> referenced by lli.cpp

In -DBUILD_SHARED_LIBS=on builds, all directly referenced references must
be linked to appease -Wl,-z,defs.
2019-10-29 22:41:35 -07:00
Vlad Tsyrklevich
05d7b20b14 Revert "[llvm-cov] Add option to whitelist filenames"
This reverts commit bfed824b57d14e2ba98ddbaf1a1410cf04a3e279, the
included test fails on many bots including the sanitier bots, e.g. in
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36140
2019-10-29 22:38:38 -07:00
Nico Weber
9ad8425b72 gn build: (manually) merge a34680a3 2019-10-29 21:51:11 -04:00
Vedant Kumar
0f46172e59 [llvm-cov] Add option to whitelist filenames
Add the `-whitelist-filename-regex` option to restrict coverage
reporting to file paths that match a whitelist regex.

Patch by Michael Daniels!

rdar://56720320
2019-10-29 18:26:33 -07:00
Julian Lettner
7eb9e9c81c [lit] Refactor ordering of tests 2019-10-29 17:49:23 -07:00
Fedor Sergeev
106eaa30ed [ADT] add equality operator for SmallSet
Makes it easier to migrate existing code that uses std::set.

Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D69417
2019-10-29 17:33:57 -07:00
Chris Bieneman
9b89694766 Break out OrcError and RPC
Summary:
When createing an ORC remote JIT target the current library split forces the target process to link large portions of LLVM (Core, Execution Engine, JITLink, Object, MC, Passes, RuntimeDyld, Support, Target, and TransformUtils). This occurs because the ORC RPC interfaces rely on the static globals the ORC Error types require, which starts a cycle of pulling in more and more.

This patch breaks the ORC RPC Error implementations out into an "OrcError" library which only depends on LLVM Support. It also pulls the ORC RPC headers into their own subdirectory.

With this patch code can include the Orc/RPC/*.h headers and will only incur link dependencies on LLVMOrcError and LLVMSupport.

Reviewers: lhames

Reviewed By: lhames

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68732
2019-10-29 17:31:28 -07:00
Austin Kerbow
c343e8e759 AMDGPU/GlobalISel: Legalize FDIV32
Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69581
2019-10-29 17:18:06 -07:00
Julian Lettner
eb34e6096d [lit] Small improvements in cl_arguments.py
*) `--max-tests` should be positive integer
*) `--max-time` should be positive integer
*) Remove unnecessary defaults for command line option parsing
2019-10-29 16:46:35 -07:00
Nick Terrell
ac02e6927c [LLD][ELF] Support --[no-]mmap-output-file with F_no_mmap
Summary:
Add a flag `F_no_mmap` to `FileOutputBuffer` to support
`--[no-]mmap-output-file` in ELF LLD. LLD currently explicitly ignores
this flag for compatibility with GNU ld and gold.

We need this flag to speed up link time for large binaries in certain
scenarios. When we link some of our larger binaries we find that LLD
takes 50+ GB of memory, which causes memory pressure. The memory
pressure causes the VM to flush dirty pages of the output file to disk.
This is normally okay, since we should be flushing cold pages. However,
when using BtrFS with compression we need to write 128KB at a time when
we flush a page. If any page in that 128KB block is written again, then
it must be flushed a second time, and so on. Since LLD doesn't write
sequentially this causes write amplification. The same 128KB block will
end up being flushed multiple times, causing the linker to many times
more IO than necessary. We've observed 3-5x faster builds with
-no-mmap-output-file when we hit this scenario.

The bad scenario only applies to compressed filesystems, which group
together multiple pages into a single compressed block. I've tested
BtrFS, but the problem will be present for any compressed filesystem
on Linux, since it is caused by the VM.

Silently ignoring --no-mmap-output-file caused a silent regression when
we switched from gold to lld. We pass --no-mmap-output-file to fix this
edge case, but since lld silently ignored the flag we didn't realize it
wasn't being respected.

Benchmark building a 9 GB binary that exposes this edge case. I linked 3
times with --mmap-output-file and 3 times with --no-mmap-output-file and
took the average. The machine has 24 cores @ 2.4 GHz, 112 GB of RAM,
BtrFS mounted with -compress-force=zstd, and an 80% full disk.

| Mode    | Time  |
|---------|-------|
| mmap    | 894 s |
| no mmap | 126 s |

When compression is disabled, BtrFS performs just as well with and
without mmap on this benchmark.

I was unable to reproduce the regression with any binaries in
lld-speed-test.

Reviewed By: ruiu, MaskRay

Differential Revision: https://reviews.llvm.org/D69294
2019-10-29 15:49:08 -07:00
Adrian Prantl
26a102eb58 [DWARF5] Added support for deleted C++ special member functions.
This patch adds support for deleted C++ special member functions in
clang and llvm. Also added Defaulted member encodings for future
support for defaulted member functions.

Patch by Sourabh Singh Tomar!

Differential Revision: https://reviews.llvm.org/D69215
2019-10-29 13:44:06 -07:00
Daniel Sanders
8e371e2336 [globalisel][docs] Fix warning treated as error
I had hoped that I could have some
```
.. code-block:: MIR
```
sections for MIR examples which causes a warning about pygments not
supporting it but we have warnings treated as errors
2019-10-29 13:27:48 -07:00
Daniel Sanders
705b4ca866 [globalisel][docs] Rewrite the IRTranslator documentation
Summary:
I haven't refreshed the Function Calls section as I don't feel I have
sufficient knowledge of that area. It would be appreciated if someone could
review that section.

Note: I'm aware that pygments doesn't support 'mir' as used in one of the
code-block directives. This currently emits a warning and I decided to
keep it to enable finding them later. Maybe we can teach pygments to
support it.

Depends on D69456

Reviewers: volkan, aditya_nandakumar

Subscribers: rovka, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69457
2019-10-29 13:14:58 -07:00
Philip Reames
00d0016b7c [SelectionDAG] Enable lowering unordered atomics loads w/LoadSDNode (and stores w/StoreSDNode) by default
Enable the new SelectionDAG representation for unordered loads and stores introduced in r371441 by default.  As a reminder, the new lowering changes the representation of an unordered atomic load from an AtomicSDNode - which is essentially a black box which gets passed through without combines messing with it - to a LoadSDNode w/a atomic marker on the MMO. The later parallels the way we handle volatiles, and I've audited the code to ensure that every location which checks one checks the other.

This has been fairly heavily fuzzed, and I examined diffs in a reasonable large corpus of assembly by hand, so I'm reasonable sure this is correct for the common case.  Late in the review for this, it was discovered that I hadn't correctly handled cases which could be legalized into CAS operations.  This points out that there's a strong bias in the IR of the frontend I'm working with towards only legal atomics.  If there are problems with this patch, the most likely area will be legalization.

Differential Revision: https://reviews.llvm.org/D69219
2019-10-29 12:46:24 -07:00
Philip Reames
f4b7fd46a9 [Docs] Reflect the slow migration from guard to widenable condition which is currently in progress. 2019-10-29 12:46:24 -07:00
Joel E. Denny
84b5bf580c [lit] Extend internal diff to support - argument
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option.  This patch adds support for
`-` to mean stdin.

Reviewed By: probinson, rnk

Differential Revision: https://reviews.llvm.org/D67643
2019-10-29 15:13:53 -04:00
Joel E. Denny
7728e897bd [lit] Make internal diff work in pipelines
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Also, when lit's `diff` prints differences to stdout in Windows, this
patch ensures it always terminate lines with `\n` not `\r\n`.  That
way, strict FileCheck directives checking the `diff` output succeed in
both Linux and Windows.  This wasn't an issue when `diff` was internal
to lit because `diff` didn't then write to the true stdout, which is
where the `\n` -> `\r\n` conversion happened in Python.

Reviewed By: probinson, stella.stamenova

Differential Revision: https://reviews.llvm.org/D66574
2019-10-29 15:13:52 -04:00
Craig Topper
813aed1edd [X86] Narrow i64 compares with constant to i32 when the upper 32-bits are known zero.
This catches some cases. There are probably ways to improve this.
I tried doing it as a combine on the setcc, but that broke
some cases involving flag reuse in place of test.

I renamed the isX86CCUnsigned to isX86CCSigned and flipped its
polarity to make it consistent with the similar functions for
ISD::SETCC. This avoids calling EQ/NE as being signed or unsigned.

Fixes PR43823.

Differential Revision: https://reviews.llvm.org/D69499
2019-10-29 11:38:15 -07:00
Daniel Sanders
285fcbbd38 [globalisel][docs] Rewrite the pipeline overview
Summary:
Rewrite the pipeline overview to be more focused on the structure and
flexibility as well as highlight the increased usefulness of
MachineVerifier and increased testability resulting from the smaller
incremental passes approach.

The diagrams are lifted from the slides for the LLVMDev 2019 talk
'Generating Optimized Code with GlobalISel' and adapted to be readable on
the white background used in the docs.

Reviewers: volkan

Subscribers: rovka, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69456
2019-10-29 11:21:24 -07:00
Simon Pilgrim
3e879d60f8 [X86][VBMI2] Add vector funnel shift tests
Demonstrates missed opportunity to combine to the VBMI2 SHLDV/SHRDV ops - combineOrShiftToFunnelShift should handle vector ops (and we should eventually move this to DAGCombine).
2019-10-29 17:57:55 +00:00
Ehsan Amiri
b519c64efa [SVE][AArch64] Adding pattern matching for some SVE instructions.
Adding patten matching for two SVE intrinsics: frecps and frsqrts.
Also added patterns for fsub and fmul - these SDNodes directly correspond
to machine instructions.

Review: https://reviews.llvm.org/D68476
Patch authored by mgudim (Mikhail Gudim).
2019-10-29 13:17:30 -04:00
Fangrui Song
39106fec47 [SLP] Fix -Wunused-variable. NFC 2019-10-29 09:38:55 -07:00
Sander de Smalen
077fb58cd2 Reland [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)
llvm/test/DebugInfo/MIR/X86/live-debug-values-reg-copy.mir failed with
EXPENSIVE_CHECKS enabled, causing the patch to be reverted in
rG2c496bb5309c972d59b11f05aee4782ddc087e71.

This patch relands the patch with a proper fix to the
live-debug-values-reg-copy.mir tests, by ensuring the MIR encodes the
callee-saves correctly so that the CalleeSaved info is taken from MIR
directly, rather than letting it be recalculated by the PEI pass. I've
done this by running `llc -stop-before=prologepilog` on the LLVM
IR as captured in the test files, adding the extra MOV instructions
that were manually added in the original test file, then running `llc
-run-pass=prologepilog` and finally re-added the comments for the MOV
instructions.
2019-10-29 16:13:07 +00:00
Alexey Bataev
0b89a0ccd6 [SLP] Generalization of stores vectorization.
Stores are vectorized with maximum vectorization factor of 16. Patch
tries to improve the situation and use maximal vectorization factor.

Reviewers: spatel, RKSimon, mkuper, hfinkel

Differential Revision: https://reviews.llvm.org/D43582
2019-10-29 11:46:36 -04:00
Simon Pilgrim
d75ec42f4c [X86] Pull out combineOrShiftToFunnelShift helper. NFCI. 2019-10-29 15:29:51 +00:00
Sanjay Patel
5b68045419 [InstCombine] make icmp vector canonicalization safe for constant with undef elements
This is a fix for:
https://bugs.llvm.org/show_bug.cgi?id=43730
...and as shown there, we have existing test cases that show potential miscompiles.

We could just bail out for vector constants that contain any undef elements, or we can do as shown here:
allow the transform, but replace the undefs with a safe value.

For most of the tests shown, this results in a full splat constant (no undefs) which is probably a win
for further IR analysis because we conservatively don't match undefs in most cases. Codegen can probably
recover these kinds of undef lanes via demanded elements analysis if that's profitable.

Differential Revision: https://reviews.llvm.org/D69519
2019-10-29 10:58:14 -04:00
Florian Hahn
a896ae7b1e [bugpoint] Try to reduce passes after reducing everything.
In some cases, we fail to reduce the pass list earlier because of
complex pass dependencies, but we can reduce it after we simplified the
reproducer.

An example of that is PR43474, which can limit the crash to
-loop-interchange. Adding a test case would require at least 2
interacting Loop passes I think.

Reviewers: davide, reames, modocache

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D69236
2019-10-29 14:24:05 +00:00
Sanjay Patel
84493c356e [InstCombine] add tests for icmp predicate canonicalization with vector types; NFC
Increase coverage for D69519.
2019-10-29 10:07:23 -04:00
Krzysztof Parzyszek
7c46b2bf6e [Hexagon] Handle remaining registers in getRegisterByName()
This fixes https://llvm.org/PR43829.
2019-10-29 08:56:01 -05:00
Simon Pilgrim
da968525d0 [BitVector] Define BitWord as uintptr_t
Define BitVector::BitWord as uintptr_t instead of unsigned long, as long does not necessarily translates to a pointer size (especially on 64-bit Visual Studio).

Committed on behalf of @ekatz (Ehud Katz)

Differential Revision: https://reviews.llvm.org/D69336
2019-10-29 13:53:04 +00:00
Sanjay Patel
ff84d9a39d [IR] move/change null-check to assert
This should trigger a dereference before null-check warning,
but I don't see it when building with clang. In any case, the
current and known future users of this helper require non-null
args, so I'm converting the 'if' to an assert.
2019-10-29 09:28:47 -04:00
Simon Pilgrim
0f045592d7 [BitVector] Cast integer literals to BitWord [NFC]
Associate the integer literals with BitWord, instead of the embedded UL suffix.

Required for https://reviews.llvm.org/D69336.

Committed on behalf of @ekatz (Ehud Katz)

Differential Revision: https://reviews.llvm.org/D69357
2019-10-29 12:56:31 +00:00
Sanjay Patel
8ecee64290 [IR] move helper function to replace undef constant (elements) with fixed constants
This is the NFC part of D69519.
We had this functionality locally in instcombine, but it can be used
elsewhere, so hoisting it to Constant class.
2019-10-29 08:52:10 -04:00
Greg Bedwell
b1fc4cce5e Fix some spelling mistakes in comments. NFC 2019-10-29 12:41:24 +00:00
Greg Bedwell
4eb3142b43 Fix a spelling mistake in a comment. NFC
(I'm currently trying to debug a strange error message I get when
pushing to github, despite the pushes being successful).
2019-10-29 12:32:01 +00:00
Greg Bedwell
0c2d39ef73 Fix a spelling mistake in a comment. NFC 2019-10-29 12:19:52 +00:00
Andrea Di Biagio
00bfc57280 Revert "[NFC] Replace a linked list in LiveDebugVariables pass with a DenseMap"
This reverts commit 8af5ada09319e5a021d57a1a03715b2fd022e415.

As Bjorn pointed out in D68816, the iteration over `UserVals` may not be safe.

Reverting on behalf of Orlando.
2019-10-29 12:13:23 +00:00
Simon Pilgrim
34ebd7f03a Fix unused variable warning. NFCI. 2019-10-29 12:12:28 +00:00
Florian Hahn
94d1a0f315 [LCSSA] Forget values we create LCSSA phis for
Summary:
Currently we only forget the loop we added LCSSA phis for. But SCEV
expressions in other loops could also depend on the instruction we added
a PHI for and currently we do not invalidate those expressions. This can
happen when we use ScalarEvolution before converting a function to LCSSA
form. The SCEV expressions will refer to the non-LCSSA value. If this
SCEV expression is then used with the expander, we do not preserve LCSSA
form.

This patch properly forgets the values we created PHIs for. Those need
to be recomputed again. This patch fixes PR43458.

Currently SCEV::verify does not catch this mismatch and any test would
need to run multiple passes to trigger the error (e.g. -loop-reduce
-loop-unroll). I will also look into catching this kind of mismatch in
the verifier. Also, we currently forget the whole loop in LCSSA and I'll
check if we can be more surgical.

Reviewers: efriedma, sanjoy.google, reames

Reviewed By: efriedma

Subscribers: zzheng, hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68194
2019-10-29 12:05:09 +00:00
Simon Pilgrim
02976b5db6 Revert rG70f5aecedef9a6e347e425eb5b843bf797b95319 - "Reland [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)"
This fails on EXPENSIVE_CHECKS builds
2019-10-29 11:54:58 +00:00