platform/upstream/llvm.git
6 years agoRemove recursion from FindModuleForAddress. NFC.
Francis Ricci [Fri, 29 Sep 2017 15:14:31 +0000 (15:14 +0000)]
Remove recursion from FindModuleForAddress. NFC.

llvm-svn: 314520

6 years ago[ScopBuilder] Fix typo. NFC.
Michael Kruse [Fri, 29 Sep 2017 15:13:05 +0000 (15:13 +0000)]
[ScopBuilder] Fix typo. NFC.

Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D38322

llvm-svn: 314519

6 years agoRefactor android fallback procmaps init. NFC.
Francis Ricci [Fri, 29 Sep 2017 15:06:47 +0000 (15:06 +0000)]
Refactor android fallback procmaps init. NFC.

llvm-svn: 314518

6 years agoUse the basic cost if a GEP is not used as addressing mode
Jun Bum Lim [Fri, 29 Sep 2017 14:50:16 +0000 (14:50 +0000)]
Use the basic cost if a GEP is not used as addressing mode

Summary:
Currently, getGEPCost() returns TCC_FREE whenever a GEP is a legal addressing mode in the target.
However, since it doesn't check its actual users, it will return FREE even in cases
where the GEP cannot be folded away as a part of actual addressing mode.
For example, if an user of the GEP is a call instruction taking the GEP as a parameter,
then the GEP may not be folded in isel.

Reviewers: hfinkel, efriedma, mcrosier, jingyue, haicheng

Reviewed By: hfinkel

Subscribers: javed.absar, llvm-commits

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

llvm-svn: 314517

6 years ago[SystemZ] implement shouldCoalesce()
Jonas Paulsson [Fri, 29 Sep 2017 14:31:39 +0000 (14:31 +0000)]
[SystemZ]  implement shouldCoalesce()

Implement shouldCoalesce() to help regalloc avoid running out of GR128
registers.

If a COPY involving a subreg of a GR128 is coalesced, the live range of the
GR128 virtual register will be extended. If this happens where there are
enough phys-reg clobbers present, regalloc will run out of registers (if
there is not a single GR128 allocatable register available).

This patch tries to allow coalescing only when it can prove that this will be
safe by checking the (local) interval in question.

Review: Ulrich Weigand, Quentin Colombet
https://reviews.llvm.org/D37899
https://bugs.llvm.org/show_bug.cgi?id=34610

llvm-svn: 314516

6 years agoFix spelling in comments. NFCI.
Simon Pilgrim [Fri, 29 Sep 2017 14:13:47 +0000 (14:13 +0000)]
Fix spelling in comments. NFCI.

llvm-svn: 314515

6 years ago[X86] Improve codegen for inverted overflow checking intrinsics.
Amara Emerson [Fri, 29 Sep 2017 13:53:44 +0000 (13:53 +0000)]
[X86] Improve codegen for inverted overflow checking intrinsics.

Adds a new combine for: xor(setcc cc, val), 1 --> setcc (invert(cc), val)

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

llvm-svn: 314514

6 years ago[test] Fix uninitialized memory in omp_taskloop_grainsize.c
Jonas Hahnfeld [Fri, 29 Sep 2017 13:53:03 +0000 (13:53 +0000)]
[test] Fix uninitialized memory in omp_taskloop_grainsize.c

result was never initialized to zero which sometimes failed the test.

llvm-svn: 314513

6 years ago[CMake] Fix configuration on PowerPC with sanitizers
Jonas Hahnfeld [Fri, 29 Sep 2017 13:32:39 +0000 (13:32 +0000)]
[CMake] Fix configuration on PowerPC with sanitizers

TEST_BIG_ENDIAN() performs compile tests that will fail with
-nodefaultlibs when building under LLVM_USE_SANITIZER.

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

llvm-svn: 314512

6 years ago[ARM] v8.3-a complex number support
Sam Parker [Fri, 29 Sep 2017 13:11:33 +0000 (13:11 +0000)]
[ARM] v8.3-a complex number support

New instructions are added to AArch32 and AArch64 to aid
floating-point multiplication and addition of complex numbers, where
the complex numbers are packed in a vector register as a pair of
elements. The Imaginary part of the number is placed in the more
significant element, and the Real part of the number is placed in the
less significant element.

This patch adds assembler for the ARM target.

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

llvm-svn: 314511

6 years agoSmall modification <NFC>
Michael Zuckerman [Fri, 29 Sep 2017 12:45:54 +0000 (12:45 +0000)]
Small modification <NFC>

Change-Id: I360abccee12cae29bd2ac4f8399c9ecc92eb7f13
llvm-svn: 314510

6 years ago[docs][refactor] Add refactoring engine design documentation
Alex Lorenz [Fri, 29 Sep 2017 12:21:38 +0000 (12:21 +0000)]
[docs][refactor] Add refactoring engine design documentation

This commit adds a refactoring engine design document that talks about the
design and provides several example of how the engine can be used.

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

llvm-svn: 314509

6 years agoFix Wmismatched-tags warning.
Simon Pilgrim [Fri, 29 Sep 2017 11:42:05 +0000 (11:42 +0000)]
Fix Wmismatched-tags warning.

InlineAsmIdentifierInfo was declared a class in some places and a class in others.

llvm-svn: 314508

6 years ago[mips] Reordering callseq* nodes to be linear
Aleksandar Beserminji [Fri, 29 Sep 2017 11:05:02 +0000 (11:05 +0000)]
[mips] Reordering callseq* nodes to be linear

Fix nested callseq* nodes by moving callseq_start after the
arguments calculation to temporary registers, so that callseq* nodes
in resulting DAG are linear.

Recommitting r314497. This version does not contain test which fails
when compiler is not build in debug mode.

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

llvm-svn: 314507

6 years agoRevert "[mips] Reordering callseq* nodes to be linear"
Aleksandar Beserminji [Fri, 29 Sep 2017 10:52:03 +0000 (10:52 +0000)]
Revert "[mips] Reordering callseq* nodes to be linear"

Added test relies on the compiler being built in debug mode,
which may not be the case.

This reverts commit r314497.

llvm-svn: 314506

6 years ago[mips] Add missing license info, formatting changes. NFCI
Simon Dardis [Fri, 29 Sep 2017 10:08:06 +0000 (10:08 +0000)]
[mips] Add missing license info, formatting changes. NFCI

Add missing license information to MicroMipsInstrFPU.td and
fix most of the formatting errors present. Others will be
addressed in a follow up commits.

llvm-svn: 314505

6 years ago[X86][SSE] Added more tests for vector multiplications as utility for D37896
Simon Pilgrim [Fri, 29 Sep 2017 10:02:01 +0000 (10:02 +0000)]
[X86][SSE] Added more tests for vector multiplications as utility for D37896

Added additional tests for vector multiplications with multipliers that are:
 * powers of 2 displaced by 1,
 * product of a power of 2 displaced by one with another power of 2.

Patch by @pacxx (Michael Haidl)

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

llvm-svn: 314504

6 years ago[mips] Add test cases for dext/dins family of instructions
Aleksandar Beserminji [Fri, 29 Sep 2017 09:53:24 +0000 (09:53 +0000)]
[mips] Add test cases for dext/dins family of instructions

Add missing test cases for dext, dextm, dextu, dins, dinsm and
dinsu instructions.

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

llvm-svn: 314503

6 years ago[AMDGPU] calling conventions for AMDPAL OS type
Tim Renouf [Fri, 29 Sep 2017 09:51:22 +0000 (09:51 +0000)]
[AMDGPU] calling conventions for AMDPAL OS type

Summary:
This commit adds comments on how the AMDPAL OS type overloads the
existing AMDGPU_ calling conventions used by Mesa, and adds a couple of
new ones.

Reviewers: arsenm, nhaehnle, dstuttard

Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, t-tye, llvm-commits

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

llvm-svn: 314502

6 years ago[AMDGPU] AMDPAL scratch buffer support
Tim Renouf [Fri, 29 Sep 2017 09:49:35 +0000 (09:49 +0000)]
[AMDGPU] AMDPAL scratch buffer support

Summary:
Added support for scratch (including spilling) for OS type amdpal:
generates code to set up the scratch descriptor if it is needed.

With amdpal, the scratch resource descriptor is loaded from offset 0 of
the global information table. The low 32 bits of the address of the
global information table is passed in s0.

Added amdgpu-git-ptr-high function attribute to hard-wire the high 32
bits of the address of the global information table. If the function
attribute is not specified, or is 0xffffffff, then the backend generates
code to use the high 32 bits of pc.

The documentation for the AMDPAL ABI will be added in a later commit.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye

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

llvm-svn: 314501

6 years ago[Triple] Add AMDPAL operating system type
Tim Renouf [Fri, 29 Sep 2017 09:48:12 +0000 (09:48 +0000)]
[Triple] Add AMDPAL operating system type

Summary:
This operating system type represents the AMDGPU PAL runtime, and will
be required by the AMDGPU backend in order to generate correct code for
this runtime.

Currently it generates the same code as not specifying an OS at all.
That will change in future commits.

Patch from Tim Corringham.

Subscribers: arsenm, nhaehnle

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

llvm-svn: 314500

6 years ago[Sema] Suppress warnings for C's zero initializer
Daniel Marjamaki [Fri, 29 Sep 2017 09:44:41 +0000 (09:44 +0000)]
[Sema] Suppress warnings for C's zero initializer

Patch by S. Gilles!

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

llvm-svn: 314499

6 years ago[dwarfdump][NFC] Consistent errors and warnings with --verify
Jonas Devlieghere [Fri, 29 Sep 2017 09:33:31 +0000 (09:33 +0000)]
[dwarfdump][NFC] Consistent errors and warnings with --verify

This patch introduces 3 helper functions: error(), warn() and note() to
make printing  during verification more consistent. When supported, the
respective prefixes are printed in color using the same color scheme as
clang.

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

llvm-svn: 314498

6 years ago[mips] Reordering callseq* nodes to be linear
Aleksandar Beserminji [Fri, 29 Sep 2017 09:32:14 +0000 (09:32 +0000)]
[mips] Reordering callseq* nodes to be linear

Fix nested callseq* nodes by moving callseq_start after the
arguments calculation to temporary registers, so that callseq* nodes
in resulting DAG are linear.

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

llvm-svn: 314497

6 years ago[NFC] Removed accidenatally added file
Ben Dunbobbin [Fri, 29 Sep 2017 09:15:55 +0000 (09:15 +0000)]
[NFC] Removed accidenatally added file

llvm-svn: 314496

6 years ago[ELF] Simpler scheme for handling common symbols
Ben Dunbobbin [Fri, 29 Sep 2017 09:08:26 +0000 (09:08 +0000)]
[ELF] Simpler scheme for handling common symbols

Convert all common symbols to regular symbols after scan.
This means that the downstream code does not to handle common symbols as a special case.

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

llvm-svn: 314495

6 years ago[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediat...
Coby Tayree [Fri, 29 Sep 2017 07:02:49 +0000 (07:02 +0000)]
[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions

Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized.
supersedes D33278, D35774

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

llvm-svn: 314494

6 years ago[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediat...
Coby Tayree [Fri, 29 Sep 2017 07:02:46 +0000 (07:02 +0000)]
[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions

Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized.
supersedes D33278, D35774

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

llvm-svn: 314493

6 years agoSkip building x86 parts of UnwindRegisters*.S when targeting SjLj
Martin Storsjo [Fri, 29 Sep 2017 06:09:09 +0000 (06:09 +0000)]
Skip building x86 parts of UnwindRegisters*.S when targeting SjLj

This extends SVN r314197 from the arm parts to the whole file.

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

llvm-svn: 314492

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