platform/upstream/llvm.git
5 years ago[AArch64][GlobalISel] Unmerge into scalars from a vector should use FPR bank.
Amara Emerson [Tue, 29 Jan 2019 21:19:33 +0000 (21:19 +0000)]
[AArch64][GlobalISel] Unmerge into scalars from a vector should use FPR bank.

This currently shows up as a selection fallback since the dest regs were given
GPR banks but the source was a vector FPR reg.

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

llvm-svn: 352545

5 years agoOpenCL: Try to fix bot test failure
Matt Arsenault [Tue, 29 Jan 2019 21:14:56 +0000 (21:14 +0000)]
OpenCL: Try to fix bot test failure

llvm-svn: 352544

5 years ago[OPENMP]Fix PR40513: lastprivate taskloop counter.
Alexey Bataev [Tue, 29 Jan 2019 21:12:28 +0000 (21:12 +0000)]
[OPENMP]Fix PR40513: lastprivate taskloop counter.

We don't need to use the predetermined data-sharing attributes for the
loop counters if the user explicitly specified correct data-sharing
attributes for such variables.

llvm-svn: 352543

5 years ago[cc1as] Test that -g of empty .s file does something sensible.
Paul Robinson [Tue, 29 Jan 2019 20:57:50 +0000 (20:57 +0000)]
[cc1as] Test that -g of empty .s file does something sensible.

Depends on LLVM r352541.

llvm-svn: 352542

5 years ago[DWARF] Emit reasonable debug info for empty .s files.
Paul Robinson [Tue, 29 Jan 2019 20:53:51 +0000 (20:53 +0000)]
[DWARF] Emit reasonable debug info for empty .s files.

llvm-svn: 352541

5 years agoOpenCL: Use length modifier for warning on vector printf arguments
Matt Arsenault [Tue, 29 Jan 2019 20:49:54 +0000 (20:49 +0000)]
OpenCL: Use length modifier for warning on vector printf arguments

Re-enable format string warnings on printf.

The warnings are still incomplete. Apparently it is undefined to use a
vector specifier without a length modifier, which is not currently
warned on. Additionally, type warnings appear to not be working with
the hh modifier, and aren't warning on all of the special restrictions
from c99 printf.

llvm-svn: 352540

5 years agoRevert "OpenCL: Extend argument promotion rules to vector types"
Matt Arsenault [Tue, 29 Jan 2019 20:49:47 +0000 (20:49 +0000)]
Revert "OpenCL: Extend argument promotion rules to vector types"

This reverts r348083. This was based on a misreading of the spec
for printf specifiers.

Also revert r343653, as without a subsequent patch, a correctly
specified format for a vector will incorrectly warn.

Fixes bug 40491.

llvm-svn: 352539

5 years ago[Reproducers] Add file provider
Jonas Devlieghere [Tue, 29 Jan 2019 20:36:38 +0000 (20:36 +0000)]
[Reproducers] Add file provider

This patch adds the file provider which is responsible for capturing
files used by LLDB.

When capturing a reproducer, we use a file collector that is very
similar to the one used in clang. For every file that we touch, we add
an entry with a mapping from its virtual to its real path. When we
decide to generate a reproducer we copy over the files and their
permission into to reproducer folder.

When replaying a reproducer, we load the VFS mapping and instantiate a
RedirectingFileSystem. The latter will transparently use the files
available in the reproducer.

I've tested this on two macOS machines with an artificial example.
Still, it is very likely that I missed some places where we (still) use
native file system calls. I'm hoping to flesh those out while testing
with more advanced examples. However, I will fix those things in
separate patches.

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

llvm-svn: 352538

5 years agoFix the tests from r350970
Steven Wu [Tue, 29 Jan 2019 20:13:02 +0000 (20:13 +0000)]
Fix the tests from r350970

Relax the tests from r350970 to allow non-standard path for ld.

llvm-svn: 352537

5 years ago[InstCombine] canonicalize cmp/select form of uadd saturate with constant
Sanjay Patel [Tue, 29 Jan 2019 20:02:45 +0000 (20:02 +0000)]
[InstCombine] canonicalize cmp/select form of uadd saturate with constant

I'm circling back around to a loose end from D51929.

The backend (either CGP or DAG) doesn't recognize this pattern, so we end up with different asm for these IR variants.

Regardless of any future changes to canonicalize to saturation/overflow intrinsics, we want to get raw IR variations
into the minimal number of raw IR forms. If/when we can canonicalize to intrinsics, that will make that step easier.

  Pre: C2 == ~C1
  %a = add i32 %x, C1
  %c = icmp ugt i32 %x, C2
  %r = select i1 %c, i32 -1, i32 %a
  =>
  %a = add i32 %x, C1
  %c2 = icmp ult i32 %x, C2
  %r = select i1 %c2, i32 %a, i32 -1

  https://rise4fun.com/Alive/pkH

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

llvm-svn: 352536

5 years agoFix the behavior of clang's -w flag.
James Y Knight [Tue, 29 Jan 2019 19:33:48 +0000 (19:33 +0000)]
Fix the behavior of clang's -w flag.

It is intended to disable _all_ warnings, even those upgraded to
errors via `-Werror=warningname` or `#pragma clang diagnostic error'

Fixes: https://llvm.org/PR38231
Differential Revision: https://reviews.llvm.org/D53199

llvm-svn: 352535

5 years ago[analyzer] [RetainCountChecker] Track input parameters to the top-level function
George Karpenkov [Tue, 29 Jan 2019 19:29:59 +0000 (19:29 +0000)]
[analyzer] [RetainCountChecker] Track input parameters to the top-level function

Track them for ISL/OS objects by default, and for NS/CF under a flag.

rdar://47536377

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

llvm-svn: 352534

5 years ago[analyzer] [RetainSummaryManager] [NFC] Split one function into two, as it's really...
George Karpenkov [Tue, 29 Jan 2019 19:29:45 +0000 (19:29 +0000)]
[analyzer] [RetainSummaryManager] [NFC] Split one function into two, as it's really doing two things

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

llvm-svn: 352533

5 years ago[analyzer] [ARCMT] [NFC] Unify entry point into RetainSummaryManager
George Karpenkov [Tue, 29 Jan 2019 19:29:33 +0000 (19:29 +0000)]
[analyzer] [ARCMT] [NFC] Unify entry point into RetainSummaryManager

Just use one single entry point, since we have AnyCall utility now.

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

llvm-svn: 352532

5 years agoExtend AnyCall to handle callable declarations without the call expressions
George Karpenkov [Tue, 29 Jan 2019 19:29:19 +0000 (19:29 +0000)]
Extend AnyCall to handle callable declarations without the call expressions

That weakens inner invariants, but allows the class to be more generic,
allowing usage in situations where the call expression is not known (or
should not matter).

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

llvm-svn: 352531

5 years ago[analyzer] [RetainCountChecker] Support 'taggedRetain' and 'taggedRelease'
George Karpenkov [Tue, 29 Jan 2019 19:29:07 +0000 (19:29 +0000)]
[analyzer] [RetainCountChecker] Support 'taggedRetain' and 'taggedRelease'

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

llvm-svn: 352530

5 years ago[MinGW] Don't define names for ignored options. NFC.
Martin Storsjo [Tue, 29 Jan 2019 19:24:32 +0000 (19:24 +0000)]
[MinGW] Don't define names for ignored options. NFC.

Move them to the same section as the newly added ignored options
without a defined name.

Also move options that actually weren't ignored to the right section.

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

llvm-svn: 352529

5 years ago[DAGCombiner] fold extract_subvector of extract_subvector
Sanjay Patel [Tue, 29 Jan 2019 19:13:39 +0000 (19:13 +0000)]
[DAGCombiner] fold extract_subvector of extract_subvector

This is the sibling fold for insert-of-insert that was added with D56604.

Now that we have x86 shuffle narrowing (D57156), this change shows improvements for
lots of AVX512 reduction code (not sure that we would ever expect extract-of-extract otherwise).

There's a small regression in some of the partial-permute tests (extracting followed by splat).
That is tracked by PR40500:
https://bugs.llvm.org/show_bug.cgi?id=40500

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

llvm-svn: 352528

5 years ago[VFS] Fix warning and use better check.
Michael J. Spencer [Tue, 29 Jan 2019 19:07:15 +0000 (19:07 +0000)]
[VFS] Fix warning and use better check.

llvm-svn: 352527

5 years ago[OPENMP]Make the loop with unsigned counter countable.
Alexey Bataev [Tue, 29 Jan 2019 18:51:58 +0000 (18:51 +0000)]
[OPENMP]Make the loop with unsigned counter countable.

According to the report, better to keep the original strict compare
operation as the loop condition with unsigned loop counters to make the
loop countable. This allows further loop transformations.

llvm-svn: 352526

5 years ago[libc++] Fix Windows build error in include/filesystem
Thomas Anderson [Tue, 29 Jan 2019 18:48:35 +0000 (18:48 +0000)]
[libc++] Fix Windows build error in include/filesystem

_LIBCPP_FUNC_VIS is redundant since the class is already annotated with
_LIBCPP_EXCEPTION_ABI.

Fixes this build error:

    In file included from fstream:188:
    filesystem(1350,3):  error: attribute 'dllimport' cannot be applied to member of 'dllimport' class
      _LIBCPP_FUNC_VIS
    __config(674,37):  note: expanded from macro '_LIBCPP_FUNC_VIS'
    #define _LIBCPP_FUNC_VIS            _LIBCPP_DLL_VIS
    __config(666,38):  note: expanded from macro '_LIBCPP_DLL_VIS'
    #  define _LIBCPP_DLL_VIS __declspec(dllimport)
    filesystem(1313,7):  note: previous attribute is here
    class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error {
    __config(675,37):  note: expanded from macro '_LIBCPP_EXCEPTION_ABI'
    #define _LIBCPP_EXCEPTION_ABI       _LIBCPP_DLL_VIS
    __config(666,38):  note: expanded from macro '_LIBCPP_DLL_VIS'
    #  define _LIBCPP_DLL_VIS __declspec(dllimport)

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

llvm-svn: 352525

5 years agoRollback unwindlib patch.
Sterling Augustine [Tue, 29 Jan 2019 18:27:51 +0000 (18:27 +0000)]
Rollback unwindlib patch.

llvm-svn: 352524

5 years agoGlobalISel: Fix narrowScalar for load/store with different mem size
Matt Arsenault [Tue, 29 Jan 2019 18:13:02 +0000 (18:13 +0000)]
GlobalISel: Fix narrowScalar for load/store with different mem size

This was ignoring the memory size, and producing multiple loads/stores
if the operand size was different from the memory size.

I assume this is the intent of not having an explicit G_ANYEXTLOAD
(although I think that would probably be better).

llvm-svn: 352523

5 years agoFix PR40495 - is_invokable_v<void> does not compile
Eric Fiselier [Tue, 29 Jan 2019 18:01:14 +0000 (18:01 +0000)]
Fix PR40495 - is_invokable_v<void> does not compile

The meta-programming that attempted to form the invoke call expression
was not in a SFINAE context. This made it a hard error to provide
non-referencable types like 'void' or 'void (...) const'.

This patch fixes the error by checking the validity of the call
expression within a SFINAE context.

llvm-svn: 352522

5 years agoMake Type::GetByteSize optional (NFC)
Adrian Prantl [Tue, 29 Jan 2019 17:52:34 +0000 (17:52 +0000)]
Make Type::GetByteSize optional (NFC)

This is a continuation of my quest to make the size 0 a supported value.

This reapplies r352394 with additional PDB parser fixes prepared by
Pavel Labath!

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

llvm-svn: 352521

5 years ago[x86] add tests for vector bool math; NFC
Sanjay Patel [Tue, 29 Jan 2019 17:00:47 +0000 (17:00 +0000)]
[x86] add tests for vector bool math; NFC

llvm-svn: 352520

5 years ago[AArch64] add tests for vector bool math; NFC
Sanjay Patel [Tue, 29 Jan 2019 17:00:07 +0000 (17:00 +0000)]
[AArch64] add tests for vector bool math; NFC

llvm-svn: 352519

5 years ago[X86][Btver2] Improved latency/throughput model for scalar int-to-float conversions.
Andrea Di Biagio [Tue, 29 Jan 2019 16:47:27 +0000 (16:47 +0000)]
[X86][Btver2] Improved latency/throughput model for scalar int-to-float conversions.

Account for bypass delays when computing the latency of scalar int-to-float
conversions.
On Jaguar we need to account for an extra 6cy latency (see AMD fam16h SOG).
This patch also fixes the number of micropcodes for the register-memory variants
of scalar int-to-float conversions.

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

llvm-svn: 352518

5 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Tue, 29 Jan 2019 16:44:05 +0000 (16:44 +0000)]
[InstCombine] regenerate test checks; NFC

llvm-svn: 352517

5 years agoAdd .clang-tidy and .clang-format files to the toplevel of the
James Y Knight [Tue, 29 Jan 2019 16:43:16 +0000 (16:43 +0000)]
Add .clang-tidy and .clang-format files to the toplevel of the
repository (the same content as those in llvm/ and clang/).

llvm-svn: 352516

5 years ago[InstCombine] add tests for ext-of-bool + add/sub; NFC
Sanjay Patel [Tue, 29 Jan 2019 16:39:23 +0000 (16:39 +0000)]
[InstCombine] add tests for ext-of-bool + add/sub; NFC

We should choose one of these as canonical:

  %z = zext i1 %cmp to i32
  %r = sub i32 %x, %z
  =>
  %s = sext i1 %cmp to i32
  %r = add i32 %x, %s

The test comments assume that the zext form is better,
but we can adjust that if we decide to go the other way.

llvm-svn: 352515

5 years agoAdjust documentation for git migration.
James Y Knight [Tue, 29 Jan 2019 16:37:27 +0000 (16:37 +0000)]
Adjust documentation for git migration.

This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.

Additionally, I've deleted one document which appeared to be outdated
and unneeded:
  lldb/docs/building-with-debug-llvm.txt

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

llvm-svn: 352514

5 years ago[NFC] Add missing revision for removal of bad_array_length in ABI changelog
Louis Dionne [Tue, 29 Jan 2019 16:30:11 +0000 (16:30 +0000)]
[NFC] Add missing revision for removal of bad_array_length in ABI changelog

llvm-svn: 352513

5 years agoMark some of the behavior in the move w/allocator constructors of deque/unordered...
Marshall Clow [Tue, 29 Jan 2019 16:12:45 +0000 (16:12 +0000)]
Mark some of the behavior in the move w/allocator constructors of deque/unordered containers as 'libc++-specific'. Thanks to Andrey Maksimov for pointing this out.

llvm-svn: 352512

5 years ago[clangd] Remove extra ';' to fix -Wpedantic warning. NFC
Ilya Biryukov [Tue, 29 Jan 2019 16:04:39 +0000 (16:04 +0000)]
[clangd] Remove extra ';' to fix -Wpedantic warning. NFC

llvm-svn: 352511

5 years ago[clangd] Attempt to fix failing buildbots after r352494
Ilya Biryukov [Tue, 29 Jan 2019 15:57:14 +0000 (15:57 +0000)]
[clangd] Attempt to fix failing buildbots after r352494

For failures see:
http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/38501/steps/build-unified-tree/logs/stdio

llvm-svn: 352510

5 years ago[clangd] Make -clang-tidy-checks a non-hidden command-line arg
Ilya Biryukov [Tue, 29 Jan 2019 15:52:05 +0000 (15:52 +0000)]
[clangd] Make -clang-tidy-checks a non-hidden command-line arg

Summary:
This looks like a useful user-facing configuration parameter,
which should be discoverable.

Also fix a small typo in the description.

Reviewers: hokein

Reviewed By: hokein

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 352509

5 years agolld-link: Allow backward references between associated comdats
Nico Weber [Tue, 29 Jan 2019 15:50:31 +0000 (15:50 +0000)]
lld-link: Allow backward references between associated comdats

References between associated comdats are invalid per COFF spec, but the newest
Windows SDK contains obj files that have these references
(https://bugs.chromium.org/p/chromium/issues/detail?id=925943#c13). So add back
support for them and add tests for them. The old code handled them fine.

This makes lld-link match the behavior of newer link.exe versions as far as I
can tell. (The behavior before this change matched the behavior of older
link.exe versions.)

This mostly reverts r352254.

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

llvm-svn: 352508

5 years agoBreakpadRecords: Add parsing code for FILE and LINE records
Pavel Labath [Tue, 29 Jan 2019 15:39:27 +0000 (15:39 +0000)]
BreakpadRecords: Add parsing code for FILE and LINE records

The two records aren't used by anything yet, but this part can be
separated out easily, so I am comitting it separately to simplify
reviews of the followup patch.

llvm-svn: 352507

5 years ago[SelectionDAGBuilder] Remove redundant variable. NFCI.
Nirav Dave [Tue, 29 Jan 2019 15:14:07 +0000 (15:14 +0000)]
[SelectionDAGBuilder] Remove redundant variable. NFCI.

llvm-svn: 352506

5 years ago[llvm-objcopy] Implement --set-section-flags.
Jordan Rupprecht [Tue, 29 Jan 2019 15:05:38 +0000 (15:05 +0000)]
[llvm-objcopy] Implement --set-section-flags.

Summary:
--set-section-flags is used to change the section flags (e.g. SHF_ALLOC) for given sections. The flags allowed are the same from the existing --rename-section=.old=.new[,flags] feature.

Additionally, make sure that --set-section-flag cannot be used with --rename-section (either the source or destination), since --rename-section accepts flags. This avoids ambiguity for something like "--rename-section=.foo=.bar,alloc --set-section-flag=.bar,code".

Reviewers: jhenderson, jakehehrlich, alexshap, espindola

Reviewed By: jhenderson, jakehehrlich

Subscribers: llvm-commits, emaste, arichardson

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

llvm-svn: 352505

5 years agoReversing the checkin for version 352484 as tests are failing.
Ayonam Ray [Tue, 29 Jan 2019 15:00:50 +0000 (15:00 +0000)]
Reversing the checkin for version 352484 as tests are failing.

llvm-svn: 352504

5 years ago[Tooling] Handle #pragma once header guard in include insertion.
Eric Liu [Tue, 29 Jan 2019 14:40:01 +0000 (14:40 +0000)]
[Tooling] Handle #pragma once header guard in include insertion.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 352503

5 years agogn build: Merge r352444, r352431, r352430
Nico Weber [Tue, 29 Jan 2019 14:39:54 +0000 (14:39 +0000)]
gn build: Merge r352444, r352431, r352430

llvm-svn: 352502

5 years ago[clangd] Unit test for sourceLocationInMainFile.
Ilya Biryukov [Tue, 29 Jan 2019 14:31:19 +0000 (14:31 +0000)]
[clangd] Unit test for sourceLocationInMainFile.

This should have been part of r352494, which added the corresponding
function. The unit test ended up as a separate commit accidentally.

llvm-svn: 352501

5 years ago[AMDGPU] Fix a weird WWM intrinsic issue.
Neil Henning [Tue, 29 Jan 2019 14:28:17 +0000 (14:28 +0000)]
[AMDGPU] Fix a weird WWM intrinsic issue.

I found a really strange WWM issue through a very convoluted shader that
essentially boils down to a bug in SIInstrInfo where canReadVGPR did not
correctly identify that WWM is like a copy and can have a VGPR as its
source.

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

llvm-svn: 352500

5 years ago[ELF] Simplify. NFC
Fangrui Song [Tue, 29 Jan 2019 14:24:35 +0000 (14:24 +0000)]
[ELF] Simplify. NFC

llvm-svn: 352499

5 years ago[clangd] Interfaces for writing code tweaks
Ilya Biryukov [Tue, 29 Jan 2019 14:17:36 +0000 (14:17 +0000)]
[clangd] Interfaces for writing code tweaks

Summary:
The code tweaks are an implementation of mini-refactorings exposed
via the LSP code actions. They run in two stages:
  - Stage 1. Decides whether the action is available to the user and
    collects all the information required to finish the action.
    Should be cheap, since this will run over all the actions known to
    clangd on each textDocument/codeAction request from the client.

  - Stage 2. Uses information from stage 1 to produce the actual edits
    that the code action should perform. This stage can be expensive and
    will only run if the user chooses to perform the specified action in
    the UI.

One unfortunate consequence of this change is increased latency of
processing the textDocument/codeAction requests, which now wait for an
AST. However, we cannot avoid this with what we have available in the LSP
today.

Reviewers: kadircet, ioeric, hokein, sammccall

Reviewed By: sammccall

Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 352494

5 years agoRevert r351833 and r352250.
Hans Wennborg [Tue, 29 Jan 2019 13:43:22 +0000 (13:43 +0000)]
Revert r351833 and r352250.

They were breaking the Windows build when using MSBuild, see the
discussion on D56781.

r351833: "Use response file when generating LLVM-C.dll"

> Use response file when generating LLVM-C.dll
>
> As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me.
>
> Commited on behalf of Jakob Bornecrantz
>
> Differential Revision: https://reviews.llvm.org/D56781

r352250: "Build LLVM-C.dll by default on windows and enable in release package"

>  Build LLVM-C.dll by default on windows and enable in release package
>
>  With the fixes to the building of LLVM-C.dll in D56781 this should now
>  be safe to land. This will greatly simplify dealing with LLVM for people
>  that just want to use the C API on windows. This is a follow up from
>  D35077.
>
>  Patch by Jakob Bornecrantz!
>
>  Differential revision: https://reviews.llvm.org/D56774

llvm-svn: 352492

5 years ago[CUDA][HIP] Do not diagnose use of _Float16
Yaxun Liu [Tue, 29 Jan 2019 13:20:23 +0000 (13:20 +0000)]
[CUDA][HIP] Do not diagnose use of _Float16

r352221 caused regressions in CUDA/HIP since device function may use _Float16 whereas host does not support it.
In this case host compilation should not diagnose usage of _Float16 in device functions or variables.

For now just do not diagnose _Float16 for CUDA/HIP. In the future we should have more precise check.

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

llvm-svn: 352488

5 years agoAdd 'REQUIRES: zlib' to a fuzzer test
Jeremy Morse [Tue, 29 Jan 2019 13:06:17 +0000 (13:06 +0000)]
Add 'REQUIRES: zlib' to a fuzzer test

Fixes tests on build environments that don't have zlib. See also r352483.

llvm-svn: 352487

5 years agoRe-commit "[AST] Introduce GenericSelectionExpr::Association"
Bruno Ricci [Tue, 29 Jan 2019 12:57:11 +0000 (12:57 +0000)]
Re-commit "[AST] Introduce GenericSelectionExpr::Association"

This time with a fix to make gcc 4.8 happy.

llvm-svn: 352486

5 years ago[clangd] dlog clang-tidy configuration
Haojian Wu [Tue, 29 Jan 2019 12:32:32 +0000 (12:32 +0000)]
[clangd] dlog clang-tidy configuration

vlog seems to be too spammy in unittests.

llvm-svn: 352485

5 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Tue, 29 Jan 2019 12:01:32 +0000 (12:01 +0000)]
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default

During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Review ID: D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

llvm-svn: 352484

5 years agoAdd zlib feature test to lit configuration
Jeremy Morse [Tue, 29 Jan 2019 12:00:01 +0000 (12:00 +0000)]
Add zlib feature test to lit configuration

Some new tests in libfuzzer have dependencies on zlib: add a feature test
for zlib so that we can add a REQUIRES field to the relevant tests.

Patch by Matthew Voss.

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

llvm-svn: 352483

5 years ago[ELF] - Remove dead `readBfdName` declaration. NFC.
George Rimar [Tue, 29 Jan 2019 11:46:00 +0000 (11:46 +0000)]
[ELF] - Remove dead `readBfdName` declaration. NFC.

`readBfdName` was removed recently.

llvm-svn: 352482

5 years ago[clangd] Make USRs for macros to be position independent
Kadir Cetinkaya [Tue, 29 Jan 2019 11:19:15 +0000 (11:19 +0000)]
[clangd] Make USRs for macros to be position independent

Summary:
USRs for macros were not cannonical due to usage of cursor location
instead of definition location.

Reviewers: jkorous

Subscribers: ilya-biryukov, ioeric, MaskRay, arphaman, cfe-commits

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

llvm-svn: 352481

5 years ago[X86] Add PR40483 test case
Simon Pilgrim [Tue, 29 Jan 2019 10:58:42 +0000 (10:58 +0000)]
[X86] Add PR40483 test case

llvm-svn: 352480

5 years ago[WebAssembly] Re-enable main-function signature rewriting
Dan Gohman [Tue, 29 Jan 2019 10:53:42 +0000 (10:53 +0000)]
[WebAssembly] Re-enable main-function signature rewriting

Re-enable the code to rewrite main-function signatures into
"int main(int argc, char *argv[])", but limited to only handling
the case of "int main(void)", so that it doesn't silently strip
an argument in the "int main(int argc, char *argv[], char *envp[])"
case.

This allows main to be called by C startup code, since WebAssembly
requires caller and callee signatures to match, so it can't rely
on passing main a different number of arguments than it expects.

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

llvm-svn: 352479

5 years ago[NativePDB] Fix lldb-x64-windows-ninja after r352464
Aleksandr Urakov [Tue, 29 Jan 2019 10:46:28 +0000 (10:46 +0000)]
[NativePDB] Fix lldb-x64-windows-ninja after r352464

llvm-svn: 352478

5 years ago[llvm-symbolizer][doc] Tweak wording of --adjust-vma switch description
James Henderson [Tue, 29 Jan 2019 10:43:48 +0000 (10:43 +0000)]
[llvm-symbolizer][doc] Tweak wording of --adjust-vma switch description

The address isn't dynamically relocated. The object is.

llvm-svn: 352477

5 years ago[X86] Fix linux32 pic tests to use correct relocation model (PR39684)
Simon Pilgrim [Tue, 29 Jan 2019 10:41:48 +0000 (10:41 +0000)]
[X86] Fix linux32 pic tests to use correct relocation model (PR39684)

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

llvm-svn: 352476

5 years ago[ARM] Use sub for negative offset load/store in thumb1
David Green [Tue, 29 Jan 2019 10:40:31 +0000 (10:40 +0000)]
[ARM] Use sub for negative offset load/store in thumb1

This attempts to optimise negative values used in load/store operands
a little. We currently try to selct them as rr, materialising the
negative constant using a MOV/MVN pair. This instead selects ri with
an immediate of 0, forcing the add node to become a simpler sub.

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

llvm-svn: 352475

5 years ago[X86] Regenerate abi-isel.ll test
Simon Pilgrim [Tue, 29 Jan 2019 10:39:02 +0000 (10:39 +0000)]
[X86] Regenerate abi-isel.ll test

Adds note requested in D57301 and fixes some missing GOTPCREL addressmath checks

llvm-svn: 352474

5 years ago[analyzer] Toning down invalidation a bit
Gabor Horvath [Tue, 29 Jan 2019 10:27:14 +0000 (10:27 +0000)]
[analyzer] Toning down invalidation a bit

When a function takes the address of a field the analyzer will no longer
assume that the function will change other fields of the enclosing structs.

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

llvm-svn: 352473

5 years ago[ARM] Add extra testcases for D57121. NFC
David Green [Tue, 29 Jan 2019 10:25:56 +0000 (10:25 +0000)]
[ARM] Add extra testcases for D57121. NFC

llvm-svn: 352472

5 years agoRemove 'XFAIL: powerpc64' from a debuginfo test
Jeremy Morse [Tue, 29 Jan 2019 10:23:43 +0000 (10:23 +0000)]
Remove 'XFAIL: powerpc64' from a debuginfo test

This test started XPASSing with r352467, and the change in behaviour
performed by that patch does appear to fix the cause of the original XFAIL
(missing FrameIndex DBG_VALUE), which I've replicated locally with
-mtriple=powerpc64--.

I'll write this up in PR21881 which documents the XFAIL, and seek
confirmation I haven't overlooked something here.

llvm-svn: 352471

5 years ago[analyzer] Added a checklist to help checker authors and reviewers
Gabor Horvath [Tue, 29 Jan 2019 10:21:49 +0000 (10:21 +0000)]
[analyzer] Added a checklist to help checker authors and reviewers

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

llvm-svn: 352470

5 years ago[IPCP] Don't crash due to arg count/type mismatch between caller/callee
Bjorn Pettersson [Tue, 29 Jan 2019 10:19:44 +0000 (10:19 +0000)]
[IPCP] Don't crash due to arg count/type mismatch between caller/callee

Summary:
This patch avoids an assert in IPConstantPropagation when
there is a argument count/type mismatch between the caller and
the callee.

While this is actually UB on C-level (clang emits a warning),
the IR verifier seems to accept it. I'm not sure what other
frontends/languages might think about this, so simply bailing out
to avoid hitting an assert (in CallSiteBase<>::getArgOperand or
Value::doRAUW) seems like a simple solution.

The problem is exposed by the fact that AbstractCallSites will look
through a bitcast at the callee position of a call/invoke.

Reviewers: jdoerfert, reames, efriedma

Reviewed By: jdoerfert, efriedma

Subscribers: eli.friedman, efriedma, llvm-commits

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

llvm-svn: 352469

5 years ago[analyzer] Fix a typo in docs
Gabor Horvath [Tue, 29 Jan 2019 10:15:52 +0000 (10:15 +0000)]
[analyzer] Fix a typo in docs

llvm-svn: 352468

5 years ago[DebugInfo][DAG] Process FrameIndex dbg.values unconditionally
Jeremy Morse [Tue, 29 Jan 2019 09:40:05 +0000 (09:40 +0000)]
[DebugInfo][DAG] Process FrameIndex dbg.values unconditionally

A FrameIndex should be valid throughout a block regardless of what instructions
get selected in that block -- therefore we shouldn't harness dbg.values that
refer to FrameIndexes to an SDNode. There are numerous codegen reasons why
an SDNode never appears or doesn't become a location that a DBG_VALUE can
refer to. None of them actually affect the variable location.

Therefore, before any other tests to encode dbg_values in a SelectionDAG,
identify FrameIndex operands and encode them unattached to any SDNode.

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

llvm-svn: 352467

5 years ago[NFC] Use ArrayRef instead of SmallVectorImpl where possible
Max Kazantsev [Tue, 29 Jan 2019 09:39:15 +0000 (09:39 +0000)]
[NFC] Use ArrayRef instead of SmallVectorImpl where possible

llvm-svn: 352466

5 years ago[COFF, ARM64] Don't put jump table into a separate COFF section for EK_LabelDifference32
Martin Storsjo [Tue, 29 Jan 2019 09:36:48 +0000 (09:36 +0000)]
[COFF, ARM64] Don't put jump table into a separate COFF section for EK_LabelDifference32

Windows ARM64 has PIC relocation model and uses jump table kind
EK_LabelDifference32. This produces jump table entry as
".word LBB123 - LJTI1_2" which represents the distance between the block
and jump table.

A new relocation type (IMAGE_REL_ARM64_REL32) is needed to do the fixup
correctly if they are in different COFF section.

This change saves the jump table to the same COFF section as the
associated code. An ideal fix could be utilizing IMAGE_REL_ARM64_REL32
relocation type.

Patch by Tom Tan!

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

llvm-svn: 352465

5 years ago[NativePDB] Add basic support of methods recostruction in AST
Aleksandr Urakov [Tue, 29 Jan 2019 09:32:23 +0000 (09:32 +0000)]
[NativePDB] Add basic support of methods recostruction in AST

Summary:
This patch adds the basic support of methods reconstruction by native PDB
plugin. It contains only most obvious changes (it processes LF_ONEMETHOD and
LF_METHOD records), some things still remain unsolved:

- mangled names retrieving;
- support of template methods.

Reviewers: zturner, labath, lemo, stella.stamenova

Reviewed by: zturner

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

llvm-svn: 352464

5 years ago[AArch64] Update int64_t ACLE builtin arguments
Sam Parker [Tue, 29 Jan 2019 09:04:03 +0000 (09:04 +0000)]
[AArch64] Update int64_t ACLE builtin arguments

Re-applying r351740 with fixes (changing LL to W).

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

llvm-svn: 352463

5 years ago[CodeGenPrepare] Handle all debug calls in dupRetToEnableTailCallOpts()
Jonas Paulsson [Tue, 29 Jan 2019 09:03:35 +0000 (09:03 +0000)]
[CodeGenPrepare]  Handle all debug calls in dupRetToEnableTailCallOpts()

This patch makes sure that a debug value that is after the bitcast in
dupRetToEnableTailCallOpts() is also skipped.

The reduced test case is from SPEC-2006 on SystemZ.

Review: Vedant Kumar, Wolfgang Pieb
https://reviews.llvm.org/D57050

llvm-svn: 352462

5 years agoDon't define unw_fpreg_t to uint64_t for __ARM_DWARF_EH__
Martin Storsjo [Tue, 29 Jan 2019 09:00:32 +0000 (09:00 +0000)]
Don't define unw_fpreg_t to uint64_t for __ARM_DWARF_EH__

The existing typedef of unw_fpreg_t to uint64_t might work and be
correct for the ARM_EHABI case, but for dwarf, some cases in e.g.
DwarfInstructions.hpp convert between double and unw_fpreg_t.

When converting implicitly between double and unw_fpreg_t (uint64_t),
the values get interpreted as integers and converted to float and vice
versa, while the correct thing would be to keep the same bit pattern.

Avoid the whole issue by using the same definition of unw_fpreg_t
as all other architectures, when using dwarf unwinding on ARM.

Change assembler functions to take a void pointer instead of
unw_fpreg_t pointer, to avoid having a different mangled symbol name
depending on the actual value of this typedef.

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

llvm-svn: 352461

5 years agoFix an incorrectly configured test.
Jeremy Morse [Tue, 29 Jan 2019 08:41:44 +0000 (08:41 +0000)]
Fix an incorrectly configured test.

This should have had a target triple in it, my mistake.

llvm-svn: 352460

5 years ago[MinGW] Ignore the --plugin and --plugin-opt option
Martin Storsjo [Tue, 29 Jan 2019 08:38:48 +0000 (08:38 +0000)]
[MinGW] Ignore the --plugin and --plugin-opt option

GCC can use LLD with -fuse-ld=lld for MinGW these days, but by
default these options are passed to the linker (unless -fno-lto
is passed to the GCC driver).

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

llvm-svn: 352459

5 years agoRemove unused variable to silence compiler warning
Mikael Holmen [Tue, 29 Jan 2019 06:53:31 +0000 (06:53 +0000)]
Remove unused variable to silence compiler warning

llvm-svn: 352456

5 years agoFix compiler warning when using clang 3.6.0
Mikael Holmen [Tue, 29 Jan 2019 06:51:28 +0000 (06:51 +0000)]
Fix compiler warning when using clang 3.6.0

Without the fix we get the following (with -Werror):

../lib/Target/X86/X86ISelLowering.cpp:14181:58: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
  SmallVector<std::array<int, 2>, 2> LaneSrcs(NumLanes, {-1, -1});
                                                         ^~~~~~
                                                         {     }
1 error generated.

llvm-svn: 352455

5 years agoCorrect contents for r352453
Philip Reames [Tue, 29 Jan 2019 06:40:02 +0000 (06:40 +0000)]
Correct contents for r352453

I had a local change I hadn't realized when submitting that auto-update.  As such, the auto-update was wrong.  This should fix it, and with that, it's clearly time to stop submitting changes and go to bed.

llvm-svn: 352454

5 years ago[Tests] Regen to remove future test diffs
Philip Reames [Tue, 29 Jan 2019 06:34:46 +0000 (06:34 +0000)]
[Tests] Regen to remove future test diffs

This file appears to have been manually editted at some point after being auto-updated. A future change adjusts this file slightly, and all of the updates makes the diff super confusing.

llvm-svn: 352453

5 years ago[Test] Add tests for gather/maked.load demanded elements, and convert the whole file...
Philip Reames [Tue, 29 Jan 2019 05:58:32 +0000 (05:58 +0000)]
[Test] Add tests for gather/maked.load demanded elements, and convert the whole file to auto generated checks.

llvm-svn: 352452

5 years ago[SCEV] Take correct loop in AddRec simplification. PR40420
Max Kazantsev [Tue, 29 Jan 2019 05:37:59 +0000 (05:37 +0000)]
[SCEV] Take correct loop in AddRec simplification. PR40420

The code of AddRec simplification is using wrong loop when it creates a new
AddRecExpr. It should be using AddRecLoop which we have saved and against which
all gate checks are made, and not calling AddRec->getLoop() over and over
again because AddRec may change and become an AddRecurrency from outer loop
during the transform iterations.

Considering this change trivial, commiting for postcommit review.

llvm-svn: 352451

5 years ago[NFC] Merge failing test from PR40420
Max Kazantsev [Tue, 29 Jan 2019 05:12:40 +0000 (05:12 +0000)]
[NFC] Merge failing test from PR40420

llvm-svn: 352450

5 years ago[CMake][Fuchsia] Temporarily disable modules for second stage
Petr Hosek [Tue, 29 Jan 2019 03:38:26 +0000 (03:38 +0000)]
[CMake][Fuchsia] Temporarily disable modules for second stage

This is breaking some of builders, disable modules until it's resolved.

llvm-svn: 352449

5 years ago[compiler-rt] Fix reporting unrecognized flags in unit tests.
Igor Kudrin [Tue, 29 Jan 2019 02:31:57 +0000 (02:31 +0000)]
[compiler-rt] Fix reporting unrecognized flags in unit tests.

Previously, the warning messages might be issued within a wrong test case.

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

llvm-svn: 352447

5 years agoTry to make new test more resilient to different orderings
Teresa Johnson [Tue, 29 Jan 2019 02:04:01 +0000 (02:04 +0000)]
Try to make new test more resilient to different orderings

New test added in r352441 getting a bot failure which I believe is
due to different ordering in the dumping which isn't being handled
well. Try to make test more resilient to ordering differences.

llvm-svn: 352446

5 years ago[WebAssembly] Handle more types of uses in WebAssemblyAddMissingPrototypes
Sam Clegg [Tue, 29 Jan 2019 00:30:46 +0000 (00:30 +0000)]
[WebAssembly] Handle more types of uses in WebAssemblyAddMissingPrototypes

Previously we were only handling bitcast operations, however
prototypeless functions can also appear in other places such as
comparisons and as function params.

Switch to using replaceAllUsesWith() to replace the prototype-less
function uses.  This new approach results in some redundant bitcasting
but is much simpler and handles all cases.

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

llvm-svn: 352445

5 years ago[PPC] Include tablegenerated PPCGenCallingConv.inc once
Reid Kleckner [Tue, 29 Jan 2019 00:30:35 +0000 (00:30 +0000)]
[PPC] Include tablegenerated PPCGenCallingConv.inc once

Move the CC analysis implementation to its own .cpp file instead of
duplicating it and artificually using functions in PPCISelLowering.cpp
and PPCFastISel.cpp. Follow-up to the same change done for X86, ARM, and
AArch64.

llvm-svn: 352444

5 years agoAMDGPU: Add ds append/consume builtins
Matt Arsenault [Mon, 28 Jan 2019 23:59:18 +0000 (23:59 +0000)]
AMDGPU: Add ds append/consume builtins

llvm-svn: 352443

5 years ago[WebAssembly] Expand BUILD_PAIR nodes
Thomas Lively [Mon, 28 Jan 2019 23:44:31 +0000 (23:44 +0000)]
[WebAssembly] Expand BUILD_PAIR nodes

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish

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

llvm-svn: 352442

5 years ago[ThinLTO] Add option to dump per-module summary dot graph
Teresa Johnson [Mon, 28 Jan 2019 23:43:26 +0000 (23:43 +0000)]
[ThinLTO] Add option to dump per-module summary dot graph

Summary:
I found that there currently isn't a way to invoke exportToDot from
the command line for a per-module summary index, and therefore no
testing of that case. Add an internal option and use it to test dumping
of per module summary indexes.

In particular, I am looking at fixing the limitation that causes the
aliasee GUID in the per-module summary to be 0, and want to be able to
test that change.

Reviewers: evgeny777

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 352441

5 years agoDemanded elements support for vector GEPs
Philip Reames [Mon, 28 Jan 2019 23:24:49 +0000 (23:24 +0000)]
Demanded elements support for vector GEPs

GEPs can produce either scalar or vector results. If we're extracting only a subset of the vector lanes, simplifying the operands is helpful in eliminating redundant computation, and (eventually) allowing further optimizations

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

llvm-svn: 352440

5 years ago[docs] Fix a couple spelling errors.
Eli Friedman [Mon, 28 Jan 2019 23:03:41 +0000 (23:03 +0000)]
[docs] Fix a couple spelling errors.

llvm-svn: 352439

5 years ago[ThinLTO] Refine reachability check to fix compile time increase
Teresa Johnson [Mon, 28 Jan 2019 22:27:05 +0000 (22:27 +0000)]
[ThinLTO] Refine reachability check to fix compile time increase

Summary:
A recent fix to the ThinLTO whole program dead code elimination (D56117)
increased the thin link time on a large MSAN'ed binary by 2x.
It's likely that the time increased elsewhere, but was more noticeable
here since it was already large and ended up timing out.

That change made it so we would repeatedly scan all copies of linkonce
symbols for liveness every time they were encountered during the graph
traversal. This was needed since we only mark one copy of an aliasee as
live when we encounter a live alias. This patch fixes the issue in a
more efficient manner by simply proactively visiting the aliasee (thus
marking all copies live) when we encounter a live alias.

Two notes: One, this requires a hash table lookup (finding the aliasee
summary in the index based on aliasee GUID). However, the impact of this
seems to be small compared to the original pre-D56117 thin link time. It
could be addressed if we keep the aliasee ValueInfo in the alias summary
instead of the aliasee GUID, which I am exploring in a separate patch.

Second, we only populate the aliasee GUID field when reading summaries
from bitcode (whether we are reading individual summaries and merging on
the fly to form the compiled index, or reading in a serialized combined
index). Thankfully, that's currently the only way we can get to this
code as we don't yet support reading summaries from LLVM assembly
directly into a tool that performs the thin link (they must be converted
to bitcode first). I added a FIXME, however I have the fix under test
already. The easiest fix is to simply populate this field always, which
isn't hard, but more likely the change I am exploring to store the
ValueInfo instead as described above will subsume this. I don't want to
hold up the regression fix for this though.

Reviewers: trentxintong

Subscribers: mehdi_amini, inglorion, dexonsmith, llvm-commits

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

llvm-svn: 352438

5 years ago[CGP] auto-generate complete checks for add overflow tests; NFC
Sanjay Patel [Mon, 28 Jan 2019 22:07:37 +0000 (22:07 +0000)]
[CGP] auto-generate complete checks for add overflow tests; NFC

llvm-svn: 352437

5 years ago[ASTImporter] Fix handling of overriden methods during ASTImport
Shafik Yaghmour [Mon, 28 Jan 2019 21:55:33 +0000 (21:55 +0000)]
[ASTImporter] Fix handling of overriden methods during ASTImport

Summary:
When importing classes we may add a CXXMethodDecl more than once to a CXXRecordDecl when handling overrides. This patch will fix the cases we currently know about and handle the case where we are only dealing with declarations.

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

llvm-svn: 352436

5 years agoAttempt to fix build failure with GCC 5.4.
Rui Ueyama [Mon, 28 Jan 2019 21:45:50 +0000 (21:45 +0000)]
Attempt to fix build failure with GCC 5.4.

llvm-svn: 352435