Jordan Rupprecht [Mon, 7 Jan 2019 16:59:12 +0000 (16:59 +0000)]
[llvm-objcopy] Handle -O <format> flag.
Summary:
The -O flag is currently being mostly ignored; it's only checked whether or not the output format is "binary". This adds support for a few formats (e.g. elf64-x86-64), so that when specified, the output can change between 32/64 bit and sizes/alignments are updated accordingly.
This fixes PR39135
Reviewers: jakehehrlich, jhenderson, alexshap, espindola
Reviewed By: jhenderson
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D53667
llvm-svn: 350541
Ilya Biryukov [Mon, 7 Jan 2019 16:55:59 +0000 (16:55 +0000)]
[clangd] Include <cstdio> instead of <stdio.h>. NFC
This fixes the only clang-tidy check currently enabled by clangd.
llvm-svn: 350540
Louis Dionne [Mon, 7 Jan 2019 16:54:02 +0000 (16:54 +0000)]
[NFC] Fix formatting of README.md for better rendering
Reviewed as https://reviews.llvm.org/D56051.
llvm-svn: 350539
Stefan Granitz [Mon, 7 Jan 2019 16:43:04 +0000 (16:43 +0000)]
[CMake] Fix standalone builds: make dependency to LLVM's `count` conditional
Summary:
In standalone builds of LLDB we currently have no target `count` that tests can depend on. This may be fixed in the future by exporting the target from LLVM similar to targets llvm-config, dsymutil and others.
In-tree build with this patch:
```
$ ninja -t query tools/lldb/lit/check-lldb-lit
tools/lldb/lit/check-lldb-lit:
input: phony
tools/lldb/lit/CMakeFiles/check-lldb-lit
bin/FileCheck
bin/clang
bin/count
bin/darwin-debug
bin/debugserver
bin/dsymutil
bin/llc
bin/lldb
bin/lldb-mi
bin/lldb-server
bin/lldb-test
bin/llvm-config
bin/llvm-mc
bin/llvm-objcopy
bin/not
bin/yaml2obj
lib/liblldb.dylib
projects/libcxx/lib/cxx
tools/lldb/unittests/LLDBUnitTests
outputs:
tools/lldb/test/check-lldb
check-lldb-lit
```
Standalone build with this patch:
```
$ ninja -t query lit/check-lldb-lit
lit/check-lldb-lit:
input: phony
lit/CMakeFiles/check-lldb-lit
bin/darwin-debug
bin/debugserver
bin/lldb
bin/lldb-mi
bin/lldb-server
bin/lldb-test
lib/liblldb.dylib
unittests/LLDBUnitTests
outputs:
test/check-lldb
check-lldb-lit
```
Reviewers: davide, aprantl, JDevlieghere, alexshap
Reviewed By: davide
Subscribers: mgorny, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D56389
llvm-svn: 350538
Adrian Prantl [Mon, 7 Jan 2019 16:27:52 +0000 (16:27 +0000)]
Simplify testcase by using lldbutil.run_to_source_breakpoint()
llvm-svn: 350537
David Greene [Mon, 7 Jan 2019 16:24:37 +0000 (16:24 +0000)]
[lit] Respect PYTHONPATH
If a user has PYTHONPATH set in the environment, append new entries to
it rather than blindly setting PYTHONPATH to a fixed string. This
allows tests to, for example, find psutil if it is in
PYTHONPATH. Without this change, lit will detect psutil but then
various tests will fail because PYTHONPATH has been overwritten and
psutil cannot be found.
llvm-svn: 350536
Marshall Clow [Mon, 7 Jan 2019 16:17:52 +0000 (16:17 +0000)]
Add the feature test macros that were defined in p1353r0 to the headers of the appropriate tests. No actual tests yet, so NFC.
llvm-svn: 350535
Matt Morehouse [Mon, 7 Jan 2019 16:14:00 +0000 (16:14 +0000)]
[llvm-demangle-fuzzer] Also fuzz microsoftDemangle().
Summary:
Use first byte of input to determine whether to call itaniumDemangle()
or microsoftDemangle().
Addresses https://bugs.llvm.org/show_bug.cgi?id=39582.
Reviewers: kcc, thakis
Reviewed By: kcc, thakis
Subscribers: mgorny, thakis, erik.pilkington, llvm-commits
Differential Revision: https://reviews.llvm.org/D54780
llvm-svn: 350534
Sanjay Patel [Mon, 7 Jan 2019 16:10:14 +0000 (16:10 +0000)]
[x86] add more tests for LowerToHorizontalOp(); NFC
These tests show missed optimizations and a miscompile
similar to PR40243 - https://bugs.llvm.org/show_bug.cgi?id=40243
llvm-svn: 350533
Rhys Perry [Mon, 7 Jan 2019 15:52:28 +0000 (15:52 +0000)]
AMDGPU: test for uniformity of branch instruction, not its condition
Summary:
If a divergent branch instruction is marked as divergent by propagation
rule 2 in DivergencePropagator::exploreSyncDependency() and its condition
is uniform, that branch would incorrectly be assumed to be uniform.
Reviewers: arsenm, tstellar
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D56331
llvm-svn: 350532
Ilya Biryukov [Mon, 7 Jan 2019 15:45:19 +0000 (15:45 +0000)]
[clangd] Remove 'using namespace llvm' from .cpp files. NFC
The new guideline is to qualify with 'llvm::' explicitly both in
'.h' and '.cpp' files. This simplifies moving the code between
header and source files and is easier to keep consistent.
llvm-svn: 350531
Alexey Bataev [Mon, 7 Jan 2019 15:45:09 +0000 (15:45 +0000)]
[OPENMP][NVPTX]Reduce number of barriers in reductions.
After the fix for the syncthreads we don't need to generate extra
barriers for the parallel reductions.
llvm-svn: 350530
Benjamin Kramer [Mon, 7 Jan 2019 15:22:08 +0000 (15:22 +0000)]
[Sema] Fix unused variable warning in Release builds
llvm-svn: 350529
Rafael Stahl [Mon, 7 Jan 2019 15:07:01 +0000 (15:07 +0000)]
[analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore
Summary: The LocationE parameter of evalStore is documented as "The location expression that is stored to". When storing from an increment / decrement operator this was not satisfied. In user code this causes an inconsistency between the SVal and Stmt parameters of checkLocation.
Reviewers: NoQ, dcoughlin, george.karpenkov
Reviewed By: NoQ
Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D55701
llvm-svn: 350528
Bruno Ricci [Mon, 7 Jan 2019 15:04:45 +0000 (15:04 +0000)]
[AST] Store some data of CXXNewExpr as trailing objects
Store the optional array size expression, optional initialization expression
and optional placement new arguments in a trailing array. Additionally store
the range for the parenthesized type-id in a trailing object if needed since
in the vast majority of cases the type is not parenthesized (not a single new
expression in the translation unit of SemaDecl.cpp has a parenthesized type-id).
This saves 2 pointers per CXXNewExpr in all cases, and 2 pointers + 8 bytes
per CXXNewExpr in the common case where the type is not parenthesized.
Differential Revision: https://reviews.llvm.org/D56134
Reviewed By: rjmccall
llvm-svn: 350527
Hyrum Wright [Mon, 7 Jan 2019 14:36:47 +0000 (14:36 +0000)]
[clang-tidy] Use the public hasInit matcher, rather than defining our own, NFC
llvm-svn: 350526
Bruno Ricci [Mon, 7 Jan 2019 14:27:04 +0000 (14:27 +0000)]
[AST][NFC] Pack DependentScopeDeclRefExpr and CXXUnresolvedConstructExpr
Use the newly available space in the bit-fields of Stmt.
This saves 1 pointer per DependentScopeDeclRefExpr/CXXUnresolvedConstructExpr.
Additionally rename "TypeSourceInfo *Type;" to "TypeSourceInfo *TSI;"
as was done in D56022 (r350003) (but this is an internal detail anyway),
and clang-format both classes. NFC.
llvm-svn: 350525
Alexey Bataev [Mon, 7 Jan 2019 14:25:25 +0000 (14:25 +0000)]
[OPENMP][NVPTX]Fix dynamic scheduling.
Summary:
Previous implementation may cause the runtime crash when the number of
teams is > 1024. Patch fixes this problem + reduces number of the atomic
operations by 32 times.
Reviewers: grokos, gtbercea, kkwli0
Subscribers: guansong, jfb, openmp-commits, caomhin
Differential Revision: https://reviews.llvm.org/D56332
llvm-svn: 350524
Hyrum Wright [Mon, 7 Jan 2019 14:14:36 +0000 (14:14 +0000)]
[clang] Add AST matcher for initializer list members
Summary:
Much like hasArg for various call expressions, this allows LibTooling users to
match against a member of an initializer list.
This is currently being used as part of the abseil-duration-scale clang-tidy
check.
Differential Revision: https://reviews.llvm.org/D56090
llvm-svn: 350523
James Henderson [Mon, 7 Jan 2019 14:12:51 +0000 (14:12 +0000)]
[llvm-nm] Add --portability as alias for --format=posix
GNU nm supports this alias, so supporting it in llvm-nm makes it easier
to transition between the two.
Fixes https://bugs.llvm.org/show_bug.cgi?id=40002
Reviewed by: mstorsjo, rupprecht
Differential Revision: https://reviews.llvm.org/D56312
llvm-svn: 350522
Gabor Marton [Mon, 7 Jan 2019 14:05:19 +0000 (14:05 +0000)]
[CTU] Make loadExternalAST return with non nullptr on success
Summary:
In loadExternalAST we return with either an error or with a valid
ASTUnit pointer which should not be a nullptr.
This prevents in the call site any superfluous check for being a nullptr.
Reviewers: xazax.hun, a_sidorin, Szelethus, balazske
Subscribers: rnkovacs, dkrupp, gamesh411, cfe-commits
Differential Revision: https://reviews.llvm.org/D55280
llvm-svn: 350521
Alexandre Ganea [Mon, 7 Jan 2019 13:53:16 +0000 (13:53 +0000)]
[CodeView] More appropriate name and type for a Microsoft precompiled headers parameter. NFC
llvm-svn: 350520
Bruno Ricci [Mon, 7 Jan 2019 13:39:26 +0000 (13:39 +0000)]
[AST][NFC] Pack OpaqueValueExpr
Use the newly available space in the bit-fields of Stmt.
This saves 1 pointer per OpaqueValueExpr. NFC.
llvm-svn: 350519
Matt Arsenault [Mon, 7 Jan 2019 13:31:55 +0000 (13:31 +0000)]
AMDGPU: Remove v16i8 from register classes
llvm-svn: 350518
Matt Arsenault [Mon, 7 Jan 2019 13:21:36 +0000 (13:21 +0000)]
AMDGPU: Remove VS/SV mappings from select
These would violate the constant bus restriction
llvm-svn: 350517
Martin Probst [Mon, 7 Jan 2019 13:12:50 +0000 (13:12 +0000)]
clang-format: [JS] support goog.requireType.
Summary:
It's a new primitive for importing symbols, and should be treated like
the (previously handled) `goog.require` and `goog.forwardDeclare`.
Reviewers: krasimir
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56385
llvm-svn: 350516
Haojian Wu [Mon, 7 Jan 2019 12:35:02 +0000 (12:35 +0000)]
[clangd] Fix a regression issue caused by r348365.
Summary:
With r348365, we now detect libc++ dir using the actual compiler path
(from the compilation command), rather than the resource-dir.
This new behavior will cause clangd couldn't find libc++ dir (even the libc++ is
built from the source) when using a fallback compilation command (`clang xxx`)
The fix is to use `<clangd_install_dir>/clang` as the actual compiler path.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D56380
llvm-svn: 350515
Simon Pilgrim [Mon, 7 Jan 2019 12:21:13 +0000 (12:21 +0000)]
Regenerate test.
Prep work towards enabling SimplifyDemandedBits vector support for TRUNCATE as discussed on D56118.
llvm-svn: 350514
Simon Pilgrim [Mon, 7 Jan 2019 12:20:35 +0000 (12:20 +0000)]
Regenerate test.
Prep work towards enabling SimplifyDemandedBits vector support for TRUNCATE as discussed on D56118.
llvm-svn: 350513
Ilya Biryukov [Mon, 7 Jan 2019 11:18:11 +0000 (11:18 +0000)]
[clangd] Disable BackgroundIndexTest.PeriodicalIndex
It sometimes fails on AArch64.
llvm-svn: 350512
Pavel Labath [Mon, 7 Jan 2019 11:14:08 +0000 (11:14 +0000)]
ObjectFileBreakpad: Implement sections
Summary:
This patch allows ObjectFileBreakpad to parse the contents of Breakpad
files into sections. This sounds slightly odd at first, but in essence
its not too different from how other object files handle things. For
example in elf files, the symtab section consists of a number of
"records", where each record represents a single symbol. The same is
true for breakpad's PUBLIC section, except in this case, the records will be
textual instead of binary.
To keep sections contiguous, I create a new section every time record
type changes. Normally, the breakpad processor will group all records of
the same type in one block, but the format allows them to be intermixed,
so in general, the "object file" may contain multiple sections with the
same record type.
Reviewers: clayborg, zturner, lemo, markmentovai, amccarth
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D55434
llvm-svn: 350511
Pavel Labath [Mon, 7 Jan 2019 10:59:57 +0000 (10:59 +0000)]
ProcessLaunchInfo: remove Debugger reference
Summary:
The Debuffer object was being used in "GetListenerForProcess" to provide
a default listener object if one was not specified in the launch_info
object.
Since all the callers of this function immediately passed the result to
Target::CreateProcess, it was easy to move this logic there instead.
This brings us one step closer towards being able to move the LaunchInfo
classes to the Host layer (which is there the launching code that
consumes them lives).
Reviewers: zturner, jingham, teemperor
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D56174
llvm-svn: 350510
Chandler Carruth [Mon, 7 Jan 2019 07:31:49 +0000 (07:31 +0000)]
[CallSite removal] Move the rest of IR implementation code away from
`CallSite`.
With this change, the remaining `CallSite` usages are just for
implementing the wrapper type itself.
This does update the C API but leaves the names of that API alone and
only updates their implementation.
Differential Revision: https://reviews.llvm.org/D56184
llvm-svn: 350509
Chandler Carruth [Mon, 7 Jan 2019 07:15:51 +0000 (07:15 +0000)]
[CallSite removal] Port `IndirectCallSiteVisitor` to use `CallBase` and
update client code.
Also rename it to use the more generic term `call` instead of something
that could be confused with a praticular type.
Differential Revision: https://reviews.llvm.org/D56183
llvm-svn: 350508
Chandler Carruth [Mon, 7 Jan 2019 07:02:34 +0000 (07:02 +0000)]
[CallSite removal] Move the verifier to use `CallBase` instead of the
`CallSite` wrapper.
Mostly mechanical, but I've tried to tidy up code where it made sense to
do so.
Differential Revision: https://reviews.llvm.org/D56143
llvm-svn: 350507
Craig Topper [Mon, 7 Jan 2019 06:01:58 +0000 (06:01 +0000)]
[X86] Update VBMI2 vshld/vshrd tests to use an immediate that doesn't require a modulo.
Planning to replace these with funnel shift intrinsics which would mask out the extra bits. This will help minimize test diffs.
llvm-svn: 350506
Richard Smith [Mon, 7 Jan 2019 06:00:46 +0000 (06:00 +0000)]
DR674, PR38883, PR40238: Qualified friend lookup should look for a
template specialization if there is no matching non-template function.
This exposed a couple of related bugs:
- we would sometimes substitute into a friend template instead of a
suitable non-friend declaration; this would now crash because we'd
decide the specialization of the friend is a redeclaration of itself
- ADL failed to properly handle the case where an invisible local
extern declaration redeclares an invisible friend
Both are fixed herein: in particular, we now never make invisible
friends or local extern declarations visible to name lookup unless
they are the only declaration of the entity. (We already mostly did
this for local extern declarations.)
llvm-svn: 350505
Craig Topper [Mon, 7 Jan 2019 05:58:53 +0000 (05:58 +0000)]
[X86] Update VBMI2 vshld/vshrd tests to use an immediate that doesn't require a modulo.
Planning to replace these with funnel shift intrinsics which would mask out the extra bits. This will help minimize test diffs.
llvm-svn: 350504
Chandler Carruth [Mon, 7 Jan 2019 05:42:51 +0000 (05:42 +0000)]
[CallSite removal] Migrate all Alias Analysis APIs to use the newly
minted `CallBase` class instead of the `CallSite` wrapper.
This moves the largest interwoven collection of APIs that traffic in
`CallSite`s. While a handful of these could have been migrated with
a minorly more shallow migration by converting from a `CallSite` to
a `CallBase`, it hardly seemed worth it. Most of the APIs needed to
migrate together because of the complex interplay of AA APIs and the
fact that converting from a `CallBase` to a `CallSite` isn't free in its
current implementation.
Out of tree users of these APIs can fairly reliably migrate with some
combination of `.getInstruction()` on the `CallSite` instance and
casting the resulting pointer. The most generic form will look like `CS`
-> `cast_or_null<CallBase>(CS.getInstruction())` but in most cases there
is a more elegant migration. Hopefully, this migrates enough APIs for
users to fully move from `CallSite` to the base class. All of the
in-tree users were easily migrated in that fashion.
Thanks for the review from Saleem!
Differential Revision: https://reviews.llvm.org/D55641
llvm-svn: 350503
Chandler Carruth [Mon, 7 Jan 2019 05:15:49 +0000 (05:15 +0000)]
[CallSite removal] Add `CallBase` support to the `InstVisitor` in such
a way that it still supports `CallSite` but users can be ported to rely
on `CallBase` instead.
This will unblock the ports across the analysis and transforms libraries
(and out-of-tree users) and once done we can clean this up by removing
the `CallSite` layer.
Differential Revision: https://reviews.llvm.org/D56182
llvm-svn: 350502
Brian Gesiak [Mon, 7 Jan 2019 03:25:59 +0000 (03:25 +0000)]
[SemaCXX] Fix ICE for unexpanded parameter pack
Summary:
The documentation for RecursiveASTVisitor::TraverseDecl states that the
Decl being traversed may be null. In fact, this is the case when a
CXXCatchStmt with no exception decl is traversed. Because the visitor
for diagnosing unexpanded parameter packs does not check for null, it
ends up crashing when it attempts to call the Decl::isParameterPack
method on a null Decl pointer.
Add a null check to prevent an ICE, and a test case that would crash
otherwise. Also, because the test requires C++ exceptions and C++14,
change the test parameters for the entire test file. (Alternatively, I
thought about adding a new test file, but went with this approach for my
own convenience.)
Co-authored-by: Andreas Molzer <andreas.molzer@gmx.de>
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56271
llvm-svn: 350501
Nico Weber [Mon, 7 Jan 2019 01:26:12 +0000 (01:26 +0000)]
[gn build] Add build files for llvm/lib/Target/ARM + tests
The ARM target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis unittests ARM bits are similar to the X86 bits in https://reviews.llvm.org/rL350413
Both are similar to the corresponding AArch64 bits in https://reviews.llvm.org/rL350499 too
After this, everything in my local GN branch is upstreamed to LLVM.
Differential Revision: https://reviews.llvm.org/D56371
llvm-svn: 350500
Nico Weber [Mon, 7 Jan 2019 01:23:11 +0000 (01:23 +0000)]
[gn build] Add build files for llvm/lib/Target/AArch64 + tests
The AArch64 target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis AArch64 bits are similar to the X86 bits in http://reviews.llvm.org/rL350184
The llvm-exegesis unittests AArch64 bits are similar to the X86 bits in https://reviews.llvm.org/rL350413
llvm/unittests/Target/AArch64 doesn't have an equivalent since the X86 Target
only has lit tests, no unittests.
Differential Revision: https://reviews.llvm.org/D56364
llvm-svn: 350499
Craig Topper [Sun, 6 Jan 2019 18:10:18 +0000 (18:10 +0000)]
[X86] Add support for matching vector funnel shift to AVX512VBMI2 instructions.
Summary: AVX512VBMI2 supports a funnel shift by immediate and a funnel shift by a variable vector.
Reviewers: spatel, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56361
llvm-svn: 350498
Lama Saba [Sun, 6 Jan 2019 16:39:14 +0000 (16:39 +0000)]
Revert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""
This reverts commit rL350493
issues related to modules still appear in http://green.lab.llvm.org/green/job/lldb-cmake
llvm-svn: 350497
Sanjay Patel [Sun, 6 Jan 2019 16:21:42 +0000 (16:21 +0000)]
[x86] explicitly set cost of integer add/sub
There are no test changes here in the existing cost model
regression tests because integer add/sub have a default
legal cost of 1 already. This would break, however, if
we custom lower those ops because the default cost model
assumes that custom-lowered ops are more expensive.
This is similar to the change in rL350403. See discussion
in D56011 for more details. When we enhance that patch to
handle integer ops, we need this cost model change to avoid
unintended diffs here from the custom lowering.
llvm-svn: 350496
Nico Weber [Sun, 6 Jan 2019 15:57:18 +0000 (15:57 +0000)]
Fix bug in test found by the diagnostic added in r350340.
I meant to commit this change in 350341 but failed to do so (since it's
in test/CodeGenCXX, not in test/Frontend).
llvm-svn: 350495
Nico Weber [Sun, 6 Jan 2019 15:49:10 +0000 (15:49 +0000)]
[gn build] Merge r350341
Adds a build file for llvm-elfabi and makes check-llvm depend on it.
llvm-svn: 350494
Lama Saba [Sun, 6 Jan 2019 15:45:40 +0000 (15:45 +0000)]
Resubmit rL345008 "Split MachinePipeliner code into header and cpp files"
Resubmitted in rL345290 and reverted in rL350345 due to failures in
http://green.lab.llvm.org/green/job/lldb-cmake/
Resubmitting after a workaround to lldb-cmake failure was
committed in rL350346, more info in https://reviews.llvm.org/D56084
llvm-svn: 350493
Nico Weber [Sun, 6 Jan 2019 15:09:22 +0000 (15:09 +0000)]
[gn build] Add build files for LLVM unittests with a custom main() function
Differential Revision: https://reviews.llvm.org/D56219
llvm-svn: 350492
Petr Hosek [Sun, 6 Jan 2019 08:23:56 +0000 (08:23 +0000)]
[CMake] Use hidden visibility for static libc++ in Fuchsia
This is enables the use of libc++ in contexts such as device drivers.
Differential Revision: https://reviews.llvm.org/D55405
llvm-svn: 350491
Craig Topper [Sun, 6 Jan 2019 07:06:35 +0000 (07:06 +0000)]
[LegalizeVectorOps] Add FSHL/FSHR to the list of vector operations that should be handled.
The FSHL/FSHR nodes are handled in the expand function, but they need to also be listed in the code that queries for the operation action too.
llvm-svn: 350490
Petr Hosek [Sun, 6 Jan 2019 06:14:31 +0000 (06:14 +0000)]
[libcxx] Support building hermetic static library
This is useful when static libc++ library is being linked into
shared libraries that may be used in combination with libraries.
We want to avoid we exporting libc++ symbols in those cases where
this option is useful. This is provided as a CMake option and can
be enabled by libc++ vendors as needed.
Differential Revision: https://reviews.llvm.org/D55404
llvm-svn: 350489
Petr Hosek [Sun, 6 Jan 2019 05:19:05 +0000 (05:19 +0000)]
[compiler-rt][Fuchsia] Replace _zx_vmar_allocate_old call
This is the deprecated legacy interface, replace it with the current
_zx_vmar_allocate one.
Differential Revision: https://reviews.llvm.org/D56360
llvm-svn: 350488
Mike Spertus [Sun, 6 Jan 2019 04:58:48 +0000 (04:58 +0000)]
Have MSVC Visualizer for DeducedTemplateSpecializationType show both the original template and deduced specialization
Now appears in the Autos window something like
- MyType DeducedTemplateSpecializationType {struct Y<int>}
|- Template template<typename T> struct Y;
|- Deduced As struct Y<int>
|- isDeduced true bool
|- TypeClass DeducedTemplateSpecialization (36)
|- Flags No TypeBits set beyond TypeClass
|- Canonical RecordType {struct Y<int>}
Also changed QualType visualization to auto-expand the BaseType
llvm-svn: 350487
Petr Hosek [Sun, 6 Jan 2019 04:14:51 +0000 (04:14 +0000)]
[CMake][Fuchsia] Enable build ID, relaxations for first stage
We want these to be used for the second stage compiler as well.
Differential Revision: https://reviews.llvm.org/D56359
llvm-svn: 350486
Eric Fiselier [Sun, 6 Jan 2019 00:37:31 +0000 (00:37 +0000)]
Fix PR39749 - Headers containing just #error harm __has_include.
This patch changes <experimental/foo> to use #warning instead of
is harmful to common feature detection idioms.
We should also consider only emitting the warning when __DEPRECATED is
defined, like we do in the <ext/foo> headers. Users may want to specify
"-Werror=-W#warnings" while still ignoring the libc++ warnings.
llvm-svn: 350485
Petr Hosek [Sat, 5 Jan 2019 23:45:31 +0000 (23:45 +0000)]
Revert "[CMake][Fuchsia] Enable experimental new pass manager by default"
This reverts commit r350461 as it causes many of the Clang tests to fail.
llvm-svn: 350484
Craig Topper [Sat, 5 Jan 2019 23:30:28 +0000 (23:30 +0000)]
[X86][AsmParser] Don't allow X86::DX in CheckBaseRegAndIndexRegAndScale.
This was here because out and in instructions allow '(%dx)' even though its not a memory reference. To handle this we build a special operand for the DX register reference before we get to the call to CheckBaseRegAndIndexRegAndScale. So we no longer need this special case.
llvm-svn: 350483
Mike Spertus [Sat, 5 Jan 2019 23:15:30 +0000 (23:15 +0000)]
Fix MSVC Visualization for TemplateTypeParmType and TemplateTypeParmDecl
llvm-svn: 350482
Craig Topper [Sat, 5 Jan 2019 22:42:58 +0000 (22:42 +0000)]
[X86] Use two pmovmskbs in combineBitcastvxi1 for (i64 (bitcast (v64i1 (truncate (v64i8)))) on KNL.
llvm-svn: 350481
Craig Topper [Sat, 5 Jan 2019 21:40:07 +0000 (21:40 +0000)]
[X86] Allow combinevxi1Bitcast to use pmovmskb on avx512 targets if the input is a truncate from v16i8/v32i8.
This is especially helpful on targets without avx512bw since we don't have a good way to convert from v16i8/v32i8 to v16i1/v32i1 for the truncate anyway. If we're just going to convert it to a GPR we might as well use pmovmskb to accomplish both.
llvm-svn: 350480
Jan Kratochvil [Sat, 5 Jan 2019 21:39:03 +0000 (21:39 +0000)]
Fix symbols.enable-external-lookup description wording
D55859 changed "external tools or libraries" to "external sources" according to
Pavel Labath. Now it is changed sort of back to "external tools and
repositories" according to Adrian Prantl.
https://reviews.llvm.org/D55859#1345881
llvm-svn: 350479
Eric Fiselier [Sat, 5 Jan 2019 21:18:10 +0000 (21:18 +0000)]
Fix flaky symlink access time test.
last_write_time(sym, new_time) changes the modification time of the file
referenced by the symlink. But reading through the symlink may change the
symlinks's access time.
This meant the previous test that checked that the symlinks access
time was unchanged was incorrect and made the test flaky.
This patch removes this test (there really is no non-flaky way
to test that the new access time coorisponds to the time at which
the symlink was last dereferenced). This should unflake the test.
llvm-svn: 350478
Kamil Rytarowski [Sat, 5 Jan 2019 20:11:54 +0000 (20:11 +0000)]
Revert "D56064: More tolerance for flaky tests in libc++ on NetBSD"
Requested by EricWF.
llvm-svn: 350477
Saleem Abdulrasool [Sat, 5 Jan 2019 19:27:12 +0000 (19:27 +0000)]
CodeGen: fix autolink emission on ELF
The autolinking extension for ELF uses a slightly different format for
encoding the autolink information compared to COFF and MachO. Account
for this in the CGM to ensure that we do not assert when emitting
assembly or an object file.
llvm-svn: 350476
Stanislav Mekhanoshin [Sat, 5 Jan 2019 19:20:00 +0000 (19:20 +0000)]
Added single use check to ShrinkDemandedConstant
Fixes cvt_f32_ubyte combine. performCvtF32UByteNCombine() could shrink
source node to demanded bits only even if there are other uses.
Differential Revision: https://reviews.llvm.org/D56289
llvm-svn: 350475
Craig Topper [Sat, 5 Jan 2019 19:19:37 +0000 (19:19 +0000)]
[X86] Regenerate test to merge 32-bit and 64-bit check lines. NFC
llvm-svn: 350474
Craig Topper [Sat, 5 Jan 2019 18:48:11 +0000 (18:48 +0000)]
[X86] Allow LowerTRUNCATE to use PACKUS/PACKSS for v16i16->v16i8 truncate when -mprefer-vector-width-256 is in effect and BWI is not available.
llvm-svn: 350473
Saleem Abdulrasool [Sat, 5 Jan 2019 18:39:32 +0000 (18:39 +0000)]
CodeGen: switch iteration to range based for loop (NFC)
Change a loop to range based instead while working on cleaning up some
modules autolinking issues on Linux. NFC.
llvm-svn: 350472
Nikita Popov [Sat, 5 Jan 2019 17:36:05 +0000 (17:36 +0000)]
[InstCombine] Improve cttz/ctlz + icmp tests; NFC
Change part of the tests to use vectors (I'm using scalar for ugt
and vector for ult), add multiuse variations, rename %lz to %tz
for the cttz tests.
llvm-svn: 350471
Mike Spertus [Sat, 5 Jan 2019 17:01:34 +0000 (17:01 +0000)]
Improve MSVC type visualizations
Display TypeBits in a single line.
Fix bit rot in template visualizations
Rudimentary support for deduced types
llvm-svn: 350470
Mike Spertus [Sat, 5 Jan 2019 16:59:27 +0000 (16:59 +0000)]
Enhance MSVC visualization of PointerUnions
Add a "deref" view that displays the pointed to objects since
other visualizers often need to display data reference by internal
PointerUnions
llvm-svn: 350469
Nikita Popov [Sat, 5 Jan 2019 15:51:59 +0000 (15:51 +0000)]
[InstCombine] Add cttz/ctlz + icmp ugt/ult tests; NFC
llvm-svn: 350468
Serge Guelton [Sat, 5 Jan 2019 12:07:36 +0000 (12:07 +0000)]
[python] Make the collections import future-proof
On Python 3.7 the old code raises a warning:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
class ArgumentsIterator(collections.Sequence):
On Python 3.8 it wouldn't work anymore.
Commited on behalf of Jakub Stasiak.
Differential Revision: https://reviews.llvm.org/D56341
llvm-svn: 350467
Jonas Toth [Sat, 5 Jan 2019 11:40:05 +0000 (11:40 +0000)]
[Documentation] fix order of checks in checks/list.rst
llvm-svn: 350466
Martin Storsjo [Sat, 5 Jan 2019 10:44:03 +0000 (10:44 +0000)]
[docs] Add a known limitation to the comment about lld supporting GCC/MinGW object files. NFC.
Differential Revision: https://reviews.llvm.org/D56335
llvm-svn: 350465
Martin Storsjo [Sat, 5 Jan 2019 10:43:59 +0000 (10:43 +0000)]
[MinGW] Expand comment for MinGW driver. NFC.
Originally authored by Rui Ueyama.
Differential Revision: https://reviews.llvm.org/D53031
llvm-svn: 350464
Nikita Popov [Sat, 5 Jan 2019 09:48:16 +0000 (09:48 +0000)]
[InstCombine] Relax cttz/ctlz with select on zero
The cttz/ctlz intrinsics have a parameter specifying whether the
result is undefined for zero. cttz(x, false) can be relaxed to
cttz(x, true) if x is known non-zero, and in fact such an optimization
is already performed. However, this currently doesn't work if x is
non-zero as a result of a select rather than an explicit branch.
This patch adds handling for this case, thus allowing
x != 0 ? cttz(x, false) : y to simplify to x != 0 ? cttz(x, true) : y.
Differential Revision: https://reviews.llvm.org/D55786
llvm-svn: 350463
Nikita Popov [Sat, 5 Jan 2019 09:48:05 +0000 (09:48 +0000)]
[InstCombine] Add vector tests for select + ctlz/cttz; NFC
llvm-svn: 350462
Petr Hosek [Sat, 5 Jan 2019 07:57:53 +0000 (07:57 +0000)]
[CMake][Fuchsia] Enable experimental new pass manager by default
This change enableds experimental new pass manager.
Differential Revision: https://reviews.llvm.org/D56350
llvm-svn: 350461
Petr Hosek [Sat, 5 Jan 2019 07:57:46 +0000 (07:57 +0000)]
[CMake][Fuchsia] Enable x86 relaxation by default
This enables x86 relaxation by default. This depends on a linker new
enough to support the new reloc types but since we default to lld we
don't worry about host system linkers that might be too old to support
the new reloc types.
Differential Revision: https://reviews.llvm.org/D56349
llvm-svn: 350460
Petr Hosek [Sat, 5 Jan 2019 07:57:38 +0000 (07:57 +0000)]
[CMake][Fuchsia] Enable --build-id linker flag by default
This enables passing --build-id to linker by default.
Differential Revision: https://reviews.llvm.org/D56348
llvm-svn: 350459
Nico Weber [Sat, 5 Jan 2019 05:01:20 +0000 (05:01 +0000)]
[gn build] Merge r350423
llvm-svn: 350458
Nico Weber [Sat, 5 Jan 2019 04:05:25 +0000 (04:05 +0000)]
[gn build] Add build files for unittests under llvm/unittests/ExecutionEngine
Differential Revision: https://reviews.llvm.org/D56328
llvm-svn: 350457
Easwaran Raman [Sat, 5 Jan 2019 02:26:29 +0000 (02:26 +0000)]
[Inliner] Optimize shouldBeDeferred
This has some minor optimizations to shouldBeDeferred. This is not
strictly NFC because the early exit inside the loop assumes
TotalSecondaryCost is monotonically non-decreasing, which is not true if
the threshold used by CostAnalyzer is negative. AFAICT the thresholds do
not go below 0 for the default values of the various options we use.
llvm-svn: 350456
Craig Topper [Sat, 5 Jan 2019 01:40:29 +0000 (01:40 +0000)]
[X86] Require second operand of X86vshiftuniform to be an integer. NFC
We don't need to require the first operand to be an integer because we already said it was the same type as the result which we also constrained to an integer.
llvm-svn: 350455
Nico Weber [Sat, 5 Jan 2019 01:39:18 +0000 (01:39 +0000)]
[gn build] Add build files for unittests that load shared libraries
This is slightly ugly for three reasons:
- The shlib needs to go next to the binary to be found on all platforms, so the
build files refer to target_out_dir
- The explicit -fPIC flag needed on the shared lib side, and the -rdynamic flag
needed on the host side, on Linux
- Plugins that refer to LLVM code and assume that the host will resolve them
don't work on Windows -- PluginsTests won't test anything on Windows (but
DynamicLibraryTests will, since the dll here doesn't call LLVM code)
If we get lots more of these plugin / plugin host targets it might make sense
to add a template for them. But for now, these are the last ones we need.
(We're at 6 plugin hosts, 2 of them tests, and at 6 shared libraries, 2 of them
tests as well. clang is a plugin host by default in the CMake build but not
(yet?) in the GN build.)
Differential Revision: https://reviews.llvm.org/D56330
llvm-svn: 350454
Nico Weber [Sat, 5 Jan 2019 01:19:14 +0000 (01:19 +0000)]
Let new test from r350340 still pass even after r350451.
llvm-svn: 350453
Alexandre Ganea [Sat, 5 Jan 2019 01:16:24 +0000 (01:16 +0000)]
[LLD][COFF] PDB: Parallel sort publics
Saves up to 1.3 sec on large PDBs.
Figures below are for the "Globals Stream Layout" pass:
Before This patch
Large EXE (PDB is ~2 GB) 3330 ms 2022 ms
Large EXE (PDB is ~2 GB) 2680 ms 1608 ms
Large DLL (PDB is ~1 GB) 1455 ms 938 ms
Large DLL (PDB is ~800 MB) 1215 ms 800 ms
Small DLL (PDB is ~200 MB) 224 ms 146 ms
Differential Revision: https://reviews.llvm.org/D56334
llvm-svn: 350452
Nico Weber [Sat, 5 Jan 2019 01:10:20 +0000 (01:10 +0000)]
Move -add-plugin validation after -load was executed.
Moves the code added in r350340 around a bit, to hopefully make the existing
plugin tests pass when clang is built with examples enabled.
llvm-svn: 350451
Alexandre Ganea [Sat, 5 Jan 2019 01:08:10 +0000 (01:08 +0000)]
[LLD][COFF] Fix namespace compilation issue with a upcoming patch. NFC
llvm-svn: 350450
Evgeniy Stepanov [Sat, 5 Jan 2019 00:45:14 +0000 (00:45 +0000)]
Revert "Revert "Switch Android from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)""
This reapplies commit r348984.
llvm-svn: 350449
Evgeniy Stepanov [Sat, 5 Jan 2019 00:44:58 +0000 (00:44 +0000)]
Revert "Revert "[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)""
This reapplies commit r348983.
llvm-svn: 350448
Nico Weber [Sat, 5 Jan 2019 00:14:37 +0000 (00:14 +0000)]
[gn build] Add build file for DebugInfoPDBTests
I'm pretty unhappy this patch: DebugInfoPDBTests uses an API that requires some
magic txt file to be next to the unit test executable that stores the absolute
path to the LLVM source root.
The choices here are:
1. Don't use the unittest() template for DebugInfoPDBTests and set output_dir
for unit tests in two places (the gni file for every test but this one, and the
BUILD.gn file for this specific test).
2. Add another unittest_foo() template variation for this one test.
I went with the former, and added a comment to the template to look out for
this.
(The CMake build has the same issue.)
Differential Revision: https://reviews.llvm.org/D56324
llvm-svn: 350447
Jonas Devlieghere [Sat, 5 Jan 2019 00:01:04 +0000 (00:01 +0000)]
[Driver] Some more cleanup. NFC
llvm-svn: 350446
Peter Collingbourne [Fri, 4 Jan 2019 23:24:02 +0000 (23:24 +0000)]
Bring back the pthread_create interceptor, but only on non-aarch64.
We still need the interceptor on non-aarch64 to untag the pthread_t
and pthread_attr_t pointers and disable tagging on allocations done
internally by glibc.
llvm-svn: 350445
Peter Collingbourne [Fri, 4 Jan 2019 23:10:47 +0000 (23:10 +0000)]
Disable system-allocator-fallback.cc test on Android O and earlier.
The dynamic loader on Android O appears to have a bug where it crashes
when dlopening DF_1_GLOBAL libraries.
llvm-svn: 350444
Evgeniy Stepanov [Fri, 4 Jan 2019 22:55:04 +0000 (22:55 +0000)]
[sanitizer] Reduce stack depot size on Android.
Summary:
The default setting kTabSizeLog=20 results in an 8Mb global hash table,
almost all of it in private pages. That is not a sane setting in a
mobile, system-wide use case: with ~150 concurrent processes stack
depot will account for more than 1Gb of RAM.
Reviewers: kcc, pcc
Subscribers: srhines, kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D56333
llvm-svn: 350443
Rong Xu [Fri, 4 Jan 2019 22:54:03 +0000 (22:54 +0000)]
[PGO] Use SourceFileName rather module name in PGOFuncName
In LTO or Thin-lto mode (though linker plugin), the module
names are of temp file names which are different for
different compilations. Using SourceFileName avoids the issue.
This should not change any functionality for current PGO as
all the current callers of getPGOFuncName() is before LTO.
llvm-svn: 350442