Commit Graph

321432 Commits

Author SHA1 Message Date
Petr Hosek 803b994e9a [CMake][Fuchsia] Use RelWithDebInfo to build runtimes
We want to preserve debug info in our runtimes to aid symbolization and
debugging; for shared libraries this will be stripped away during
install-stripped step and distributed via .build-id, for static archives
it's part of the archive and it's a responsibility of the consumer to
strip it away in the final binary if not needed.

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

llvm-svn: 365845
2019-07-11 23:49:39 +00:00
Paul Robinson 2cb5c46e67 [clangd] Fix MSVC build failure.
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/26898

llvm-svn: 365844
2019-07-11 23:48:06 +00:00
Alex Langford 2c3c045dcb [Target] Replace Plugin headers with non-plugin headers
llvm-svn: 365843
2019-07-11 23:45:35 +00:00
Matt Arsenault e5fb434d92 AMDGPU: s_waitcnt field should be treated as unsigned
Also make it an ImmLeaf, so it should work with global isel as well,
which was part of the point of moving it in the first place.

llvm-svn: 365842
2019-07-11 23:42:57 +00:00
Reid Kleckner 1a285c27fd Use clang driver for libfuzzer tests on Windows
Summary:
There's no real reason to use clang-cl on Windows, the clang driver
works just as well. This fixes a test which uses the -O0 flag, which was
recently removed from clang-cl to match MSVC, which lacks this flag.

While I'm here, remove the explicit -std=c++11 flag. Previously, this
flag was necessary when the default C++ standard was C++98. Now that the
default is C++14, this is no longer necessary. It's problematic on
Windows, because the Visual C++ standard library relies on C++14
features, and attempting to compile it with C++11 results in errors.
Rather than adding logic to conditionally set the standard to C++11 only
on non-Win, this flag can be removed.

See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and
https://reviews.llvm.org/D64506.

Reviewers: morehouse, thakis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 365841
2019-07-11 23:20:04 +00:00
Eric Fiselier 41798c05cd Fix memory leak in set and map.
When assigning an initializer list into set/map, libc++ would
leak memory if the initializer list contained equivalent keys
because we failed to check if the insertion was successful.

llvm-svn: 365840
2019-07-11 23:13:38 +00:00
Petr Hosek 6f8f1a7db7 [sancov] Ignore PC samples with value 0
The sancov runtime for the (Fuchsia) Zircon kernel delivers results
in the standard format, but as the full array of possible samples
with 0 in uncovered slots. That runtime delivers "live" data and
has no final "export" pass to compactify out the uncovered slots,
and it seems silly to require another offline tool just for that.

Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D63695

llvm-svn: 365839
2019-07-11 22:59:23 +00:00
Leonard Chan 5652f35817 [NewPM] Port Sancov
This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.

Changes:

- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
  functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
  functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.

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

llvm-svn: 365838
2019-07-11 22:35:40 +00:00
Stanislav Mekhanoshin 28550c8680 [AMDGPU] Fixed asan error with agpr spilling
Instruction was used after it was erased.

llvm-svn: 365837
2019-07-11 22:30:11 +00:00
Diego Novillo a35a7d49e5 Fix build errors LLVM tests are disabled.
Original patch from alanbaker@google.com

Fixes the error:
CMake Error in <...>/llvm/cmake/modules/CMakeLists.txt:

export called with target "LLVMTestingSupport" which requires target
"gtest" that is not in the export set.

This occurs when LLVM is embedded in a larger project, but is configured not to
include tests. If testing is disabled gtest isn't available and LLVM fails to
configure.

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

llvm-svn: 365836
2019-07-11 22:08:35 +00:00
Vitaly Buka f55aad0356 CodeGen: Suppress c++ warnings in test
llvm-svn: 365835
2019-07-11 21:59:09 +00:00
Simon Atanasyan 5dd5541d9f [mips] Simplify test case. NFC
Before rL295040 the linker just crashed when a GOT relocation (R_MIPS_GOT16)
comes from a merge section. To ensure that this bug still fixed it's enough
to check that the linker does not crash and create GOT entries.

llvm-svn: 365834
2019-07-11 21:55:56 +00:00
Stanislav Mekhanoshin 937ff6e701 [AMDGPU] gfx908 agpr spilling
Differential Revision: https://reviews.llvm.org/D64594

llvm-svn: 365833
2019-07-11 21:54:13 +00:00
Azharuddin Mohammed 18b78bfe9e Fix a Python3 compatibility error
File "clang/test/lit.cfg.py", line 186, in <module>
    config.available_features.add('macos-sdk-' + macOSSDKVersion)
TypeError: must be str, not bytes

llvm-svn: 365832
2019-07-11 21:45:48 +00:00
Sylvestre Ledru 76b26550e9 Rename libclang_shared to libclang-cpp
Summary: Fix bug 42475

Reviewers: beanz, tstellar

Reviewed By: beanz

Subscribers: kimgr, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 365831
2019-07-11 21:42:55 +00:00
Stefan Stipanovic 0626367202 [Attributor] Deduce "nosync" function attribute.
Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.

Reviewers: jdoerfert, jfb, nhaehnle, arsenm

Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits

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

llvm-svn: 365830
2019-07-11 21:37:40 +00:00
Stanislav Mekhanoshin 7d2019bb96 [AMDGPU] gfx908 hazard recognizer
Differential Revision: https://reviews.llvm.org/D64593

llvm-svn: 365829
2019-07-11 21:30:34 +00:00
Huihui Zhang 7b4a59db1e [InstCombine][NFCI] Add more test coverage to onehot_merge.ll
Prep work for upcoming patch D64275.

llvm-svn: 365828
2019-07-11 21:28:25 +00:00
Artem Dergachev fc6059e8b9 [analyzer] exploded-graph-rewriter: Fix filenames in program point.
Fix a typo in JSON field name.

llvm-svn: 365827
2019-07-11 21:27:42 +00:00
Stanislav Mekhanoshin b83e283e65 [AMDGPU] gfx908 scheduling
Differential Revision: https://reviews.llvm.org/D64590

llvm-svn: 365826
2019-07-11 21:25:00 +00:00
Shoaib Meenai 3173c60f96 [clang-shlib] Fix clang-shlib for PRIVATE dependencies
Any static library with a PRIVATE dependency ends up with a
$<LINK_ONLY:...> generator expression in its INTERFACE_LINK_LIBRARIES,
which won't be evaluated by the $<TARGET_PROPERTY:...>, so we end up
with an unevaluated generator expression in the generated build file and
Ninja chokes on the dollar sign. Just use the static library directly
for its dependencies instead of trying to propagate dependencies
manually.

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

llvm-svn: 365825
2019-07-11 21:20:38 +00:00
Stanislav Mekhanoshin e67cc380a8 [AMDGPU] gfx908 mfma support
Differential Revision: https://reviews.llvm.org/D64584

llvm-svn: 365824
2019-07-11 21:19:33 +00:00
Martin Storsjo 6bd26db06a [COFF] Share the tail in delayimport symbol thunks
E.g. for x86_64, previously each symbol's thunk was 87 bytes. Now
there's a 12 byte thunk per symbol, plus a shared 83 byte tail
function.

This is similar to what both MS link.exe and GNU tools do for
delay imports.

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

llvm-svn: 365823
2019-07-11 21:19:11 +00:00
Vitaly Buka 07bfa5b870 CodeGen, NFC: Test for auto-init for 32bit pointers
llvm-svn: 365822
2019-07-11 20:51:59 +00:00
Alexey Bataev 8526031c5b [OPENMP]Improve handling of analysis of unsupported VLAs in reductions.
Fixed the processing of the unsupported VLAs in the reduction clauses.
Used targetDiag if the diagnostics can be delayed and emit it
immediately if the target does not support VLAs and we're parsing target
directive with the reduction clauses.

llvm-svn: 365821
2019-07-11 20:35:31 +00:00
Reid Kleckner f002fcb2ad Open native file handles to avoid converting from FDs, NFC
Follow up to r365588.

llvm-svn: 365820
2019-07-11 20:29:32 +00:00
Jonas Devlieghere f4af9a9d80 Add convenience methods to convert LLDB to LLVM data structures.
This patch adds two convenience methods named GetAsLLVM to the LLDB
counterparts of the DWARF DataExtractor and the DWARF context. The
DWARFContext, once created, is cached for future usage.

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

llvm-svn: 365819
2019-07-11 20:26:53 +00:00
David Bolvansky fcffa7c201 [UpdateTestChecks] Emit warning when invalid test paths
Summary:
Recently I ran into the following issue:

./update_test_checks.py /path/not-existing-file.ll

The script was silent and I was suprised why the real test file hadn't been updated.

Solution:
Emit warning if we detect this problem.



Reviewers: lebedev.ri, spatel, jdoerfert, nikic

Reviewed By: lebedev.ri, spatel, jdoerfert, nikic

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 365818
2019-07-11 20:14:22 +00:00
Jonas Hahnfeld 2dfc5179f6 [libomptarget-nvptx] Remove dead functions
These entry points are never called by Clang trunk nor clang-ykt. If
XL doesn't use them either, they can finally go away.

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

llvm-svn: 365817
2019-07-11 20:12:51 +00:00
Kostya Kortchinsky 8f18a4c980 [scudo][standalone] NFC corrections
Summary:
A few corrections:
- rename `TransferBatch::MaxCached` to `getMaxCached` to conform with
  the style guide;
- move `getBlockBegin` from `Chunk::` to `Allocator::`: I believe it
  was a fallacy to have this be a `Chunk` method, as chunks'
  relationship to backend blocks are up to the frontend allocator. It
  makes more sense now, particularly with regard to the offset. Update
  the associated chunk test as the method isn't available there
  anymore;
- add a forgotten `\n` to a log string;
- for `releaseToOs`, instead of starting at `1`, start at `0` and
  `continue` on `BatchClassId`: in the end it's identical but doesn't
  assume a particular class id for batches;
- change a `CHECK` to a `reportOutOfMemory`: it's a clearer message

Reviewers: hctim, morehouse, eugenis, vitalybuka

Reviewed By: hctim

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 365816
2019-07-11 19:55:53 +00:00
David Bolvansky 5dca95bc4e [NFC] Revisited tests for D64285
llvm-svn: 365815
2019-07-11 19:39:20 +00:00
Vedant Kumar 8bd5214726 Revert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"
This reverts commit 1af41074445229fea66b99710a850e5f42ecfa95.

llvm-svn: 365814
2019-07-11 19:28:07 +00:00
Raphael Isemann 2bc8ab6852 [lldb] Make TestDeletedExecutable more reliable
Summary:
It seems that calling Popen can return to the caller before the started process has read all the needed information
from its executable. This means that in case we delete the executable while the process is still starting up,
this test will create a zombie process which in turn leads to a failing test. On my macOS system this happens quite frequently.

This patch fixes this by letting the test synchronize with the inferior after it has started up.

Reviewers: davide

Reviewed By: davide

Subscribers: labath, friss, lldb-commits

Tags: #lldb

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

llvm-svn: 365813
2019-07-11 19:27:33 +00:00
Raphael Isemann 60b71ce0e4 [lldb] Don't use __FUNCTION__ as a file name
Summary:
I saw while debugging that we call this file `ParseInternal`, which is not a very good name for our
fake expression file and also adds this unnecessary link between the way we name this function
and the other source location names we get from the expression parser. This patch is renaming
it to `<lldb-expr>` which is closer to the way Clang names its buffers, it doesn't depend on the
function name (which changes when I refactor this code) and it's easier to grep for.

Reviewers: davide

Reviewed By: davide

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 365812
2019-07-11 19:26:55 +00:00
Benjamin Kramer eda5d870e9 [NVPTX] Remove now unused atomic.load.add.f32 intrinsics
llvm-svn: 365811
2019-07-11 19:21:59 +00:00
Jinsong Ji 84a2c78082 [PowerPC][NFC] Update testcase to avoid dead code
The original testcase might be optimized out due to dead code,
update the testcase to avoid it.

llvm-svn: 365810
2019-07-11 19:16:33 +00:00
Vedant Kumar bdf8198d4c [CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC
Replace a `llvm::Function *` parameter with a bool, which seems harder
to set to the wrong value by accident.

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

llvm-svn: 365809
2019-07-11 19:11:46 +00:00
Petr Hosek 08cb342afa [Driver] -noprofilelib flag
This flag is analoguous to other flags like -nostdlib or -nolibc
and could be used to disable linking of profile runtime library.
This is useful in certain environments like kernel, where profile
instrumentation is still desirable, but we cannot use the standard
runtime library.

llvm-svn: 365808
2019-07-11 19:06:38 +00:00
Bob Haarman 5011b83237 [lld-link] implement -thinlto-{prefix,object-suffix}-replace
Summary:
Adds the following two options to lld-link:

-thinlto-prefix-replace: allows replacing a prefix in paths generated
for ThinLTO. This can be used to ensure index files and native object
files are stored in unique directories, allowing multiple distributed
ThinLTO links to proceed concurrently.

-thinlto-object-suffix-replace: allows replacing a suffix in object
file paths involved in ThinLTO. This allows minimized index files to
be used for the thin link while storing the paths to the full bitcode
files for subsequent steps (code generation and final linking).

Reviewers: ruiu, tejohnson, pcc, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 365807
2019-07-11 18:48:58 +00:00
Julian Lettner 9d41429ff7 [TSan] Move DECLARE_REAL macro outside of namespace
This should fix the "undefined reference to
tsan::interception::real_setjmp" linker errors.

llvm-svn: 365806
2019-07-11 18:26:33 +00:00
Rainer Orth 9512c0a1d1 [profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARC
While working on https://reviews.llvm.org/D40900 (which effectively is about enabling compiler-rt on sparc these days), I came across two failing profile testcases:

  Profile-sparc :: instrprof-merge-match.test
  Profile-sparc :: instrprof-merge.c
  Profile-sparcv9 :: instrprof-merge-match.test
  Profile-sparcv9 :: instrprof-merge.c

All of them crashed with a SIGBUS in __llvm_profile_merge_from_buffer:

  Thread 2 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1 (LWP 1)]
  0x00012368 in __llvm_profile_merge_from_buffer (
      ProfileData=0x2384c <main.Buffer> "\377lprofR\201", ProfileSize=360)
      at /vol/llvm/src/llvm/local/projects/compiler-rt/lib/profile/InstrProfilingMerge.c:95
  95        SrcDataEnd = SrcDataStart + Header->DataSize;

where Header is insufficiently aligned for a strict-alignment target like SPARC.

Fixed by forcing the alignment to uint64_t, the members of struct __llvm_profile_header,
in the callers.

Tested on sparcv9-sun-solaris2.11.

https://reviews.llvm.org/D64498

llvm-svn: 365805
2019-07-11 18:26:24 +00:00
Jan Korous a286aae4d8 [clangd][NFC] Decrease template depth limit in RecursiveHierarchyUnbounded test
...to minimize the chance of stack overflow before reaching the limit.

llvm-svn: 365804
2019-07-11 18:21:21 +00:00
Craig Topper 83b380860d [X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC
llvm-svn: 365803
2019-07-11 18:19:27 +00:00
Wouter van Oortmerssen a617967d68 [WebAssembly] Assembler: support negative float constants.
Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 365802
2019-07-11 18:18:07 +00:00
Mitch Phillips af3dc759e7 Explicitly define __STDC_FORMAT_MACROS for PRIu64
Summary:
Builds are failing on RHEL machines because of PRIu64.

lvm/projects/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp:420:50: error: expected ')'

`snprintf(ThreadBuffer, kThreadBufferLen, "%" PRIu64, ThreadID);`
inttypes.h in RHEL uses PRIu64 macros only when __STDC_FORMAT_MACROS is defined.

Author: DTharun

Reviewers: hctim

Reviewed By: hctim

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

llvm-svn: 365801
2019-07-11 18:07:03 +00:00
Bob Haarman 63efb28f47 [lld-link] implement -thinlto-index-only
Summary:
This implements -thinlto-index-only, -thinlto-index-only:,
and -thinlto-emit-imports-files options in lld-link. They are
analogous to their counterparts in ld.lld: -thinlto-index-only
causes us to perform ThinLTO's thin link and write index files,
but not perform code generation. -thinlto-index-only: does the
same, but also writes a text file listing the native object
files expected to be generated. -thinlto-emit-imports-files
creates a text file next to each index file, listing the files
to import from.

Reviewers: ruiu, tejohnson, pcc, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 365800
2019-07-11 18:03:14 +00:00
Yaxun Liu 6add24adaf [HIP] Add GPU arch gfx1010, gfx1011, and gfx1012
Differential Revision: https://reviews.llvm.org/D64364

llvm-svn: 365799
2019-07-11 17:50:09 +00:00
Benjamin Kramer 3b5e60b695 [CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw fadd
llvm-svn: 365798
2019-07-11 17:44:11 +00:00
Nathan Huckleberry 83c94bfc0a [Docs] Add standardized header links to analyzer doc
Summary:
Header links should have some standard form so clang tidy
docs can easily reference them. The form is as follows.

Start with the analyzer full name including packages.
Replace all periods with dashes and lowercase everything.

Ex: core.CallAndMessage -> core-callandmessage

Reviewers: JonasToth, aaron.ballman, NoQ, Szelethus

Reviewed By: aaron.ballman, Szelethus

Subscribers: nickdesaulniers, lebedev.ri, baloghadamsoftware, mgrang, a.sidorin, Szelethus, jfb, donat.nagy, dkrupp, cfe-commits

Tags: #clang

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

llvm-svn: 365797
2019-07-11 17:12:05 +00:00
Benjamin Kramer fa1a4e4de5 [NVPTX] Use atomicrmw fadd instead of intrinsics
AutoUpgrade the old intrinsics to atomicrmw fadd.

llvm-svn: 365796
2019-07-11 17:11:25 +00:00