platform/upstream/llvm.git
6 years agoMake find_opt_files vararg
Adam Nemet [Fri, 29 Sep 2017 05:20:53 +0000 (05:20 +0000)]
Make find_opt_files vararg

This is slightly less verbose for the common case of a single build directory
and more intuitive when using this API directly from the interpreter.

llvm-svn: 314491

6 years ago[ORC] Replace decltype with a concrete type to make MSVC happy.
Lang Hames [Fri, 29 Sep 2017 05:03:43 +0000 (05:03 +0000)]
[ORC] Replace decltype with a concrete type to make MSVC happy.

This should fix some build failures on windows bots due to r314486.

llvm-svn: 314490

6 years ago[XRay][compiler-rt][NFC] Remove loggingInitialized() convenience function
Dean Michael Berris [Fri, 29 Sep 2017 04:28:11 +0000 (04:28 +0000)]
[XRay][compiler-rt][NFC] Remove loggingInitialized() convenience function

The function was introduced as a convenience that used to be called in
multiple places. Recent refactorings have removed the need to call this
function in multiple places, so inlined the implementation in the single
place it's defined.

Broken out from D38119.

llvm-svn: 314489

6 years agoFix Android remote debugging tests running on Windows
Eugene Zemtsov [Fri, 29 Sep 2017 03:25:25 +0000 (03:25 +0000)]
Fix Android remote debugging tests running on Windows

Use make based OS check, instad of relying on shell.

llvm-svn: 314488

6 years agoFix compilation error
Eugene Zemtsov [Fri, 29 Sep 2017 03:15:08 +0000 (03:15 +0000)]
Fix compilation error

llvm-svn: 314487

6 years ago[CMake] Fix typo "Wraning" (NFC)
Brian Gesiak [Fri, 29 Sep 2017 02:48:07 +0000 (02:48 +0000)]
[CMake] Fix typo "Wraning" (NFC)

Summary:
The typo was added in https://reviews.llvm.org/rL247151.
It should be "warning", not "wraning".

llvm-svn: 314486

6 years agollvm-readobj: fix a few typos (NFC)
Saleem Abdulrasool [Fri, 29 Sep 2017 02:45:44 +0000 (02:45 +0000)]
llvm-readobj: fix a few typos (NFC)

Correct the spelling of multiple in a couple of sites.

Patch by Alex Langford!

llvm-svn: 314485

6 years ago[NFC] Replace 'arguments' with 'parameters' in comments relating to lexing a macro...
Faisal Vali [Fri, 29 Sep 2017 02:43:22 +0000 (02:43 +0000)]
[NFC] Replace 'arguments' with 'parameters' in comments relating to lexing a macro definition.

llvm-svn: 314484

6 years ago[NFC] Rename variable 'Arguments' to 'Parameters' when lexing the Macro Definition.
Faisal Vali [Fri, 29 Sep 2017 02:17:31 +0000 (02:17 +0000)]
[NFC] Rename variable 'Arguments' to 'Parameters' when lexing the Macro Definition.

llvm-svn: 314483

6 years agoRevert "[BypassSlowDivision] Improve our handling of divisions by constants"
Sanjoy Das [Fri, 29 Sep 2017 00:54:16 +0000 (00:54 +0000)]
Revert "[BypassSlowDivision] Improve our handling of divisions by constants"

This reverts commit r314253.  It causes a miscompile on P100 in an internal
benchmark.  Reverting while I investigate.

llvm-svn: 314482

6 years agollvm-dwarfdump: support .apple-namespaces in --find
Adrian Prantl [Fri, 29 Sep 2017 00:52:33 +0000 (00:52 +0000)]
llvm-dwarfdump: support .apple-namespaces in --find

llvm-svn: 314481

6 years ago[llvm-rc] Import all make_unique invocations from llvm namespace.
Marek Sokolowski [Fri, 29 Sep 2017 00:33:57 +0000 (00:33 +0000)]
[llvm-rc] Import all make_unique invocations from llvm namespace.

Previous patch fixed one of LLVM buildbots (lld-x86_64-win7).
However, some others have already been failing because of make_unique
compilation error (llvm-clang-x86_64-expensive-checks-win).

llvm-svn: 314480

6 years agollvm-dwarfdump: add support for .apple_types in --find
Adrian Prantl [Fri, 29 Sep 2017 00:33:22 +0000 (00:33 +0000)]
llvm-dwarfdump: add support for .apple_types in --find

llvm-svn: 314479

6 years ago[llvm-rc] Add user-defined resources parsing ability. [8/8]
Marek Sokolowski [Fri, 29 Sep 2017 00:14:18 +0000 (00:14 +0000)]
[llvm-rc] Add user-defined resources parsing ability. [8/8]

This allows llvm-rc to parse user-defined resources (ref:
msdn.microsoft.com/en-us/library/windows/desktop/aa381054.aspx).
These statements either import files, or put the specified raw data in
the resulting resource file.

Thanks to Nico Weber for his original work in this area.

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

llvm-svn: 314478

6 years ago[llvm-rc] Add integer expressions parsing ability. [7/8]
Marek Sokolowski [Thu, 28 Sep 2017 23:53:25 +0000 (23:53 +0000)]
[llvm-rc] Add integer expressions parsing ability. [7/8]

This allows the ints to be written as integer expressions evaluating to
unsigned 16-bit/32-bit integers.

All the expressions may use the following operators: + - & | ~, and
parentheses. Minus token - can be also unary. There is no precedence of
the operators other than the unary operators binding stronger than their
binary counterparts.

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

llvm-svn: 314477

6 years ago[MachineOutliner][NFC] Simplify logic in pruneCandidates
Jessica Paquette [Thu, 28 Sep 2017 23:39:36 +0000 (23:39 +0000)]
[MachineOutliner][NFC] Simplify logic in pruneCandidates

This commit yanks out the repeated sections of code in pruneCandidates into
two lambdas: ShouldSkipCandidate and Prune. This simplifies the logic in
pruneCandidates significantly, and reduces the chance of introducing bugs by
folding all of the shared logic into one place.

llvm-svn: 314475

6 years ago[X86] Don't select (cmp (and, imm), 0) to testw
Craig Topper [Thu, 28 Sep 2017 23:35:36 +0000 (23:35 +0000)]
[X86] Don't select (cmp (and, imm), 0) to testw

Summary:
X86ISelDAGToDAG tries to analyze ANDs compared with 0 to optimize to narrower immediates using subregisters.

I don't think we should be optimizing to 16-bit test instructions. It goes against our normal behavior of promoting i16 operations to i32. It only saves one byte due to the need to add a 0x66 prefix. I think it would also be subject to a length changing prefix penalty in the decoders on Intel CPUs.

Reviewers: RKSimon, zvi, spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 314474

6 years ago[Sema] Put nullability fix-it after the end of the pointer.
Volodymyr Sapsai [Thu, 28 Sep 2017 23:18:49 +0000 (23:18 +0000)]
[Sema] Put nullability fix-it after the end of the pointer.

Fixes nullability fix-it for `id<SomeProtocol>`. With this change
nullability specifier is inserted after ">" instead of between
"id" and "<".

rdar://problem/34260995

Reviewers: jordan_rose, doug.gregor, ahatanak, arphaman

Reviewed By: jordan_rose

Subscribers: cfe-commits

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

llvm-svn: 314473

6 years ago[llvm-rc] Fix-up for r314468 (argument-dependent lookup in make_unique).
Marek Sokolowski [Thu, 28 Sep 2017 23:12:53 +0000 (23:12 +0000)]
[llvm-rc] Fix-up for r314468 (argument-dependent lookup in make_unique).

llvm-svn: 314472

6 years agoARM: Fix cases where CSI Restored bit is not cleared
Matthias Braun [Thu, 28 Sep 2017 23:12:06 +0000 (23:12 +0000)]
ARM: Fix cases where CSI Restored bit is not cleared

LR is an untypical callee saved register in that it is restored into a
different register (PC) and thus does not live-out of the return block.
This case requires the `Restored` flag in CalleeSavedInfo to be cleared.

This fixes a number of cases where this wasn't handled correctly yet.

llvm-svn: 314471

6 years ago[clang] Add getUnsignedPointerDiffType method
Alexander Shaposhnikov [Thu, 28 Sep 2017 23:11:31 +0000 (23:11 +0000)]
[clang] Add getUnsignedPointerDiffType method

C11 standard refers to the unsigned counterpart of the type ptrdiff_t
in the paragraph 7.21.6.1p7 where it defines the format specifier %tu.
In Clang (in PrintfFormatString.cpp, lines 508-510) there is a FIXME for this case,
in particular, Clang didn't diagnose %tu issues at all, i.e.
it didn't emit any warnings on the code printf("%tu", 3.14).
In this diff we add a method getUnsignedPointerDiffType for getting the corresponding type
similarly to how it's already done in the other analogous cases (size_t, ssize_t, ptrdiff_t etc)
and fix -Wformat diagnostics for %tu plus the emitted fix-it as well.

Test plan: make check-all

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

llvm-svn: 314470

6 years agobpf: fix a bug for disassembling ld_pseudo inst
Yonghong Song [Thu, 28 Sep 2017 22:47:34 +0000 (22:47 +0000)]
bpf: fix a bug for disassembling ld_pseudo inst

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 314469

6 years ago[llvm-rc] Add VERSIONINFO parsing ability. [6/8]
Marek Sokolowski [Thu, 28 Sep 2017 22:41:38 +0000 (22:41 +0000)]
[llvm-rc] Add VERSIONINFO parsing ability. [6/8]

This extends the set of llvm-rc parser's available resources by
another one, VERSIONINFO.

Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx

Thanks to Nico Weber for his original work in this area.

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

llvm-svn: 314468

6 years ago[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 28 Sep 2017 22:27:31 +0000 (22:27 +0000)]
[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 314467

6 years ago[x86] add tests for possible insertelement to shuffle transform; NFC
Sanjay Patel [Thu, 28 Sep 2017 22:27:25 +0000 (22:27 +0000)]
[x86] add tests for possible insertelement to shuffle transform; NFC

See PR34716 and D38316 for more discussion.

llvm-svn: 314466

6 years ago[SystemZ] Fix fall-out from r314428
Ulrich Weigand [Thu, 28 Sep 2017 22:08:25 +0000 (22:08 +0000)]
[SystemZ] Fix fall-out from r314428

The expensive-checks build bot found a problem with the r314428 commit:
if CC is live after a ATOMIC_CMP_SWAPW instruction, it needs to be
marked as live-in to the block after the loop the pseudo gets expanded
to.  This actually fixes a code-gen bug as well, since if the CC isn't
live, the CR and JLH are merged to a CRJLH which doesn't actually set
the condition code any more.

llvm-svn: 314465

6 years agoProperly parse a postfix expression following a Boolean literal. Fixes PR34273.
Aaron Ballman [Thu, 28 Sep 2017 21:29:18 +0000 (21:29 +0000)]
Properly parse a postfix expression following a Boolean literal. Fixes PR34273.

Patch by Nicolas Lesser.

llvm-svn: 314463

6 years ago[Sema] Correct nothrow inherited by noexcept
Erich Keane [Thu, 28 Sep 2017 20:47:10 +0000 (20:47 +0000)]
[Sema] Correct nothrow inherited by noexcept

As reported in https://bugs.llvm.org/show_bug.cgi?id=33235,
a noexcept function was unable to inherit from a nothrow defaulted
constructor. Attribute "nothrow" is supposed to be semantically
identical to noexcept, and in fact, a number of other places in the
code treat them identically.

This patch simply checks the RecordDecl for the correct attribute in
the case where no other exception specifier was set.

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

llvm-svn: 314462

6 years ago[Sema] Warn on attribute nothrow conflicting with language specifiers
Erich Keane [Thu, 28 Sep 2017 20:36:53 +0000 (20:36 +0000)]
[Sema] Warn on attribute nothrow conflicting with language specifiers

I discovered it was possible to create a 'nothrow' noexcept(false)
function, which is both non-sensical as well as seemingly breaking.

This patch warns if attribute nothrow is used with anything besides "noexcept".

"noexcept(true)" isn't possible, because the noexcept decl isn't parsed until
later.

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

llvm-svn: 314461

6 years agoFix test change missed in r314456
Erich Keane [Thu, 28 Sep 2017 20:23:43 +0000 (20:23 +0000)]
Fix test change missed in r314456

llvm-svn: 314460

6 years ago[test] forwardlist.cons/move_noexcept.pass.cpp
Casey Carter [Thu, 28 Sep 2017 20:23:43 +0000 (20:23 +0000)]
[test] forwardlist.cons/move_noexcept.pass.cpp

* Don't forbid non-libc++ implementations from strengthening noexcept on forward_list's move constructor.

llvm-svn: 314459

6 years ago[Expression parser] Setting to enable use of ExternalASTMerger
Sean Callanan [Thu, 28 Sep 2017 20:20:25 +0000 (20:20 +0000)]
[Expression parser] Setting to enable use of ExternalASTMerger

This setting can be enabled like this at the target level:

(lldb) settings set target.experimental.use-modern-type-lookup true

This causes several new behaviors in the Clang expression parser:

- It completely disables use of ClangASTImporter.  None are created
  at all, and all users of it are now conditionalized on its
  presence.

- It instead constructs a per-expression ExternalASTMerger, which
  exists inside Clang and contains much of the type completion
  logic that hitherto lived in ExternalASTSource,
  ClangExpressionDeclMap, and ClangASTImporter.

- The expression parser uses this Merger as a backend for copying
  and completing types.

- It also constructs a persistent ExternalASTMerger which is
  connected to the Target's persistent AST context.

This is a major chunk of LLDB functionality moved into Clang.  It
can be tested in two ways:

1. For an individual debug session, enable the setting before
   running a target.

2. For the testsuite, change the option to be default-true.  This
   is done in Target.cpp's g_experimental_properties.  The
   testsuite is not yet clean with this, so I have not committed
   that switch.

I have filed a Bugzilla for extending the testsuite to allow
custom settings for all tests:
  https://bugs.llvm.org/show_bug.cgi?id=34771

I have also filed a Bugzilla for fixing the remaining testsuite
failures with this setting enabled:
  https://bugs.llvm.org/show_bug.cgi?id=34772

llvm-svn: 314458

6 years ago[X86] Make use of vpmovwb when possible in LowerMULH
Craig Topper [Thu, 28 Sep 2017 20:10:34 +0000 (20:10 +0000)]
[X86] Make use of vpmovwb when possible in LowerMULH

If we have BWI, we can truncate in a much simpler way by using vpmovwb. This even works without VLX by using the wider zmm->ymm truncate with a subvector extract.

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

llvm-svn: 314457

6 years agoAdd Documentation to attribute-nothrow. Additionally, limit to functions.
Erich Keane [Thu, 28 Sep 2017 20:08:03 +0000 (20:08 +0000)]
Add Documentation to attribute-nothrow. Additionally, limit to functions.

Attribute nothrow is only allowed on functions, so I added that. Additionally,
it lacks any documentation, so I added some.

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

llvm-svn: 314456

6 years agoAdd a few missing newlines in lldb-server messages
Stephane Sezer [Thu, 28 Sep 2017 19:49:00 +0000 (19:49 +0000)]
Add a few missing newlines in lldb-server messages

Reviewers: fjricci, clayborg

Subscribers: lldb-commits

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

llvm-svn: 314455

6 years agoFix -Werror build.
Evgeniy Stepanov [Thu, 28 Sep 2017 19:43:53 +0000 (19:43 +0000)]
Fix -Werror build.

/code/llvm-project/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp:260:38: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
                                    [this](decltype(ObjLayer)::ObjHandleT,

llvm-svn: 314454

6 years agoRevert "Add support for custom loaders to the sanitizer symbolizer"
Francis Ricci [Thu, 28 Sep 2017 19:37:17 +0000 (19:37 +0000)]
Revert "Add support for custom loaders to the sanitizer symbolizer"

This causes the gcc sanitizer buildbot to timeout.

This reverts commit 81f388fe570e5b6460dd5bc9b9a36b72714eeb68.

llvm-svn: 314453

6 years ago[AMDGPU] Allow flexible register names in inline asm constraints
Yaxun Liu [Thu, 28 Sep 2017 19:07:59 +0000 (19:07 +0000)]
[AMDGPU] Allow flexible register names in inline asm constraints

Currently AMDGPU inline asm only allow v and s as register names in constraints.

This patch allows the following register names in constraints: (n, m is unsigned integer, n < m)

v

s

{vn} or {v[n]}

{sn} or {s[n]}

{S} , where S is a special register name

{v[n:m]}

{s[n:m]}

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

llvm-svn: 314452

6 years ago[ARM] Restore the right frame pointer register in Int_eh_sjlj_longjmp
Martin Storsjo [Thu, 28 Sep 2017 19:04:30 +0000 (19:04 +0000)]
[ARM] Restore the right frame pointer register in Int_eh_sjlj_longjmp

In setupEntryBlockAndCallSites in CodeGen/SjLjEHPrepare.cpp,
we fetch and store the actual frame pointer, but on return via
the longjmp intrinsic, it always was restored into the r7 variable.

On windows, the frame pointer should be restored into r11 instead of r7.

On Darwin (where sjlj exception handling is used by default), the frame
pointer is always r7, both in arm and thumb mode, and likewise, on
windows, the frame pointer always is r11.

On linux however, if sjlj exception handling is enabled (which it isn't
by default), libcxxabi and the user code can be built in differing modes
using different registers as frame pointer. Therefore, when restoring
registers on a platform where we don't always use the same register
depending on code mode, restore both r7 and r11.

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

llvm-svn: 314451

6 years ago[ARM] Fix SJLJ exception handling when manually chosen on a platform where it isn...
Martin Storsjo [Thu, 28 Sep 2017 19:04:14 +0000 (19:04 +0000)]
[ARM] Fix SJLJ exception handling when manually chosen on a platform where it isn't default

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

llvm-svn: 314450

6 years agoMIR: Serialize CaleeSavedInfo Restored flag
Matthias Braun [Thu, 28 Sep 2017 18:52:14 +0000 (18:52 +0000)]
MIR: Serialize CaleeSavedInfo Restored flag

llvm-svn: 314449

6 years ago[AVX512] Add avx512bw command lines to 128-bit idiv tests.
Craig Topper [Thu, 28 Sep 2017 18:45:29 +0000 (18:45 +0000)]
[AVX512] Add avx512bw command lines to 128-bit idiv tests.

The multiply lowering on some of the tests can take advantage of the vpmovwb to simplify the truncate.

llvm-svn: 314448

6 years ago[X86] Use target independent ZERO_EXTEND/SIGN_EXTEND nodes were possible in LowerMULH
Craig Topper [Thu, 28 Sep 2017 18:45:28 +0000 (18:45 +0000)]
[X86] Use target independent ZERO_EXTEND/SIGN_EXTEND nodes were possible in LowerMULH

We aren't do any in register extends here so we should be able to just the target independent nodes directly and allow them to be lowered as necessary.

llvm-svn: 314447

6 years ago[X86] Move a setOperation action for ISD::TRUNCATE near another one in the same if...
Craig Topper [Thu, 28 Sep 2017 18:45:27 +0000 (18:45 +0000)]
[X86] Move a setOperation action for ISD::TRUNCATE near another one in the same if. Remove one that is redundant with another subtarget features.

llvm-svn: 314446

6 years ago[clangd] Skip informative qualifier chunks.
Ilya Biryukov [Thu, 28 Sep 2017 18:39:59 +0000 (18:39 +0000)]
[clangd] Skip informative qualifier chunks.

Summary:
Completion results look much nicer without them.
Informative qualifiers are stored for every method from a base class, even when
calling those methods does not require any qualifiers. For example,
    struct Foo { int foo(); };
    struct Bar : Foo { };
    void test() { Bar(). // Completion item label was 'Foo::foo' before,
                         // but inserted text was simply 'foo'.
                         // We now simply show 'foo' in completion item label.

They effectively cluttered the completion list without providing much value.

Reviewers: bkramer, krasimir, rwols

Reviewed By: rwols

Subscribers: klimek, cfe-commits

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

llvm-svn: 314445

6 years ago[DWARF] Allow forward declarations of a class template instantiation
Paul Robinson [Thu, 28 Sep 2017 18:37:02 +0000 (18:37 +0000)]
[DWARF] Allow forward declarations of a class template instantiation
to have child entries describing the template parameters.  This will
be on by default for SCE tuning.

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

llvm-svn: 314444

6 years agoAddress further review feedback. (NFC)
Adrian Prantl [Thu, 28 Sep 2017 18:31:51 +0000 (18:31 +0000)]
Address further review feedback. (NFC)

llvm-svn: 314443

6 years agotry and appease gcc
Adrian Prantl [Thu, 28 Sep 2017 18:27:00 +0000 (18:27 +0000)]
try and appease gcc

llvm-svn: 314442

6 years ago[asan] Fix the bug number in the error message.
Evgeniy Stepanov [Thu, 28 Sep 2017 18:19:44 +0000 (18:19 +0000)]
[asan] Fix the bug number in the error message.

The link in the "Shadow memory range interleaves with an existing
memory mapping" error message was pointing to the wrong bug.

llvm-svn: 314441

6 years agoFix header location with PHDR.
Rafael Espindola [Thu, 28 Sep 2017 18:12:13 +0000 (18:12 +0000)]
Fix header location with PHDR.

We were not subtracting its size, causing it to overlap with section
data.

Fixes PR34750.

llvm-svn: 314440

6 years agollvm-dwarfdump: implement --find for .apple_names
Adrian Prantl [Thu, 28 Sep 2017 18:10:52 +0000 (18:10 +0000)]
llvm-dwarfdump: implement --find for .apple_names

This patch implements the dwarfdump option --find=<name>.  This option
looks for a DIE in the accelerator tables and dumps it if found.  This
initial patch only adds support for .apple_names to keep the review
small, adding the other sections and pubnames support should be
trivial though.

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

llvm-svn: 314439

6 years ago[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.
Lang Hames [Thu, 28 Sep 2017 17:43:07 +0000 (17:43 +0000)]
[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.

Bug found by Stefan Granitz. Thanks Stefan!

llvm-svn: 314436

6 years ago[JumpThreading] Preserve DT and LVI across the pass
Evandro Menezes [Thu, 28 Sep 2017 17:24:40 +0000 (17:24 +0000)]
[JumpThreading] Preserve DT and LVI across the pass

JumpThreading now preserves dominance and lazy value information across the
entire pass.  The pass manager is also informed of this preservation with
the goal of DT and LVI being recalculated fewer times overall during
compilation.

This change prepares JumpThreading for enhanced opportunities; particularly
those across loop boundaries.

Patch by: Brian Rzycki <b.rzycki@samsung.com>,
          Sebastian Pop <s.pop@samsung.com>

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

llvm-svn: 314435

6 years agoAdd a test.
Rafael Espindola [Thu, 28 Sep 2017 17:15:02 +0000 (17:15 +0000)]
Add a test.

This would have found the issues with r313697.

The problem was that that commit mixed the content of different
.eh_frame sections. Unfortunately we had no tests looking inside the
fdes.

llvm-svn: 314433

6 years ago[X86] Use BWI instructions to improve lowering of v32i8 MULHU/S
Craig Topper [Thu, 28 Sep 2017 17:00:21 +0000 (17:00 +0000)]
[X86] Use BWI instructions to improve lowering of v32i8 MULHU/S

Summary: If we have BWI instructions we can widen to v32i16 to do the multiply instead of splitting.

Reviewers: RKSimon, spatel, zvi

Reviewed By: zvi

Subscribers: llvm-commits

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

llvm-svn: 314432

6 years agoAdd support for custom loaders to the sanitizer symbolizer
Francis Ricci [Thu, 28 Sep 2017 16:58:35 +0000 (16:58 +0000)]
Add support for custom loaders to the sanitizer symbolizer

Summary:
Adds a fallback mode to procmaps when the symbolizer
fails to locate a module for a given address by using
dl_iterate_phdr.

Reviewers: kubamracek, rnk, vitalybuka, eugenis

Reviewed By: eugenis

Subscribers: srhines, llvm-commits

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

llvm-svn: 314431

6 years ago[X86] Remove dead code from X86ISelDAGToDAG.cpp multiply handling
Craig Topper [Thu, 28 Sep 2017 16:56:36 +0000 (16:56 +0000)]
[X86] Remove dead code from X86ISelDAGToDAG.cpp multiply handling

Summary:
Lowering never creates X86ISD::UMUL for 8-bit types. X86ISD::UMUL8 is used instead. If X86ISD::UMUL 8-bit were ever used it would crash.

DAGCombiner replaces UMUL_LOHI/SMUL_LOHI with a wider MUL and a shift if the type twice as wide is legal. So we should never see i8 UMUL_LOHI/SMUL_LOHI. In fact I think there was a bug in part of the i8 code. Similar is true for i16 though without the bug.

Reviewers: RKSimon, spatel, zvi

Reviewed By: zvi

Subscribers: llvm-commits

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

llvm-svn: 314430

6 years ago[X86] Use correct subvector index when combining two insert subvectors featuring...
Craig Topper [Thu, 28 Sep 2017 16:53:16 +0000 (16:53 +0000)]
[X86] Use correct subvector index when combining two insert subvectors featuring zero vectors.

Previously we were using one of the subvector indices twice. The included test case causes an assert without this change.

Thanks to Simon Pilgrim for catching this.

llvm-svn: 314429

6 years ago[SystemZ] Custom-expand ATOMIC_CMP_AND_SWAP_WITH_SUCCESS
Ulrich Weigand [Thu, 28 Sep 2017 16:22:54 +0000 (16:22 +0000)]
[SystemZ] Custom-expand ATOMIC_CMP_AND_SWAP_WITH_SUCCESS

The SystemZ compare-and-swap instructions already provide the "success"
indication via a condition-code value, so the default expansion of those
operations generates an unnecessary extra comparsion.

llvm-svn: 314428

6 years agoConsolidate std::move() detection code. No behavior change.
Nico Weber [Thu, 28 Sep 2017 16:16:39 +0000 (16:16 +0000)]
Consolidate std::move() detection code. No behavior change.

llvm-svn: 314427

6 years ago[dwarfdump] Verify that CUs have a unit DIE.
Jonas Devlieghere [Thu, 28 Sep 2017 15:57:50 +0000 (15:57 +0000)]
[dwarfdump] Verify that CUs have a unit DIE.

This patch adds a check to the DWARF verifier to detect CUs without a
unit DIE.

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

llvm-svn: 314426

6 years agoUse SDValue::getConstantOperandVal helper. NFCI.
Simon Pilgrim [Thu, 28 Sep 2017 15:53:27 +0000 (15:53 +0000)]
Use SDValue::getConstantOperandVal helper. NFCI.

llvm-svn: 314425

6 years agoFix -Wcast-qual warning after r314336.
Nico Weber [Thu, 28 Sep 2017 15:44:46 +0000 (15:44 +0000)]
Fix -Wcast-qual warning after r314336.

llvm-svn: 314424

6 years ago[Docs] Replace 0-byte incorrect GEMM_double image with the one from www/images
Siddharth Bhat [Thu, 28 Sep 2017 15:31:24 +0000 (15:31 +0000)]
[Docs] Replace 0-byte incorrect GEMM_double image with the one from www/images

llvm-svn: 314423

6 years ago[Docs] fix rendering of alpha and beta
Siddharth Bhat [Thu, 28 Sep 2017 15:31:20 +0000 (15:31 +0000)]
[Docs] fix rendering of alpha and beta

llvm-svn: 314422

6 years ago[mips] Remove codegen support for branch likely instructions.
Simon Dardis [Thu, 28 Sep 2017 15:24:07 +0000 (15:24 +0000)]
[mips] Remove codegen support for branch likely instructions.

This patch disables codegen support for branch likely instructions to
address a potential bug. These branches were unselectable as
they had the same patterns as the normal branches but came after them
when ISel was concerned.

The branch likely instructions were marked as having no delay
slots when they have annulling delay slots. The delay slot filler
does not currently handle annulling delay slot branches, so this
would lead to wrong codegen if these branches were generated.

Reviewers: atanasyan, nitesh.jain

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

llvm-svn: 314421

6 years agoDocs: fix link to Debugger intrinsic functions
Hans Wennborg [Thu, 28 Sep 2017 15:16:37 +0000 (15:16 +0000)]
Docs: fix link to Debugger intrinsic functions

llvm-svn: 314420

6 years ago[Docs] Add a performance document.
Siddharth Bhat [Thu, 28 Sep 2017 15:10:22 +0000 (15:10 +0000)]
[Docs] Add a performance document.

Summary:
Add a document which describes:

- GEMM performance comparison.
- An experiment that measures the compile time impact
  of enabling Polly when compiling LLVM+Clang+Polly.

Contributed-by: Theodoros Theodoridis<theodoros.theodoridis@inf.ethz.ch>
Differential Revision: https://reviews.llvm.org/D38330

llvm-svn: 314419

6 years ago[LoopUnroll] Fix use after poison.
Benjamin Kramer [Thu, 28 Sep 2017 14:47:39 +0000 (14:47 +0000)]
[LoopUnroll] Fix use after poison.

llvm-svn: 314418

6 years ago[X86] Add overflow intrinsic test in preparation for D38161.
Amara Emerson [Thu, 28 Sep 2017 13:43:48 +0000 (13:43 +0000)]
[X86] Add overflow intrinsic test in preparation for D38161.

This commit adds the test file before codegen changes as requested in
D38161 to make it easier to see the difference.

llvm-svn: 314416

6 years ago[asan] Unpoison global metadata on dlclose.
Benjamin Kramer [Thu, 28 Sep 2017 13:38:58 +0000 (13:38 +0000)]
[asan] Unpoison global metadata on dlclose.

dlclose itself might touch it, so better return it to the state it was
before. I don't know how to create a test for this as it would require
chaning dlclose itself.

llvm-svn: 314415

6 years ago[DebugInfo] Do not extend range for physreg in LiveDebugVariables
Bjorn Pettersson [Thu, 28 Sep 2017 13:10:06 +0000 (13:10 +0000)]
[DebugInfo] Do not extend range for physreg in LiveDebugVariables

Summary:
A DBG_VALUE that is referring to a physical register is
valid up until the next def of the register, or the end
of the basic block that it belongs to.

LiveDebugVariables is computing live intervals (slot index
ranges) for DBG_VALUE instructions, before regalloc, in order
to be able to re-insert DBG_VALUE instructions again after
regalloc. When the DBG_VALUE is mapping a variable to a
physical register we do not need to compute the range. We
should simply re-insert the DBG_VALUE at the start position.

The problem that was found, resulting in this patch, was a
situation when the DBG_VALUE was the last real use of the
physical register. The computeIntervals/extendDef methods
extended the range to cover the whole basic block, even though
the physical register very well could be allocated to some
virtual register inside the basic block. So the extended
range could not be trusted.

This patch is a preparation for https://reviews.llvm.org/D38229,
where the goal is to insert DBG_VALUE after each new definition
of a variable, even if the virtual registers that the variable
was connected to has been coalesced into using the same physical
register (e.g. due to two address instructions). For more info
see https://bugs.llvm.org/show_bug.cgi?id=34545

Reviewers: aprantl, rnk, echristo

Reviewed By: aprantl

Subscribers: Ka-Ka, llvm-commits

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

llvm-svn: 314414

6 years ago[LoopInfo] Don't poison random memory regions.
Benjamin Kramer [Thu, 28 Sep 2017 12:53:20 +0000 (12:53 +0000)]
[LoopInfo] Don't poison random memory regions.

The second argument for Allocator::Deallocate is the number of elements,
not the size of a single element. In asan mode specifying a large number
of elements poisoned random memory regions, leading to crashes
everywhere.

llvm-svn: 314413

6 years agoFix the build after r314375
Philip Pfaffe [Thu, 28 Sep 2017 12:20:24 +0000 (12:20 +0000)]
Fix the build after r314375

r314375 privatized Loop's constructor and replaced it with an Allocator.

llvm-svn: 314412

6 years ago[LVI] Move LVILatticeVal class to separate header file (NFC).
Florian Hahn [Thu, 28 Sep 2017 11:09:22 +0000 (11:09 +0000)]
[LVI] Move LVILatticeVal class to separate header file (NFC).

Summary:
This allows sharing the lattice value code between LVI and SCCP (D36656).

It also adds a `satisfiesPredicate` function, used by D36656.

Reviewers: davide, sanjoy, efriedma

Reviewed By: sanjoy

Subscribers: mgorny, llvm-commits

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

llvm-svn: 314411

6 years ago[x86][AsmParser] Allow some more MS size directives
Coby Tayree [Thu, 28 Sep 2017 11:04:08 +0000 (11:04 +0000)]
[x86][AsmParser] Allow some more MS size directives
MS allows the following size directives: float/double and long as synonymous to dword/qword and dword, respectively.
Differential Revision: https://reviews.llvm.org/D37190

llvm-svn: 314410

6 years ago[llvm-cov] Create directory structure when filtering using -name*= options
Sean Eveson [Thu, 28 Sep 2017 10:07:30 +0000 (10:07 +0000)]
[llvm-cov] Create directory structure when filtering using -name*= options

Before this change using any of the -name*= command line options with an output
directory would result in a single file (functions.txt/functions.html)
containing the coverage for those specific functions. Now you get the same
directory structure as when not using any -name*= options.

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

llvm-svn: 314396

6 years ago[Support] Force instantiation of isl dump() methods. NFC.
Michael Kruse [Thu, 28 Sep 2017 09:51:04 +0000 (09:51 +0000)]
[Support] Force instantiation of isl dump() methods. NFC.

In order for debuggers to be able to call an inline method, it must have
been instantiated somewhere. The dump() methods are usually not used, so
add an instantiation in debug builds.

This allows to call .dump() on any isl++ object from the gcc/gdb and
Visual Studio debugger in debug builds with assertions enabled.
In optimized builds, even with assertions enabled, the dump() methods
are also inlined in GICHelper.cpp, so no externally visible symbols
will be available either.

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

llvm-svn: 314395

6 years ago[EFL] - Fix incorrect code style. NFC.
George Rimar [Thu, 28 Sep 2017 09:40:17 +0000 (09:40 +0000)]
[EFL] - Fix incorrect code style. NFC.

llvm-svn: 314394

6 years agoTeach TargetInstrInfo::getInlineAsmLength to parse .space directives with integer...
Alex Bradbury [Thu, 28 Sep 2017 09:31:46 +0000 (09:31 +0000)]
Teach TargetInstrInfo::getInlineAsmLength to parse .space directives with integer arguments

It's currently quite difficult to test passes like branch relaxation, which
requires branches with large displacement to be generated. The .space assembler
directive makes it easy to create arbitrarily large basic blocks, but
getInlineAsmLength is not able to parse it and so the size of the block is not
correctly estimated. Other backends (AArch64, AMDGPU) introduce options just
for testing that artificially restrict the ranges of branch instructions (e.g.
aarch64-tbz-offset-bits). Although parsing a single form of the .space
directive feels inelegant, it does allow a more direct testing approach.

This patch adapts the .space parsing code from
Mips16InstrInfo::getInlineAsmLength and removes it now the extra functionality
is provided by the base implementation. I want to move this functionality to
the generic getInlineAsmLength as 1) I need the same for RISC-V, and 2) I feel
other backends will benefit from more direct testing of large branch
displacements.

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

llvm-svn: 314393

6 years ago[ELF] - Change error message text. NFC.
George Rimar [Thu, 28 Sep 2017 09:29:03 +0000 (09:29 +0000)]
[ELF] - Change error message text. NFC.

As suggested in review comments of D38170.

llvm-svn: 314392

6 years agoUse std::is_trivial instead of is_trivially_copyable.
Benjamin Kramer [Thu, 28 Sep 2017 08:50:30 +0000 (08:50 +0000)]
Use std::is_trivial instead of is_trivially_copyable.

The oldest versions of GCC we support (before 5) didn't support that
trait. is_trivial is stronger superset that clang::Token fulfills, so
just use that instead.

llvm-svn: 314391

6 years ago[PowerPC] eliminate partially redundant compare instruction
Hiroshi Inoue [Thu, 28 Sep 2017 08:38:19 +0000 (08:38 +0000)]
[PowerPC] eliminate partially redundant compare instruction

This is a follow-on of D37211.
D37211 eliminates a compare instruction if two conditional branches can be made based on the one compare instruction, e.g.
if (a == 0) { ... }
else if (a < 0) { ... }

This patch extends this optimization to support partially redundant cases, which often happen in while loops.
For example, one compare instruction is moved from the loop body into the preheader by this optimization in the following example.
do {
  if (a == 0) dummy1();
  a = func(a);
} while (a > 0);

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

llvm-svn: 314390

6 years ago[RISCV] Add common fixups and relocations
Alex Bradbury [Thu, 28 Sep 2017 08:26:24 +0000 (08:26 +0000)]
[RISCV] Add common fixups and relocations

%lo(), %hi(), and %pcrel_hi() are supported and test cases have been added to
ensure the appropriate fixups and relocations are generated. I've added an
instruction format field which is used in RISCVMCCodeEmitter to, for
instance, tell whether it should emit a lo12_i fixup or a lo12_s fixup
(RISC-V has two 12-bit immediate encodings depending on the instruction
type).

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

llvm-svn: 314389

6 years ago[RegAllocGreedy]: Allow recoloring of done register if it's non-tied
Mikael Holmen [Thu, 28 Sep 2017 08:22:35 +0000 (08:22 +0000)]
[RegAllocGreedy]: Allow recoloring of done register if it's non-tied

Summary:
If we have a non-allocated register, we allow us to try recoloring of an
already allocated and "Done" register, even if they are of the same
register class, if the non-allocated register has at least one tied def
and the allocated one has none.

It should be easier to recolor the non-tied register than the tied one, so
it might be an improvement even if they use the same regclasses.

Reviewers: qcolombet

Reviewed By: qcolombet

Subscribers: llvm-commits, MatzeB

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

llvm-svn: 314388

6 years agoAdd the new -Wnull-pointer-arithmetic warnings to the release notes
Sylvestre Ledru [Thu, 28 Sep 2017 08:00:18 +0000 (08:00 +0000)]
Add the new -Wnull-pointer-arithmetic warnings to the release notes

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

llvm-svn: 314387

6 years ago[RISCV] Define RISC-V specific e_flags
Alex Bradbury [Thu, 28 Sep 2017 07:54:01 +0000 (07:54 +0000)]
[RISCV] Define RISC-V specific e_flags

Add RISC-V e_flags as defined in the ABI document:

https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#file-header

Differential Revision: https://reviews.llvm.org/D38310
Patch by Chih-Mao Chen.

llvm-svn: 314386

6 years ago[X86] Adding more cases to horizontal [f]add/[f]sub for avx512.
Jatin Bhateja [Thu, 28 Sep 2017 07:40:52 +0000 (07:40 +0000)]
[X86] Adding more cases to horizontal [f]add/[f]sub for avx512.

Reviewers: jbhateja

Reviewed By: jbhateja

Subscribers: llvm-commits

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

llvm-svn: 314385

6 years agotsan: handle signals in pause call
Dmitry Vyukov [Thu, 28 Sep 2017 07:32:00 +0000 (07:32 +0000)]
tsan: handle signals in pause call

llvm-svn: 314384

6 years ago[DAGCombiner] Fix an off-by-one error in vector logic
George Burgess IV [Thu, 28 Sep 2017 06:17:19 +0000 (06:17 +0000)]
[DAGCombiner] Fix an off-by-one error in vector logic

Without this, we could end up trying to get the Nth (0-indexed) element
from a subvector of size N.

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

llvm-svn: 314380

6 years ago[XRay] [compiler-rt] FDR logging arg1 handler
Martin Pelikan [Thu, 28 Sep 2017 05:29:59 +0000 (05:29 +0000)]
[XRay] [compiler-rt] FDR logging arg1 handler

Summary:
Write out records about logged function call first arguments. D32840
implements the reading of this in llvm-xray.

Reviewers: dberris

Subscribers: llvm-commits

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

llvm-svn: 314378

6 years ago[clangd] LSP extension to switch between source/header file
Marc-Andre Laperle [Thu, 28 Sep 2017 03:14:40 +0000 (03:14 +0000)]
[clangd] LSP extension to switch between source/header file

Summary:
Small extension to LSP to allow clients to use clangd to switch between C header files and source files.
Final version will use the completed clangd indexer to use the index of symbols to be able to switch from header to source file when the file names don't match.

Reviewers: malaperle, krasimir, bkramer, ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ilya-biryukov, cfe-commits, arphaman

Patch by: William Enright

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

llvm-svn: 314377

6 years agobpf: add new insns for bswap_to_le and negation
Yonghong Song [Thu, 28 Sep 2017 02:46:11 +0000 (02:46 +0000)]
bpf: add new insns for bswap_to_le and negation

This patch adds new insn, "reg = be16/be32/be64 reg",
for bswap to little endian for big-endian target (bpfeb).
It also adds new insn for negation "reg = -reg".

Currently, for source code, e.g.,
  b = -a
LLVM still prefers to generate:
  b = 0 - a
But "reg = -reg" format can be used in assembly code.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 314376

6 years agoUse a BumpPtrAllocator for Loop objects
Sanjoy Das [Thu, 28 Sep 2017 02:45:42 +0000 (02:45 +0000)]
Use a BumpPtrAllocator for Loop objects

Summary:
And now that we no longer have to explicitly free() the Loop instances, we can
(with more ease) use the destructor of LoopBase to do what LoopBase::clear() was
doing.

Reviewers: chandlerc

Subscribers: mehdi_amini, mcrosier, llvm-commits

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

llvm-svn: 314375

6 years ago[ORC] Update the GlobalMappingLayer interface to fit the error-ized layer
Lang Hames [Thu, 28 Sep 2017 02:17:35 +0000 (02:17 +0000)]
[ORC] Update the GlobalMappingLayer interface to fit the error-ized layer
concept.

Add a unit-test to make sure we don't backslide, and tweak the MockBaseLayer
utility to make it easier to test this kind of thing in the future.

llvm-svn: 314374

6 years ago[NFC] Don't use C++17 standard lib variable template helper traits, instead use ...
Faisal Vali [Thu, 28 Sep 2017 02:00:40 +0000 (02:00 +0000)]
[NFC] Don't use C++17 standard lib variable template helper traits, instead use ::value.

llvm-svn: 314373

6 years ago[NFC] Modernize MacroArgs using TrailingObjects
Faisal Vali [Thu, 28 Sep 2017 01:50:23 +0000 (01:50 +0000)]
[NFC] Modernize MacroArgs using TrailingObjects

Refactor MacroArgs to use TrailingObjects when creating a variably sized object on the heap to store the unexpanded tokens immediately after the MacroArgs object.

llvm-svn: 314372

6 years agoRevert patch r313904, as it breaks "command source" and in
Jim Ingham [Thu, 28 Sep 2017 01:39:07 +0000 (01:39 +0000)]
Revert patch r313904, as it breaks "command source" and in
particular causes lldb to die on startup if you have a ~/.lldbinit file.

I filed:

https://bugs.llvm.org/show_bug.cgi?id=34758

to cover fixing the bug.

llvm-svn: 314371

6 years agoLook through parentheses.
Akira Hatanaka [Thu, 28 Sep 2017 01:31:17 +0000 (01:31 +0000)]
Look through parentheses.

This fixes a bug where clang would emit instructions to reclaim a value
that's going to be __bridge-casted to CF.

rdar://problem/34687542

llvm-svn: 314370

6 years ago[ubsan] Merge ubsan_standalone_cxx shared library.
Evgeniy Stepanov [Thu, 28 Sep 2017 00:31:09 +0000 (00:31 +0000)]
[ubsan] Merge ubsan_standalone_cxx shared library.

Summary:
Link everything, including the C++ bits, in the single
ubsan_standalone SHARED library. This matches ASan setup.

Reviewers: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny

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

llvm-svn: 314369