Jessica Paquette [Wed, 30 Jan 2019 20:58:14 +0000 (20:58 +0000)]
[GlobalISel] Add IRTranslator support for @llvm.sqrt -> G_FSQRT
Follow-up commit to https://reviews.llvm.org/D57359. (r352668)
This adds IRTranslator support for recognising a @llvm.sqrt intrinsic and
translating it into a G_FSQRT.
https://reviews.llvm.org/D57360
llvm-svn: 352670
Alexey Bataev [Wed, 30 Jan 2019 20:49:52 +0000 (20:49 +0000)]
[OPENMP]Fix PR40536: Do not emit __kmpc_push_target_tripcount if not
required.
Function __kmpc_push_target_tripcount should be emitted only if the
offloading entry is going to be emitted (for use in tgt_target...
functions). Otherwise, it should not be emitted.
llvm-svn: 352669
Jessica Paquette [Wed, 30 Jan 2019 20:49:50 +0000 (20:49 +0000)]
[GlobalISel] Introduce a G_FSQRT generic instruction
This introduces a generic instruction for computing the floating point
square root of a value.
Right now, we can't select @llvm.sqrt, so this is working towards fixing that.
llvm-svn: 352668
Sam Clegg [Wed, 30 Jan 2019 20:46:18 +0000 (20:46 +0000)]
[LTO] Set CGOptLevel in LTO config.
Previously we were never setting this which means it was always being
set to Default (-O2/-Os).
Differential Revision: https://reviews.llvm.org/D57422
llvm-svn: 352667
Wolfgang Pieb [Wed, 30 Jan 2019 20:37:14 +0000 (20:37 +0000)]
Reverting r352642 - Handle restore instructions in LiveDebugValues - as it's causing
assertions on some buildbots.
llvm-svn: 352666
Erik Pilkington [Wed, 30 Jan 2019 20:34:53 +0000 (20:34 +0000)]
Add a new builtin: __builtin_dynamic_object_size
This builtin has the same UI as __builtin_object_size, but has the
potential to be evaluated dynamically. It is meant to be used as a
drop-in replacement for libraries that use __builtin_object_size when
a dynamic checking mode is enabled. For instance,
__builtin_object_size fails to provide any extra checking in the
following function:
void f(size_t alloc) {
char* p = malloc(alloc);
strcpy(p, "foobar"); // expands to __builtin___strcpy_chk(p, "foobar", __builtin_object_size(p, 0))
}
This is an overflow if alloc < 7, but because LLVM can't fold the
object size intrinsic statically, it folds __builtin_object_size to
-1. With __builtin_dynamic_object_size, alloc is passed through to
__builtin___strcpy_chk.
rdar://
32212419
Differential revision: https://reviews.llvm.org/D56760
llvm-svn: 352665
Erik Pilkington [Wed, 30 Jan 2019 20:34:35 +0000 (20:34 +0000)]
Add a 'dynamic' parameter to the objectsize intrinsic
This is meant to be used with clang's __builtin_dynamic_object_size.
When 'true' is passed to this parameter, the intrinsic has the
potential to be folded into instructions that will be evaluated
at run time. When 'false', the objectsize intrinsic behaviour is
unchanged.
rdar://
32212419
Differential revision: https://reviews.llvm.org/D56761
llvm-svn: 352664
Stephen Kelly [Wed, 30 Jan 2019 20:06:52 +0000 (20:06 +0000)]
[ASTDump] Make method definition order matches declaration order
This will make follow-up changes easier to review.
llvm-svn: 352663
Philip Reames [Wed, 30 Jan 2019 20:06:24 +0000 (20:06 +0000)]
[Tests] Add tests for propagation of undef elements in vector GEPs
llvm-svn: 352662
Stephen Kelly [Wed, 30 Jan 2019 20:03:47 +0000 (20:03 +0000)]
[ASTDump] Re-arrange method declarations to group Visit together
This will make follow-up commits easier to review.
llvm-svn: 352661
Craig Topper [Wed, 30 Jan 2019 19:57:01 +0000 (19:57 +0000)]
[X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7.
This fixes the test case in PR35982 by preventing MMX instructions that read MM0-7 from being moved below EMMS/FEMMS by the post RA scheduler.
Though as discussed in bugzilla, this is not a complete fix. There is still the possibility of reordering in IR or by the pre-RA scheduler.
Differential Revision: https://reviews.llvm.org/D57298
llvm-svn: 352660
Nico Weber [Wed, 30 Jan 2019 19:53:58 +0000 (19:53 +0000)]
gn build: Set executable bit on get.py
llvm-svn: 352659
Petr Hosek [Wed, 30 Jan 2019 19:51:18 +0000 (19:51 +0000)]
Revert "[CMake] Use correct visibility for linked libraries in CMake"
This reverts commit r352654: this broke libcxx and sanitizer bots.
llvm-svn: 352658
Stephen Kelly [Wed, 30 Jan 2019 19:49:49 +0000 (19:49 +0000)]
[ASTDump] Rename methods which are conceptually Visits
This is consistent with the TextNodeDumper, and is the appropriate name
for the traverser class which will be extracted.
llvm-svn: 352657
Stephen Kelly [Wed, 30 Jan 2019 19:41:04 +0000 (19:41 +0000)]
[ASTDump] NFC: Inline vestigial methods
This was a porting aid.
llvm-svn: 352656
Stephen Kelly [Wed, 30 Jan 2019 19:32:48 +0000 (19:32 +0000)]
[ASTDump] Move Decl node dumping to TextNodeDumper
Reviewers: aaron.ballman
Subscribers: jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D57419
llvm-svn: 352655
Petr Hosek [Wed, 30 Jan 2019 19:27:26 +0000 (19:27 +0000)]
[CMake] Use correct visibility for linked libraries in CMake
When linking library dependencies, we shouldn't need to export linked
libraries to dependents. We should be explicit about this in
target_link_libraries, otherwise other targets that depend on these such
as sanitizers get repeated (and possibly even conflicting) dependencies.
Differential Revision: https://reviews.llvm.org/D57456
llvm-svn: 352654
Philip Reames [Wed, 30 Jan 2019 19:21:11 +0000 (19:21 +0000)]
SimplifyDemandedVectorElts for all intrinsics
The point is that this simplifies integration of new intrinsics into SimplifiedDemandedVectorElts, and ensures we don't miss any existing ones.
This is intended to be NFC-ish, but as seen from the diffs, can produce slightly different output. This is due to order of transforms w/in instcombine resulting in two slightly different fixed points. That's something we should fix, but isn't a problem w/this patch per se.
Differential Revision: https://reviews.llvm.org/D57398
llvm-svn: 352653
Wolfgang Pieb [Wed, 30 Jan 2019 19:15:43 +0000 (19:15 +0000)]
The test comitted with r348896 needed -march=x86=64 on the llc command line.
llvm-svn: 352651
Yonghong Song [Wed, 30 Jan 2019 19:13:16 +0000 (19:13 +0000)]
Revert "gn build: Add BPF target."
This reverts commit r352638.
The change in this patch is not trivial and it is merged
without component owner approval.
llvm-svn: 352649
Thomas Anderson [Wed, 30 Jan 2019 19:09:41 +0000 (19:09 +0000)]
[libc++] Explicitly initialize std::nothrow
When building on Windows without libc++abi, this change fixes a build error of the form:
src/new.cpp(38,17): error: chosen constructor is explicit in copy-initialization
const nothrow_t nothrow = {};
include/vcruntime_new.h(53,22): note: explicit constructor declared here
explicit nothrow_t() = default;
Differential Revision: https://reviews.llvm.org/D57351
llvm-svn: 352648
Thomas Anderson [Wed, 30 Jan 2019 19:08:32 +0000 (19:08 +0000)]
[libc++] Don't define operator new/delete when using vcruntime
Fixes build errors on Windows without libc++abi of the form:
new(173,36): error: redeclaration of 'operator delete' cannot add 'dllexport' attribute
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
vcruntime_new.h(87,16): note: previous declaration is here
void __CRTDECL operator delete(
new(205,70): error: redefinition of 'operator new'
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
vcruntime_new.h(184,28): note: previous definition is here
inline void* __CRTDECL operator new(size_t _Size, _Writable_bytes_(_Size) void* _Where) noexcept
new(206,70): error: redefinition of 'operator new[]'
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
vcruntime_new.h(199,28): note: previous definition is here
inline void* __CRTDECL operator new[](size_t _Size,
new(207,40): error: redefinition of 'operator delete'
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
vcruntime_new.h(190,27): note: previous definition is here
inline void __CRTDECL operator delete(void*, void*) noexcept
new(208,40): error: redefinition of 'operator delete[]'
inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT {}
vcruntime_new.h(206,27): note: previous definition is here
inline void __CRTDECL operator delete[](void*, void*) noexcept
Differential Revision: https://reviews.llvm.org/D57362
llvm-svn: 352647
Thomas Anderson [Wed, 30 Jan 2019 19:07:30 +0000 (19:07 +0000)]
[libc++] Don't define exception destructors when using vcruntime
Exception destructors are provided by vcruntime. Fixes link errors like:
lld-link: error: duplicate symbol: "public: virtual __cdecl std::invalid_argument::~invalid_argument(void)" (??1invalid_argument@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj)
lld-link: error: duplicate symbol: "public: virtual __cdecl std::length_error::~length_error(void)" (??1length_error@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj)
lld-link: error: duplicate symbol: "public: virtual __cdecl std::out_of_range::~out_of_range(void)" (??1out_of_range@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj)
lld-link: error: duplicate symbol: "public: virtual __cdecl std::overflow_error::~overflow_error(void)" (??1overflow_error@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj)
Differential Revision: https://reviews.llvm.org/D57425
llvm-svn: 352646
Sam Clegg [Wed, 30 Jan 2019 18:55:15 +0000 (18:55 +0000)]
[WebAssembly] Fix crash with LTO + relocatable + undefined symbols
Change the way we create the symbol table to be closer to how its done
on ELF. Now the output symbol table matches the internal symtab order
and includes local and undefined symbols.
Fixes PR40204
Differential Revision: https://reviews.llvm.org/D56947
llvm-svn: 352645
Jonas Devlieghere [Wed, 30 Jan 2019 18:51:40 +0000 (18:51 +0000)]
Add LLDB website and documentation in reStructuredText for Sphinx
The current LLDB website is written in HTML which is hard to maintain.
We have quite a bit of HTML code checked in which can make it hard to
differentiate between documentation written by us and documentation
generated by a tool.
In line with the other LLVM projects, I propose generating the
documentation with Sphix. I think text/rst files provide a lower barrier
for new or casual contributors to fix or update.
This patch adds a copy of the LLDB website and documentation in
reStructuredText. It also adds a new ninja target `docs-lldb-html` when
-DLLVM_ENABLE_SPHINX:BOOL is enabled.
This is the first step in having the website and documentation being
generated from the repository, rather than having the output checked-in
under the www folder. During the hopefully short transition period,
please also update the reStructuredText files when modifying the
website.
Differential revision: https://reviews.llvm.org/D55376
llvm-svn: 352644
Davide Italiano [Wed, 30 Jan 2019 18:40:05 +0000 (18:40 +0000)]
[Scalar] Remove partially wrong and unused functions.
I originally thought about fixing them, but hey, nobody is
using them anyway.
llvm-svn: 352643
Wolfgang Pieb [Wed, 30 Jan 2019 18:34:07 +0000 (18:34 +0000)]
[DEBUGINFO] Handle restore instructions in LiveDebugValues
The LiveDebugValues pass recognizes spills but not restores, which can
cause large gaps in location information for some variables, depending
on control flow. This patch make LiveDebugValues recognize restores and
generate appropriate DBG_VALUE instructions.
Reviewers: aprantl, NicolaPrica
Differential Revision: https://reviews.llvm.org/D57271
llvm-svn: 352642
Davide Italiano [Wed, 30 Jan 2019 18:24:16 +0000 (18:24 +0000)]
[Scalar] Hoist a duplicated (and sometimes wrong) comment.
Pointed out by Zachary and Adrian.
llvm-svn: 352641
Jordan Rupprecht [Wed, 30 Jan 2019 18:13:30 +0000 (18:13 +0000)]
[llvm-objcopy][NFC] More error propagation (linkToBuildIdDir)
llvm-svn: 352640
Davide Italiano [Wed, 30 Jan 2019 18:05:36 +0000 (18:05 +0000)]
[Scalar] Implement support for 512-bit values.
(useful, e.g. when reading 512-bits registers, a-la AVX-512).
<rdar://problem/
46886288>
llvm-svn: 352639
Peter Collingbourne [Wed, 30 Jan 2019 18:04:08 +0000 (18:04 +0000)]
gn build: Add BPF target.
Differential Revision: https://reviews.llvm.org/D57436
llvm-svn: 352638
Matt Arsenault [Wed, 30 Jan 2019 17:52:25 +0000 (17:52 +0000)]
GlobalISel: Add simpler way of always specifying custom lowering
llvm-svn: 352637
Matt Arsenault [Wed, 30 Jan 2019 17:52:23 +0000 (17:52 +0000)]
GlobalISel: Add assert that legalize mutation makes sense
I've repeatedly encountered bugs resulting from custom legalize
mutations returning nonsense legalize results, such as increasing the
number of elements for FewerElements. Add an assert function to make
sure the type to mutate to is consistent with the legalize action.
llvm-svn: 352636
Matt Arsenault [Wed, 30 Jan 2019 17:25:37 +0000 (17:25 +0000)]
AMDGPU: Stop generating unused intrinsic .inc files
llvm-svn: 352635
Simon Pilgrim [Wed, 30 Jan 2019 16:19:19 +0000 (16:19 +0000)]
[X86][AVX] Prefer to combine shuffle to broadcasts whenever possible
This is the first step towards improving broadcast support on AVX1 targets.
llvm-svn: 352634
Simon Pilgrim [Wed, 30 Jan 2019 16:15:59 +0000 (16:15 +0000)]
[utils] Fix update scripts output when run on python3.
This fixes a "bytes-like object is required, not 'str'" python3 error I hit on update_llc_test_checks.py (but present on the other scripts as well) by matching what update_mca_test_checks.py already does, plus I've added an explicit 'utf-8' encoding.
llvm-svn: 352633
Clement Courbet [Wed, 30 Jan 2019 16:02:20 +0000 (16:02 +0000)]
[llvm-exegesis] Add throughput mode.
Summary:
This just uses the latency benchmark runner on the parallel uops snippet
generator.
Fixes PR37698.
Reviewers: gchatelet
Subscribers: tschuett, RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D57000
llvm-svn: 352632
Roman Lebedev [Wed, 30 Jan 2019 15:41:20 +0000 (15:41 +0000)]
[ASTDumper][OpenMP] CapturedDecl has a 'nothrow' bit
Summary:
Was trying to understand how complicated it would be to write
a clang-tidy `openmp-exception-escape`-ish check once D57100 lands.
Just so it happens, all the data is already there,
it is just conveniently omitted from AST dump.
Reviewers: aaron.ballman, steveire, ABataev
Reviewed By: ABataev
Subscribers: ABataev, guansong, cfe-commits
Tags: #openmp, #clang
Differential Revision: https://reviews.llvm.org/D57452
llvm-svn: 352631
George Rimar [Wed, 30 Jan 2019 15:39:05 +0000 (15:39 +0000)]
[llvm-readobj] - Few minor cleanups. NFC.
Minor code simplifications, relocations,
renamings (to match LLVM style).
llvm-svn: 352630
Stefan Granitz [Wed, 30 Jan 2019 15:13:16 +0000 (15:13 +0000)]
[CMake] Accept entitlements for code signing in add_lldb_library()
Summary:
D57334 added entitlements support in `add_llvm_library()` so we can use it for library targets in LLDB.
Additionally this patch fixes the way that the entitlements argument is passed on from `add_lldb_executable()` to `add_llvm_executable()`. We still need the explicit parsing and passing on of single- and multi-value arguments as long as we are on CMake < 3.7 (due to bug https://gitlab.kitware.com/cmake/cmake/merge_requests/133).
Reviewers: beanz, JDevlieghere, aprantl
Reviewed By: JDevlieghere
Subscribers: mgorny, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D57378
llvm-svn: 352629
Stefan Granitz [Wed, 30 Jan 2019 15:10:08 +0000 (15:10 +0000)]
[CMake] Accept ENTITLEMENTS in llvm_add_library()
Summary: We added support for code signing entitlements in add_llvm_executable() with D54443. In the future it would be useful to have this functionality available also for libraries.
Reviewers: beanz, bogner
Reviewed By: bogner
Subscribers: mgorny, llvm-commits, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D57334
llvm-svn: 352628
Sanjay Patel [Wed, 30 Jan 2019 15:07:49 +0000 (15:07 +0000)]
[InstCombine][x86] add tests for addcarry intrinsic; NFC
llvm-svn: 352627
Jordan Rupprecht [Wed, 30 Jan 2019 14:58:13 +0000 (14:58 +0000)]
[llvm-objcopy] Support -X|--discard-locals.
Summary:
This adds support for the --discard-locals flag, which acts similarly to --discard-all, except it only applies to compiler-generated symbols (i.e. symbols starting with `.L` in ELF).
I am not sure about COFF local symbols: those appear to also use `.L` in most cases, but also use just `L` in other cases, so for now I am just leaving it unimplemented there.
Fixes PR36160
Reviewers: jhenderson, alexshap, jakehehrlich, mstorsjo, espindola
Reviewed By: jhenderson
Subscribers: llvm-commits, emaste, arichardson
Differential Revision: https://reviews.llvm.org/D57248
llvm-svn: 352626
Jordan Rupprecht [Wed, 30 Jan 2019 14:36:53 +0000 (14:36 +0000)]
[llvm-objcopy][NFC] More error propagation
Summary: Do some more error cleanup, removing some dependencies from llvm-objcopy's error/reportError in [ELF/COFF]Objcopy methods.
Reviewers: jhenderson, alexshap, jakehehrlich, mstorsjo, espindola
Subscribers: emaste, arichardson
Differential Revision: https://reviews.llvm.org/D57423
llvm-svn: 352625
Ilya Biryukov [Wed, 30 Jan 2019 14:24:17 +0000 (14:24 +0000)]
[clangd] Drop fixes if replying with tweaks resulted in an error
This should not happen in normal operation, as it implies that the diagnostics
with some available fixes were produced but the AST is invalid.
Moreover, the code had an error: always returned code actions ignoring the
SupportsCodeAction capability and writing a test for this is impossible,
since this can only happen due to programmer's error rather than invalid inputs.
llvm-svn: 352624
George Rimar [Wed, 30 Jan 2019 14:08:55 +0000 (14:08 +0000)]
[llvm-readobj] - Simplify the code.
We have a Field struct which has a StringRef member Str.
The code needs to create and keep alive the temporarily
std::string variables because of that.
That is not convenient and makes the code be more complicated
than it could be.
There seems to be no reason to keep Str be StringRef.
The patch changes it to be std::string and
rearranges the code around slightly.
Differential revision: https://reviews.llvm.org/D57447
llvm-svn: 352623
Ben Hamilton [Wed, 30 Jan 2019 13:54:32 +0000 (13:54 +0000)]
[clang-format] Fix line parsing for noexcept lambdas
Summary:
> $ echo "int c = [b]() mutable noexcept { return [&b] { return b++; }(); }();" |clang-format
```
int c = [b]() mutable noexcept {
return [&b] { return b++; }();
}
();
```
with patch:
> $ echo "int c = [b]() mutable noexcept { return [&b] { return b++; }(); }();" |bin/clang-format
```
int c = [b]() mutable noexcept { return [&b] { return b++; }(); }();
```
Contributed by hultman.
Reviewers: benhamilton, jolesiak, klimek, Wizard
Reviewed By: benhamilton
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56909
llvm-svn: 352622
Max Kazantsev [Wed, 30 Jan 2019 12:32:19 +0000 (12:32 +0000)]
Properly use DT.verify in LoopSimplifyCFG
llvm-svn: 352621
Yaxun Liu [Wed, 30 Jan 2019 12:26:54 +0000 (12:26 +0000)]
[HIP] Fix size_t for MSVC environment
In 64 bit MSVC environment size_t is defined as unsigned long long.
In single source language like HIP, data layout should be consistent
in device and host compilation, therefore copy data layout controlling
fields from Aux target for AMDGPU target.
Differential Revision: https://reviews.llvm.org/D56318
llvm-svn: 352620
Max Kazantsev [Wed, 30 Jan 2019 11:25:12 +0000 (11:25 +0000)]
Enable IRCE for narrow latch by defailt
llvm-svn: 352619
Eric Liu [Wed, 30 Jan 2019 11:24:04 +0000 (11:24 +0000)]
[OpenGL] Fix test on PPC after r352540
Summary:
Specify -triple like test/SemaOpenCL/logical-ops.cl. Otherwise, this test fails
on PPC.
Reviewers: bkramer
Subscribers: Anastasia, cfe-commits
Differential Revision: https://reviews.llvm.org/D57442
llvm-svn: 352618
Anastasia Stulova [Wed, 30 Jan 2019 11:18:08 +0000 (11:18 +0000)]
[OpenCL] Add generic addr space to the return of implicit assignment.
When creating the prototype of implicit assignment operators the
returned reference to the class should be qualified with the same
addr space as 'this' (i.e. __generic in OpenCL).
Differential Revision: https://reviews.llvm.org/D57101
llvm-svn: 352617
Shiva Chen [Wed, 30 Jan 2019 11:16:59 +0000 (11:16 +0000)]
[RISCV] Insert R_RISCV_ALIGN relocation type and Nops for code alignment when linker relaxation enabled
Linker relaxation may change code size. We need to fix up the alignment
of alignment directive in text section by inserting Nops and R_RISCV_ALIGN
relocation type. So then linker could satisfy the alignment by removing Nops.
To do this:
1. Add shouldInsertExtraNopBytesForCodeAlign target hook to calculate
the Nops we need to insert.
2. Add shouldInsertFixupForCodeAlign target hook to insert
R_RISCV_ALIGN fixup type.
Differential Revision: https://reviews.llvm.org/D47755
llvm-svn: 352616
Aleksandr Urakov [Wed, 30 Jan 2019 10:40:45 +0000 (10:40 +0000)]
[NativePDB] Fix access to both old & new fpo data entries from dbi stream
Summary:
This patch fixes access to fpo streams in native pdb from DbiStream and makes
code consistent with DbiStreamBuilder.
Patch By: leonid.mashinskiy
Reviewers: zturner, aleksandr.urakov
Reviewed By: zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56725
llvm-svn: 352615
Douglas Yung [Wed, 30 Jan 2019 09:49:39 +0000 (09:49 +0000)]
Add lit config file to skip tests if WebAssembly target is not available.
llvm-svn: 352614
Dmitry Venikov [Wed, 30 Jan 2019 09:49:25 +0000 (09:49 +0000)]
Commit tests for changes in revision D41342
llvm-svn: 352613
Ilya Biryukov [Wed, 30 Jan 2019 09:39:01 +0000 (09:39 +0000)]
[clangd] Fix a use after move
Introduced in r352494.
llvm-svn: 352612
Joachim Protze [Wed, 30 Jan 2019 08:41:06 +0000 (08:41 +0000)]
[OMPT] Make sure that OMPT is enabled when accessing internals of the runtime
Redo after revert by hans. The wrong include in one test is fixed.
Make sure that OMPT is enabled in runtime entry points that access internals
of the runtime. Else, return an appropiate value indicating an error or that
the data is not available.
Patch provided by @sconvent
Reviewers: jlpeyton, omalyshe, hbae, Hahnfeld, joachim.protze
Reviewed By: joachim.protze
Tags: #openmp, #ompt
Differential Revision: https://reviews.llvm.org/D47717
llvm-svn: 352611
Michal Gorny [Wed, 30 Jan 2019 08:20:24 +0000 (08:20 +0000)]
[clang] [Driver] [NetBSD] Append -rpath for shared compiler-rt runtimes
Append appropriate -rpath when using shared compiler-rt runtimes,
e.g. '-fsanitize=address -shared-libasan'. There's already a similar
logic in CommonArgs.cpp but it uses non-standard arch-suffixed
installation directory while we want our driver to work with standard
installation paths.
Differential Revision: https://reviews.llvm.org/D57303
llvm-svn: 352610
Craig Topper [Wed, 30 Jan 2019 08:04:06 +0000 (08:04 +0000)]
[X86] Remove unnecessary code from the top of handleCompareFP in X86FloatingPoint.cpp.
There were checks to ensure some tables were sorted, but those tables aren't used by this function. The same tables are checked in the function that does use them. Maybe this was copy/pasted?
llvm-svn: 352609
Craig Topper [Wed, 30 Jan 2019 07:33:24 +0000 (07:33 +0000)]
[X86] Remove a couple places where we unnecessarily pass 0 to the EmitPriority of some FP instruction aliases. NFC
As far as I can tell we already won't emit these aliases due to an operand count check in the tablegen code. Removing these because I couldn't make sense of the inconsistency between fadd and fmul from reading the code.
I checked the AsmMatcher and AsmWriter files before and after this change and there were no differences.
llvm-svn: 352608
Craig Topper [Wed, 30 Jan 2019 07:08:44 +0000 (07:08 +0000)]
[X86] Add FPSW as a Def on some FP instructions that were missing it.
llvm-svn: 352607
Dimitry Andric [Wed, 30 Jan 2019 06:31:52 +0000 (06:31 +0000)]
Recognize FreeBSD specific BFD names in OUTPUT_FORMAT
Summary:
After rLLD344952 ("Add OUTPUT_FORMAT linker script directive support"),
using BFD names such as `elf64-x86-64-freebsd` the `OUTPUT_FORMAT`
linker script command does not work anymore, resulting in errors like:
```
ld: error: /home/dim/src/clang800-import/stand/efi/loader/arch/amd64/ldscript.amd64:2: unknown output format name: elf64-x86-64-freebsd
>>> OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd")
>>> ^
```
To fix this, recognize a `-freebsd` suffix in BFD names, and also set
`Configuration::OSABI` to `ELFOSABI_FREEBSD` for those cases.
Add and/or update several test cases to check for the correct results of
these new `OUTPUT_FORMAT` arguments.
Reviewers: ruiu, atanasyan, grimar, hokein, emaste, espindola
Reviewed By: ruiu
Subscribers: nemanjai, javed.absar, arichardson, krytarowski, kristof.beyls, kbarton, llvm-commits
Differential Revision: https://reviews.llvm.org/D57283
llvm-svn: 352606
Jonas Devlieghere [Wed, 30 Jan 2019 06:26:26 +0000 (06:26 +0000)]
[ModuleDependencyCollector] Use llvm::sys::fs::real_path (NFC)
Use the real_path implementation from llvm::sys::fs::real_path instead
of having a custom implementation in the ModuleDependencyCollector.
Differential revision: https://reviews.llvm.org/D57411
llvm-svn: 352605
Kostya Serebryany [Wed, 30 Jan 2019 06:21:20 +0000 (06:21 +0000)]
[libFuzzer] remove stale code, NFC
llvm-svn: 352604
Kostya Serebryany [Wed, 30 Jan 2019 06:15:52 +0000 (06:15 +0000)]
[libFuzzer] refactor the handling of instrumentation counters so that they are grouped in regions one full page each. Needed for future optimization. NFC
llvm-svn: 352603
Hiroshi Inoue [Wed, 30 Jan 2019 05:26:31 +0000 (05:26 +0000)]
[NFC] fix trivial typos in comments
llvm-svn: 352602
Matt Arsenault [Wed, 30 Jan 2019 04:19:31 +0000 (04:19 +0000)]
GlobalISel: Implement fewerElementsVector for select
llvm-svn: 352601
Craig Topper [Wed, 30 Jan 2019 03:43:41 +0000 (03:43 +0000)]
[IR] Use CallBase to simplify some code
Summary:
This patch does the following to simplify the asm-goto patch
-Move isInlineAsm from CallInst to CallBase to share with CallBrInst in the asm-goto patch.
-Forward CallSite's data_operands_begin()/data_operands_end() to CallBase's implementation.
-Forward CallSite's getOperandBundlesAsDefs to CallBase.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: nickdesaulniers, llvm-commits
Differential Revision: https://reviews.llvm.org/D57415
llvm-svn: 352600
Matt Arsenault [Wed, 30 Jan 2019 03:36:25 +0000 (03:36 +0000)]
AMDGPU/GlobalISel: Fix clamping shifts with 16-bit insts
llvm-svn: 352599
Heejin Ahn [Wed, 30 Jan 2019 03:21:57 +0000 (03:21 +0000)]
[WebAssembly] Exception handling: Switch to the new proposal
Summary:
This switches the EH implementation to the new proposal:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md
(The previous proposal was
https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions.md)
- Instruction changes
- Now we have one single `catch` instruction that returns a except_ref
value
- `throw` now can take variable number of operations
- `rethrow` does not have 'depth' argument anymore
- `br_on_exn` queries an except_ref to see if it matches the tag and
branches to the given label if true.
- `extract_exception` is a pseudo instruction that simulates popping
values from wasm stack. This is to make `br_on_exn`, a very special
instruction, work: `br_on_exn` puts values onto the stack only if it
is taken, and the # of values can vay depending on the tag.
- Now there's only one `catch` per `try`, this patch removes all special
handling for terminate pad with a call to `__clang_call_terminate`.
Before it was the only case there are two catch clauses (a normal
`catch` and `catch_all` per `try`).
- Make `rethrow` act as a terminator like `throw`. This splits BB after
`rethrow` in WasmEHPrepare, and deletes an unnecessary `unreachable`
after `rethrow` in LateEHPrepare.
- Now we stop at all catchpads (because we add wasm `catch` instruction
that catches all exceptions), this creates new
`findWasmUnwindDestinations` function in SelectionDAGBuilder.
- Now we use `br_on_exn` instrution to figure out if an except_ref
matches the current tag or not, LateEHPrepare generates this sequence
for catch pads:
```
catch
block i32
br_on_exn $__cpp_exception
end_block
extract_exception
```
- Branch analysis for `br_on_exn` in WebAssemblyInstrInfo
- Other various misc. changes to switch to the new proposal.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D57134
llvm-svn: 352598
Matt Arsenault [Wed, 30 Jan 2019 02:57:43 +0000 (02:57 +0000)]
GlobalISel: Use appropriate extension for legalizing select conditions
llvm-svn: 352597
Zi Xuan Wu [Wed, 30 Jan 2019 02:56:22 +0000 (02:56 +0000)]
[PowerPC] [NFC] Create a helper function to copy register to particular register class at PPCFastISel
Make copy register code as common function as following.
unsigned copyRegToRegClass(const TargetRegisterClass *ToRC, unsigned SrcReg, unsigned Flag = 0, unsigned SubReg = 0);
Differential Revision: https://reviews.llvm.org/D57368
llvm-svn: 352596
James Y Knight [Wed, 30 Jan 2019 02:54:28 +0000 (02:54 +0000)]
Cleanup: replace uses of CallSite with CallBase.
llvm-svn: 352595
Matt Arsenault [Wed, 30 Jan 2019 02:35:38 +0000 (02:35 +0000)]
GlobalISel: Support narrowScalar for uneven loads
llvm-svn: 352594
Richard Smith [Wed, 30 Jan 2019 02:23:34 +0000 (02:23 +0000)]
Simplify and modernize this code a little.
No functionality change intended.
llvm-svn: 352593
Thomas Lively [Wed, 30 Jan 2019 02:23:29 +0000 (02:23 +0000)]
[WebAssembly] Optimize BUILD_VECTOR lowering for size
Summary:
Implements custom lowering logic that finds the optimal value for the
initial splat of the vector and either uses it or uses v128.const if
it is available and if it would produce smaller code. This logic
replaces large TableGen ISEL patterns that would lower all non-splat
BUILD_VECTORs into a splat followed by a fixed number of replace_lane
instructions. This CL fixes PR39685.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56633
llvm-svn: 352592
Matt Arsenault [Wed, 30 Jan 2019 02:22:13 +0000 (02:22 +0000)]
GlobalISel: Handle some odd splits in fewerElementsVector
Also add some quick hacks to AMDGPU legality for the tests.
llvm-svn: 352591
Nico Weber [Wed, 30 Jan 2019 02:17:27 +0000 (02:17 +0000)]
lld/coff: Implement some support for the comdat selection field
LLD used to handle comdats as if the selection field was always set to
IMAGE_COMDAT_SELECT_ANY. This means for obj files produced by `cl /Gy`, LLD
would never report a duplicate symbol error.
This change:
- adds validation for the Selection field (should make no difference in
practice for compiler-generated obj inputs)
- rejects comdats that have different Selection fields in different obj files
(likewise). This is a bit more strict but also more self-consistent thank
link.exe (see comment in code)
- implements handling for all the selection kinds
In practice, compilers only generate comdats with
IMAGE_COMDAT_SELECT_NODUPLICATES (LLD now produces duplicate symbol errors for
these), IMAGE_COMDAT_SELECT_ANY (no behavior change), and
IMAGE_COMDAT_SELECT_LARGEST (for RTTI data; here LLD should no longer create
broken executables when linking some TUs with RTTI enabled and some with it
disabled – but see below).
The implementation of `IMAGE_COMDAT_SELECT_LARGEST` is incomplete: If one
SELECT_LARGEST comdat replaces an earlier one, the comdat symbol is replaced
correctly, but the old section stays loaded and if /opt:ref is disabled (via
/opt:noref or /debug) it's still written to the output. That's not ideal, but
better than the current treatment of just picking any one of those comdats. I
hope to fix this better later.
Fixes most of PR40094.
Differential Revision: https://reviews.llvm.org/D57324
llvm-svn: 352590
Nico Weber [Wed, 30 Jan 2019 02:15:08 +0000 (02:15 +0000)]
lld-link: Add test I forgot to add in 332012
Differential Revision: https://reviews.llvm.org/D46693
llvm-svn: 352589
George Karpenkov [Wed, 30 Jan 2019 02:11:04 +0000 (02:11 +0000)]
[analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of Objective-C methods
Differential Revision: https://reviews.llvm.org/D57433
llvm-svn: 352588
Sam Clegg [Wed, 30 Jan 2019 02:08:34 +0000 (02:08 +0000)]
Add enum values to CodeGenOpt::Level
The absolute values of this enum are important at least in that
they get printed by SelectionDAGISel. e.g:
`Before: -O2 ; After: -O0`
Differential Revision: https://reviews.llvm.org/D57430
llvm-svn: 352587
Petr Hosek [Wed, 30 Jan 2019 02:06:06 +0000 (02:06 +0000)]
[CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard
Turned out this is used by Flutter which uses Fuchsia Clang toolchain.
Differential Revision: https://reviews.llvm.org/D57432
llvm-svn: 352586
Matt Arsenault [Wed, 30 Jan 2019 02:04:31 +0000 (02:04 +0000)]
GlobalISel: Handle more cases for widenScalar for G_STORE
llvm-svn: 352585
Petr Hosek [Wed, 30 Jan 2019 02:02:25 +0000 (02:02 +0000)]
[CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia
In addition to libc++abi and libc++, we also want to use hermetic
static libunwind on Fuchsia.
Differential Revision: https://reviews.llvm.org/D57431
llvm-svn: 352584
Chen Zheng [Wed, 30 Jan 2019 01:57:01 +0000 (01:57 +0000)]
[PowerPC] more opportunity for converting reg+reg to reg+imm
Differential Revision: https://reviews.llvm.org/D57314
llvm-svn: 352583
Matt Arsenault [Wed, 30 Jan 2019 01:10:47 +0000 (01:10 +0000)]
Add 8.0 release bug to merge request script
llvm-svn: 352579
Matt Arsenault [Wed, 30 Jan 2019 01:10:42 +0000 (01:10 +0000)]
GlobalISel: Verify memory size for load/store
llvm-svn: 352578
Kostya Serebryany [Wed, 30 Jan 2019 00:36:28 +0000 (00:36 +0000)]
[libFuzzer] update a test
llvm-svn: 352577
George Burgess IV [Wed, 30 Jan 2019 00:28:56 +0000 (00:28 +0000)]
Remove a redundant space from an error message; NFC
llvm-svn: 352576
Sam Clegg [Wed, 30 Jan 2019 00:25:52 +0000 (00:25 +0000)]
[WebAssembly] Fix undefined weak function symbols in LTO builds
Summary: Fixes PR40219
Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D57420
llvm-svn: 352575
Aaron Puchert [Wed, 30 Jan 2019 00:18:24 +0000 (00:18 +0000)]
Fix thread safety tests after r352549
llvm-svn: 352574
Sam Clegg [Wed, 30 Jan 2019 00:15:48 +0000 (00:15 +0000)]
[WebAssembly] Add missing SymbolRef update from rL352551
This change broke some MC tests which are now fixed.
Differential Revision: https://reviews.llvm.org/D57424
llvm-svn: 352573
Artem Dergachev [Wed, 30 Jan 2019 00:06:43 +0000 (00:06 +0000)]
[analyzer] NFC: GenericTaintChecker: Revise rule specification mechanisms.
Provide a more powerful and at the same time more readable way of specifying
taint propagation rules for known functions within the checker.
Now it should be possible to specify an unlimited amount of source and
destination parameters for taint propagation.
No functional change intended just yet.
Patch by Gábor Borsik!
Differential Revision: https://reviews.llvm.org/D55734
llvm-svn: 352572
Kostya Serebryany [Tue, 29 Jan 2019 23:53:28 +0000 (23:53 +0000)]
[libFuzzer] remove stale code
llvm-svn: 352571
Jonas Devlieghere [Tue, 29 Jan 2019 23:48:53 +0000 (23:48 +0000)]
Add FileCollector + test to Xcode project.
llvm-svn: 352570
Thomas Lively [Tue, 29 Jan 2019 23:44:48 +0000 (23:44 +0000)]
[WebAssembly] Lower SCALAR_TO_VECTOR to splats
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish
Differential Revision: https://reviews.llvm.org/D57269
llvm-svn: 352568
Kostya Serebryany [Tue, 29 Jan 2019 23:41:50 +0000 (23:41 +0000)]
[libFuzzer] revert an accidental commit
llvm-svn: 352567
Kostya Serebryany [Tue, 29 Jan 2019 23:40:05 +0000 (23:40 +0000)]
[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]
llvm-svn: 352566
Matt Arsenault [Tue, 29 Jan 2019 23:38:42 +0000 (23:38 +0000)]
GlobalISel: Fix unused variable warning in release builds
llvm-svn: 352565