Commit graph

329093 commits

Author SHA1 Message Date
Yaxun Liu 229c78d3a5 [CUDA][HIP] Fix host/device check with -fopenmp
CUDA/HIP program may be compiled with -fopenmp. In this case, -fopenmp is only passed to host compilation
to take advantages of multi-threads computation.

CUDA/HIP and OpenMP both use Sema::DeviceCallGraph to store functions to be analyzed and remove them
once they decide the function is sure to be emitted. CUDA/HIP and OpenMP have different functions to determine
if a function is sure to be emitted.

To check host/device correctly for CUDA/HIP when -fopenmp is enabled, there needs a unified logic to determine
whether a function is to be emitted. The logic needs to be aware of both CUDA and OpenMP logic.

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

llvm-svn: 374263
2019-10-09 23:54:10 +00:00
Frederic Riss 80b080723f TestMTCSimple.py: allow the test to run on Darwin embedded platforms
The test needed some updates to run using a different UI toolkit
and with a different libMTC, but it should run fine on a device.

llvm-svn: 374262
2019-10-09 23:52:31 +00:00
Philip Reames 931120846e Conservatively add volatility and atomic checks in a few places
As background, starting in D66309, I'm working on support unordered atomics analogous to volatile flags on normal LoadSDNode/StoreSDNodes for X86.

As part of that, I spent some time going through usages of LoadSDNode and StoreSDNode looking for cases where we might have missed a volatility check or need an atomic check. I couldn't find any cases that clearly miscompile - i.e. no test cases - but a couple of pieces in code loop suspicious though I can't figure out how to exercise them.

This patch adds defensive checks and asserts in the places my manual audit found. If anyone has any ideas on how to either a) disprove any of the checks, or b) hit the bug they might be fixing, I welcome suggestions.

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

llvm-svn: 374261
2019-10-09 23:43:33 +00:00
GN Sync Bot 04f1effb99 gn build: Merge r374245
llvm-svn: 374260
2019-10-09 23:10:49 +00:00
Thomas Lively 3414bce07a [WebAssembly] Fix tests missed in rL374235
llvm-svn: 374259
2019-10-09 23:06:38 +00:00
Matt Morehouse da6cb7ba4c [sanitizer_common] Remove OnPrint from Go build.
Summary: Go now uses __sanitizer_on_print instead.

Reviewers: vitalybuka, dvyukov

Reviewed By: vitalybuka

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 374258
2019-10-09 22:57:07 +00:00
Matt Arsenault f8bf7d7f42 AMDGPU: Don't fold copies to physregs
In a future patch, this will help cleanup m0 handling.

The register coalescer handles copies from a register that
materializes an immediate, but doesn't handle move immediates
itself. The virtual register uses will often be allocated to the same
register, so there end up being no real copy.

llvm-svn: 374257
2019-10-09 22:51:42 +00:00
Frederic Riss adc5043fa2 TestIndirectSymbols: Modernize the Makefile
This old test used a completely hand-rolled Makefile. Modernize so that
it's able to cross-compile. And XFAIL the test as it fails on embedded
targets...

llvm-svn: 374256
2019-10-09 22:47:28 +00:00
Matt Arsenault 85dfa82302 AMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer
This was ignoring the register bank of the input pointer, and
isUniformMMO seems overly aggressive.

This will now conservatively assume a VGPR in cases where the incoming
bank hasn't been determined yet (i.e. is from a loop phi).

llvm-svn: 374255
2019-10-09 22:44:49 +00:00
Matt Arsenault 001826835a AMDGPU: Relax register classes used
llvm-svn: 374254
2019-10-09 22:44:48 +00:00
Matt Arsenault e114be608f AMDGPU: Fix typos
llvm-svn: 374253
2019-10-09 22:44:47 +00:00
Matt Arsenault 3cd3959fe2 GlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR
Turn it into a G_CONCAT_VECTORS of G_BUILD_VECTOR.

llvm-svn: 374252
2019-10-09 22:44:43 +00:00
Frederic Riss 0e891bcf79 Makefile.rules: add missing CODESIGN call
When building an executable and a shared library at the same time (yes,
Makefile.rules is setup to do this!) the executable was not codesigned.

llvm-svn: 374251
2019-10-09 22:35:56 +00:00
Haibo Huang 1a50941771 [lldb] Put site-packages into a sub dir of CMAKE_CFG_INTDIR
Summary: Fixes issue like D68719

Reviewers: tatyana-krasnukha

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 374250
2019-10-09 22:34:55 +00:00
Nico Weber b555ea5ff9 gn build: (manually) merge r374219
llvm-svn: 374249
2019-10-09 22:22:36 +00:00
Casey Carter b2e3c83b0d [libc++][test] Miscellaneous MSVC cleanups
* Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++.
* Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`.
* Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined.
* Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings.
* Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating.

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

llvm-svn: 374248
2019-10-09 22:19:17 +00:00
Greg Clayton dc9276b7d7 Set eRegisterKindEHFrame register numbers for 32 bit ARM register contexts in minidumps
Stack unwinding was sometimes failing when trying to unwind stacks in 32 bit ARM. I discovered this was because the EH frame register numbers were not set. This patch fixes this issue and adds a unit test to verify this doesn't regress.

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

llvm-svn: 374246
2019-10-09 22:16:12 +00:00
Marcello Maggioni ff38448148 [GISel] Refactor and split PatternMatchTest. NFC
Split the ConstantFold part into a separate file and
make it use the fixture GISelMITest.

llvm-svn: 374245
2019-10-09 22:10:10 +00:00
Jonas Devlieghere f204914fee [CMake] Use the correct lit.cfg.py
llvm-svn: 374244
2019-10-09 22:09:57 +00:00
Evandro Menezes d2f4c452d9 [InstCombine] Fix PR43617
Check for `nullptr` before inspecting composite function.

llvm-svn: 374243
2019-10-09 22:03:23 +00:00
Greg Clayton 0156be59b4 Fix a crasher due to an assert when two files have the same UUID but different paths.
Summary: The PlaceholderObjectFile has an assert in SetLoadAddress that fires if "m_base == value" is not true. To avoid this, we create check that the base address matches, and if it doesn't we clear the module that was found using the UUID so that we create a new PlaceholderObjectFile. Added a test to cover this issue.

Reviewers: labath, aadsm, dvlahovski

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374242
2019-10-09 22:03:15 +00:00
Stanislav Mekhanoshin c6dec1d828 [AMDGPU] Fixed dpp combine of VOP1
If original instruction did not have source modifiers they were
not added to the new DPP instruction as well, even if needed.

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

llvm-svn: 374241
2019-10-09 22:02:58 +00:00
Cameron McInally 47363a148f [IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator
Also update Clang to call Builder.CreateFNeg(...) for UnaryMinus.

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

llvm-svn: 374240
2019-10-09 21:52:15 +00:00
Lawrence D'Anna 5da2bc22ba remove a smattering of isolated, unnecessary uses of FILE*
Summary:
There a a few call sites that use FILE* which are easy to
fix without disrupting anything else.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: JDevlieghere, labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374239
2019-10-09 21:50:52 +00:00
Lawrence D'Anna 9eb1371923 SBFile support in SBCommandReturnObject
Summary:
This patch add SBFile interfaces to SBCommandReturnObject, and
removes the internal callers of its FILE* interfaces.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374238
2019-10-09 21:50:49 +00:00
Lawrence D'Anna b24022cd72 SBFile: add a bunch of tests that should eventually work.
Summary:
It's really annoying and confusing to have to keep referring
back to earlier versions of this SBFile work to find the
tests that need to be added for each patch, and not duplicate
them with new tests.

This patch just imports all my tests.   A bunch of them don't
work yet, so they are marked to be skipped.   They'll be
unmarked as I fix them.

One of these tests will actually trip an assert in the SWIG
code now instead of just failing, so I'm fixing that here too.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: JDevlieghere, labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374237
2019-10-09 21:50:46 +00:00
Jonas Devlieghere 865cd0932f [Reproducer] Add convenience methods IsCapturing and IsReplaying.
Add convenience methods to the Reproducer class for when you don't need
access to the generator and the loader.

llvm-svn: 374236
2019-10-09 21:47:49 +00:00
Thomas Lively 00f9e5aa76 [WebAssembly] Make returns variadic
Summary:
This is necessary and sufficient to get simple cases of multiple
return working with multivalue enabled. More complex cases will
require block and loop signatures to be generalized to potentially be
type indices as well.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 374235
2019-10-09 21:42:08 +00:00
Frederic Riss ffb26d9c78 TestHelloWorld: Make compatible with remote testing
The synchronization token handling was not remote-friendly.

llvm-svn: 374234
2019-10-09 21:41:02 +00:00
Wei Mi 09dcfe6805 [SampleFDO] Add indexing for function profiles so they can be loaded on demand
in ExtBinary format

Currently for Text, Binary and ExtBinary format profiles, when we compile a
module with samplefdo, even if there is no function showing up in the profile,
we have to load all the function profiles from the profile input. That is a
waste of compile time.

CompactBinary format profile has already had the support of loading function
profiles on demand. In this patch, we add the support to load profile on
demand for ExtBinary format. It will work no matter the sections in ExtBinary
format profile are compressed or not. Experiment shows it reduces the time to
compile a server benchmark by 30%.

When profile remapping and loading function profiles on demand are both used,
extra work needs to be done so that the loading on demand process will take
the name remapping into consideration. It will be addressed in a follow-up
patch.

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

llvm-svn: 374233
2019-10-09 21:36:03 +00:00
David Blaikie 411497c6c7 llvm-dwarfdump: Support multiple debug_loclists contributions
Also fixing the incorrect "offset" field being computed/printed for each
location list.

llvm-svn: 374232
2019-10-09 21:25:28 +00:00
Cameron Desrochers 745e57c593 [LLDB] Fix for regression of test 'TestDataFormatterInvalidStdUniquePtr.py' introduced in r374195
Differential Revision: https://reviews.llvm.org/D68641

llvm-svn: 374231
2019-10-09 21:15:48 +00:00
DeForest Richards edbb895b18 [Docs] Adds section for Additional Topics on Reference page
Adds a new section for Additional Topics on the Reference documentation page. Also moves Support Library topic to User Guides page.

llvm-svn: 374230
2019-10-09 21:09:09 +00:00
Jonas Devlieghere 988ad41948 [LLDB] Remove standalone build dep on llvm-strip
When building standalone, since llvm-strip is a symlink, it is created
using add_custom_command/add_custom_target which cannot be exported, and
thus cannot be depended on by lldb.

Patch by: Gwen Mittertreiner

Differential revision: https://reviews.llvm.org/D68614

llvm-svn: 374229
2019-10-09 21:06:03 +00:00
Jake Ehrlich e7bfce7863 [libFuzzer] Fix Alarm callback in fuchsia.
This patch adds an #if macro to skip the InFuzzingThread() comparison
for fuchsia, similar to what it is done for Windows and NetBSD.

In fuchsia, the alarm callback runs in a separate thread[0], making it fail
the comparison InFuzzingThread(), breaking the -timeout flag.

[0]:
https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp#L323

Author: charco (aka Marco  Vanotti)
Differential Revision: https://reviews.llvm.org/D68166

llvm-svn: 374228
2019-10-09 21:01:50 +00:00
Jim Ingham c0da1282fc Revert "[lldb] Calculate relative path for symbol links"
This reverts commit 958091c209.

This commit incorrectly sets the _lldb.so symlink (at least it does when
building in Stefans' two build directory mode, where you build llvm with
cmake/ninja and lldb with cmake/Xcode, using a cmake generated project.

The _lldb.so link is SUPPOSED to point to:

bin/LLDB.framework/Versions/A/LLDB

but instead it points to

bin/LLDB

which is where LLDB was staged to before constructing the framework.  This
causes all sorts of problems when we then build the lldb driver into bin -
remember that MacOS is a case-preserving but case insensitive filesystem -
so when we later go to dlopen _lldb.so, we dlopen the main executable instead.

llvm-svn: 374226
2019-10-09 20:56:43 +00:00
Lawrence D'Anna 21b8a8ae27 allow arbitrary python streams to be converted to SBFile
Summary:
This patch adds SWIG typemaps that can convert arbitrary python
file objects into lldb_private::File.

A SBFile may be initialized from a python file using the
constructor.   There are also alternate, tagged constructors
that allow python files to be borrowed, and for the caller
to control whether or not the python I/O methods will be
called even when a file descriptor is available.I

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: zturner, amccarth, lldb-commits

Tags: #lldb

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

llvm-svn: 374225
2019-10-09 20:56:17 +00:00
Alexey Bataev adc38dcf5f [OPENMP50]Fix scoring of contexts with and without user provided scores.
The context selector with user provided score must have higher score
than the context selector without user provided score.

llvm-svn: 374224
2019-10-09 20:54:06 +00:00
Vitaly Buka ff5a7c4ca6 [sanitizer, NFC] Fix grammar in comment
llvm-svn: 374223
2019-10-09 20:52:39 +00:00
Vitaly Buka c001144b10 [System Model] [TTI] Define AMDGPUTTIImpl::getST and AMDGPUTTIImpl::getTLI
To fix "infinite recursion" warning.

llvm-svn: 374222
2019-10-09 20:48:54 +00:00
Vitaly Buka 2d85fd942a [System Model] [TTI] Fix virtual destructor warning
llvm-svn: 374221
2019-10-09 20:48:52 +00:00
Vitaly Buka 3afc77dbbc [sanitizer] Disable signal_trap_handler on s390
llvm-svn: 374220
2019-10-09 20:48:50 +00:00
Sergey Dmitriev a0d83768f1 [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries
This patch removes the remaining part of the OpenMP offload linker scripts which was used for inserting device binaries into the output linked binary. Device binaries are now inserted into the host binary with a help of the wrapper bit-code file which contains device binaries as data. Wrapper bit-code file is dynamically created by the clang driver with a help of new tool clang-offload-wrapper which takes device binaries as input and produces bit-code file with required contents. Wrapper bit-code is then compiled to an object and resulting object is appended to the host linking by the clang driver.

This is the second part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943).

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

llvm-svn: 374219
2019-10-09 20:42:58 +00:00
Frederic Riss 868b47fcbe Skip Apple simulator test for all remote testing scenarios.
The test makes no sense to run remotely, period. The architecture of
the target is not the discriminant here.

llvm-svn: 374217
2019-10-09 20:39:04 +00:00
Jonas Devlieghere d61ef7c46d [CMake] Fix add_lldb_test_dependency
This function would ignore all but the first argument. Now it correctly
adds every dependency by iterating over its arguments.

llvm-svn: 374216
2019-10-09 20:36:29 +00:00
Jonas Devlieghere be1c290226 [utils] Update lldb-dotest for new test layout
The path to dotest.py changed after the test directory reorganization.

llvm-svn: 374215
2019-10-09 20:30:54 +00:00
DeForest Richards 02d264a547 [Docs] Adds Documentation links to sidebar
Adds links to Getting Started/Tutorials, User Guides, and Reference documentation pages to sidebar. Also adds a new section for LLVM IR on the Reference documentation page.

llvm-svn: 374214
2019-10-09 20:26:13 +00:00
Vitaly Buka 39f759189d [sanitizer] Make signal_name a C test
llvm-svn: 374213
2019-10-09 20:22:14 +00:00
Vedant Kumar c7cfa7c34e [test] Skip entry value test when clang < 10.0.0
clang-9 emitted the wrong opcode for entry values on Darwin.

rdar://56119661

llvm-svn: 374212
2019-10-09 20:21:33 +00:00
Vitaly Buka c3317658cf [sanitizer] Use raise() in test and cover more signals
llvm-svn: 374211
2019-10-09 20:18:27 +00:00