platform/upstream/llvm.git
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

6 years agoFix a UBsan bot.
Rui Ueyama [Thu, 28 Sep 2017 00:27:39 +0000 (00:27 +0000)]
Fix a UBsan bot.

If we do not initialize Prefix here, Prefix.data() returns a nullptr.
Later, it is passed to memcpy. memcpy's behavior is undefined if src (or
dst) is a nullptr even if a given size is 0. That's why this code
triggered UBsan.

llvm-svn: 314368

6 years ago[Targets/X86] Remove unneded `return` in setMaxAtomicWidth(). NFCI.
Davide Italiano [Thu, 28 Sep 2017 00:24:20 +0000 (00:24 +0000)]
[Targets/X86] Remove unneded `return` in setMaxAtomicWidth(). NFCI.

llvm-svn: 314367

6 years agoChange build-llvm.py and build-lldb-llvm-clang's patching mechanisms to
Jason Molenda [Wed, 27 Sep 2017 23:44:54 +0000 (23:44 +0000)]
Change build-llvm.py and build-lldb-llvm-clang's patching mechanisms to
assume git-style diffs.  Committing for Francis Ricci.

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

llvm-svn: 314366

6 years agoASan allocates a global data initialization array at the tail end of each
Dmitry Mikulin [Wed, 27 Sep 2017 23:32:01 +0000 (23:32 +0000)]
ASan allocates a global data initialization array at the tail end of each
compunit's .data section. This vector is not poisoned. Because of this the
first symbol of the following section has no left red zone. As a result, ASan
cannot detect underflow for such symbols.

Poison ASan allocated metadata, it should not be accessible to user code.

This fix does not eliminate the problem with missing left red zones but it
reduces the set of vulnerable symbols from first symbols in each input data
section to first symbols in the output section of the binary.

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

llvm-svn: 314365

6 years ago[Preprocessor] Preserve #pragma clang assume_nonnull in preprocessed output
Eli Friedman [Wed, 27 Sep 2017 23:29:37 +0000 (23:29 +0000)]
[Preprocessor] Preserve #pragma clang assume_nonnull in preprocessed output

Patch by Zbigniew Sarbinowski!

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

llvm-svn: 314364

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What...
Eugene Zelenko [Wed, 27 Sep 2017 23:26:01 +0000 (23:26 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 314363

6 years agoCheck for overflows when calculating the offset in GetGEPCost.
Justin Lebar [Wed, 27 Sep 2017 23:16:56 +0000 (23:16 +0000)]
Check for overflows when calculating the offset in GetGEPCost.

Summary:
This avoids C++ UB if the GEP is weird and the calculation overflows
int64_t, and it's also observable in the cost model's results.

Such GEPs are almost surely not valid pointers, but LLVM nonetheless
generates them sometimes.

Reviewers: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 314362

6 years agoReverted r313993.
Galina Kistanova [Wed, 27 Sep 2017 23:09:14 +0000 (23:09 +0000)]
Reverted r313993.

This patch produces a crash and hexagon_vector_loop_carried_reuse_constant.ll test fails on Windows (llvm-clang-x86_64-expensive-checks-win build bot).

llvm-svn: 314361

6 years agoRevert r314017 '[InstCombine] Simplify check for RHS being a splat constant in foldIC...
Craig Topper [Wed, 27 Sep 2017 22:57:18 +0000 (22:57 +0000)]
Revert r314017 '[InstCombine] Simplify check for RHS being a splat constant in foldICmpUsingKnownBits by just checking Op1Min==Op1Max rather than going through m_APInt.'

This reverts r314017 and similar code added in later commits. It seems to not work for pointer compares and is causing a bot failure for the last several days.

llvm-svn: 314360

6 years agoUpdate the description of AVR32 for the ELFDumper
Dylan McKay [Wed, 27 Sep 2017 22:39:37 +0000 (22:39 +0000)]
Update the description of AVR32 for the ELFDumper

AVR32 is an unrelated architecture with 32-bit addressing.

llvm-svn: 314359

6 years agoAdd support for running the lldb testsuite against an apple watch
Jason Molenda [Wed, 27 Sep 2017 22:12:54 +0000 (22:12 +0000)]
Add support for running the lldb testsuite against an apple watch
running watchos.  These tests cannot run on normal customer devices,
but I hope to some day have a public facing bot running against a
device.

llvm-svn: 314355

6 years ago[AVR] Update data layout to match current LLVM trunk
Dylan McKay [Wed, 27 Sep 2017 22:09:01 +0000 (22:09 +0000)]
[AVR] Update data layout to match current LLVM trunk

The data layout was changed in r314179 to fix atomic loads and stores.

llvm-svn: 314354

6 years agoFix -Wunused-variable for Release build.
Rui Ueyama [Wed, 27 Sep 2017 22:03:15 +0000 (22:03 +0000)]
Fix -Wunused-variable for Release build.

llvm-svn: 314353

6 years agoReturn the LoopUnrollResult from tryToUnrollLoop; NFC
Sanjoy Das [Wed, 27 Sep 2017 21:45:22 +0000 (21:45 +0000)]
Return the LoopUnrollResult from tryToUnrollLoop; NFC

I will use this in a later change.

llvm-svn: 314352

6 years agoLoopDeletion: use return value instead of passing in LPMUpdater; NFC
Sanjoy Das [Wed, 27 Sep 2017 21:45:21 +0000 (21:45 +0000)]
LoopDeletion: use return value instead of passing in LPMUpdater; NFC

I will use this refactoring in a later patch.

llvm-svn: 314351

6 years agoRename LoopUnrollStatus to LoopUnrollResult; NFC
Sanjoy Das [Wed, 27 Sep 2017 21:45:19 +0000 (21:45 +0000)]
Rename LoopUnrollStatus to LoopUnrollResult; NFC

A "Result" suffix is more appropriate here

llvm-svn: 314350

6 years agoFix off-by-one error in TarWriter.
Rui Ueyama [Wed, 27 Sep 2017 21:38:02 +0000 (21:38 +0000)]
Fix off-by-one error in TarWriter.

The tar format originally supported up to 99 byte filename. The two
extensions are proposed later: Ustar or PAX.

In the UStar extension, a pathanme is split at a '/' and its "prefix"
and "suffix" are stored in different locations in the tar header. Since
"prefix" can be up to 155 byte, it can represent up to 254 byte
filename (but exact limit depends on the location of '/' character in
a pathname.)

Our TarWriter first attempt to use UStar extension and then fallback to
PAX extension.

But there's a bug in UStar header creation. "Suffix" part must be a NUL-
terminated string, but we didn't handle it correctly. As a result, if
your filename just 100 characters long, the last character was droppped.

This patch fixes the issue.

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

llvm-svn: 314349

6 years ago[CMake] Fix typo: "in-tree" -> "in-source" (NFC)
Brian Gesiak [Wed, 27 Sep 2017 21:37:33 +0000 (21:37 +0000)]
[CMake] Fix typo: "in-tree" -> "in-source" (NFC)

Summary:
*In-source builds* of LLVM, in which a user invokes `cmake` from within the
LLVM source directory, or invokes `cmake -B/path/to/source/dir/of/llvm`,
are explicitly checked for and disallowed by LLVM's `CMakeLists.txt`.

*In-tree builds*, on the other hand, refer to when the source directories
of projects such as Clang are nested within the `llvm/tools` source
directory. These are not disallowed, and are in fact a common way of
building LLVM and Clang.

Revise the comment to match the logic underneath it: it checks for an
"in-source build", not an "in-tree build".

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny

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

llvm-svn: 314348

6 years agoRevert "Add support for custom loaders to symbolizer"
Francis Ricci [Wed, 27 Sep 2017 21:35:33 +0000 (21:35 +0000)]
Revert "Add support for custom loaders to symbolizer"

This broke the windows buildbots, revert for now.

This reverts commit 24050b5ddef42f6f3306aa94d4a1f42a7893a9a7.

llvm-svn: 314347

6 years agoCleanup some problems with LLVM_ENABLE_DUMP in release builds, and
Don Hinton [Wed, 27 Sep 2017 21:19:56 +0000 (21:19 +0000)]
Cleanup some problems with LLVM_ENABLE_DUMP in release builds, and
always set LLVM_ENABLE_DUMP=ON for +Asserts builds.

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

llvm-svn: 314346

6 years agoDo not remove a target file in FileOutputBuffer::create().
Rui Ueyama [Wed, 27 Sep 2017 21:19:24 +0000 (21:19 +0000)]
Do not remove a target file in FileOutputBuffer::create().

FileOutputBuffer::create() attempts to remove a target file if the file
is a regular one, which results in an unexpected result in a failure
scenario.

If something goes wrong and the user of FileOutputBuffer decides to not
call commit(), it leaves nothing. An existing file is removed, and no
new file is created.

What we should do is to atomically replace an existing file with a new
file using rename(), so that it wouldn't remove an existing file without
creating a new one.

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

llvm-svn: 314345

6 years ago[scudo] Temporary disabling the valloc test on armhf
Kostya Kortchinsky [Wed, 27 Sep 2017 21:10:25 +0000 (21:10 +0000)]
[scudo] Temporary disabling the valloc test on armhf

Summary:
Weird failure where `errno != ENOMEM` on valloc failure. The returned pointer
is null since it passes the previous assert, so this shouldn't happen.

http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/10931
http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/2469

Disabling until we figure out what's going on.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: aemerson, srhines, llvm-commits, kristof.beyls

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

llvm-svn: 314344

6 years agoUpdate the Objective-C runtime interface code to handle objc objects
Jason Molenda [Wed, 27 Sep 2017 20:56:32 +0000 (20:56 +0000)]
Update the Objective-C runtime interface code to handle objc objects
whose isa is an index instead of a pointer.  Currently, this type
of isa encoding is only used on watchos.
<rdar://problem/34675497>

llvm-svn: 314343

6 years agoAdd support for custom loaders to symbolizer
Francis Ricci [Wed, 27 Sep 2017 20:56:04 +0000 (20:56 +0000)]
Add support for custom loaders to symbolizer

Change-Id: I5594bd6b216deca2c73cf0a7001f9aec1e803c60
llvm-svn: 314342

6 years ago[MachineOutliner] AArch64: Avoid saving + restoring LR if possible
Jessica Paquette [Wed, 27 Sep 2017 20:47:39 +0000 (20:47 +0000)]
[MachineOutliner] AArch64: Avoid saving + restoring LR if possible

This commit allows the outliner to avoid saving and restoring the link register
on AArch64 when it is dead within an entire class of candidates.

This introduces changes to the way the outliner interfaces with the target.
For example, the target now interfaces with the outliner using a
MachineOutlinerInfo struct rather than by using getOutliningCallOverhead and
getOutliningFrameOverhead.

This also improves several comments on the outliner's cost model.

https://reviews.llvm.org/D36721

llvm-svn: 314341

6 years agoRemove unnecessary semicolons
Jonathan Peyton [Wed, 27 Sep 2017 20:36:27 +0000 (20:36 +0000)]
Remove unnecessary semicolons

Removes semicolons after if {} blocks, function definitions, etc.
I was able to apply the large OMPT patch cleanly on top of this one
with no conflicts.

llvm-svn: 314340

6 years agoRevert r314249 "Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions...
Craig Topper [Wed, 27 Sep 2017 20:34:17 +0000 (20:34 +0000)]
Revert r314249 "Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST."""

This caused PR34751

llvm-svn: 314339

6 years agoRevert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg."
Craig Topper [Wed, 27 Sep 2017 20:34:13 +0000 (20:34 +0000)]
Revert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg."

This contributed to PR34751

llvm-svn: 314338

6 years ago[X86][SSE] Pull out variable shuffle mask combine logic. NFCI.
Simon Pilgrim [Wed, 27 Sep 2017 20:19:53 +0000 (20:19 +0000)]
[X86][SSE] Pull out variable shuffle mask combine logic. NFCI.

Hopefully this will make it easier to vary the combine depth threshold per-target.

llvm-svn: 314337

6 years agoAdd support for remembering origins to ExternalASTMerger
Sean Callanan [Wed, 27 Sep 2017 19:57:58 +0000 (19:57 +0000)]
Add support for remembering origins to ExternalASTMerger

ExternalASTMerger has hitherto relied on being able to look up
any Decl through its named DeclContext chain. This works for
many cases, but causes problems for function-local structs,
which cannot be looked up in their containing FunctionDecl. An
example case is

void f() {
  { struct S { int a; }; }
  { struct S { bool b; }; }
}

It is not possible to lookup either of the two Ses individually
(or even to provide enough information to disambiguate) after
parsing is over; and there is typically no need to, since they
are invisible to the outside world.

However, ExternalASTMerger needs to be able to complete either
S on demand. This led to an XFAIL on test/Import/local-struct,
which this patch removes. The way the patch works is:

It defines a new data structure, ExternalASTMerger::OriginMap,
which clients are expected to maintain (default-constructing
if the origin does not have an ExternalASTMerger servicing it)
As DeclContexts are imported, if they cannot be looked up by
name they are placed in the OriginMap. This allows
ExternalASTMerger to complete them later if necessary.
As DeclContexts are imported from an origin that already has
its own OriginMap, the origins are forwarded – but only for
those DeclContexts that are actually used. This keeps the
amount of stored data minimal.

The patch also applies several improvements from review:

- Thoroughly documents the interface to ExternalASTMerger;
- Adds optional logging to help track what's going on; and
- Cleans up a bunch of braces and dangling elses.

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

llvm-svn: 314336

6 years ago[CodeGen] Emit necessary .note sections for -fsplit-stack
Than McIntosh [Wed, 27 Sep 2017 19:34:00 +0000 (19:34 +0000)]
[CodeGen] Emit necessary .note sections for -fsplit-stack

Summary:
According to https://gcc.gnu.org/wiki/SplitStacks, the linker expects a zero-sized .note.GNU-split-stack section if split-stack is used (and also .note.GNU-no-split-stack section if it also contains non-split-stack functions), so it can handle the cases where a split-stack function calls non-split-stack function.

This change adds the sections if needed.

Fixes PR #34670.

Reviewers: thanm, rnk, luqmana

Reviewed By: rnk

Subscribers: llvm-commits

Patch by Cherry Zhang <cherryyz@google.com>

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

llvm-svn: 314335

6 years ago[CUDA] Work around conflicting function definitions in CUDA-9 headers.
Artem Belevich [Wed, 27 Sep 2017 19:07:15 +0000 (19:07 +0000)]
[CUDA] Work around conflicting function definitions in CUDA-9 headers.

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

llvm-svn: 314334

6 years ago[builtins] ARM: Revert r314284, r314285 and r314289
Manoj Gupta [Wed, 27 Sep 2017 19:06:47 +0000 (19:06 +0000)]
[builtins] ARM: Revert r314284, r314285 and r314289

Revert r314284, r314285 and r314289 because of a reported
breakage in armv7k watchos builder.

llvm-svn: 314333