platform/upstream/llvm.git
4 years agoRevert r367389 (and follow-up r368404); it caused PR43073.
Nico Weber [Wed, 21 Aug 2019 19:53:42 +0000 (19:53 +0000)]
Revert r367389 (and follow-up r368404); it caused PR43073.

llvm-svn: 369567

4 years ago[WebAssembly] Handle aliases in WebAssemblyFixFunctionBitcasts
Sam Clegg [Wed, 21 Aug 2019 19:52:33 +0000 (19:52 +0000)]
[WebAssembly] Handle aliases in WebAssemblyFixFunctionBitcasts

Fixes: https://github.com/emscripten-core/emscripten/issues/8770

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

llvm-svn: 369566

4 years ago[MVT] Add v16f16 and v32f16 vectors.
Craig Topper [Wed, 21 Aug 2019 19:14:48 +0000 (19:14 +0000)]
[MVT] Add v16f16 and v32f16 vectors.

I might look at improving PR43065 which will require being
able to mark a 256 and 512 bit vector of f16 as Legal.

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

llvm-svn: 369565

4 years ago[TableGen] Include ValueTypes.td directly into the intrinsic-varargs.td test.
Craig Topper [Wed, 21 Aug 2019 19:14:38 +0000 (19:14 +0000)]
[TableGen] Include ValueTypes.td directly into the intrinsic-varargs.td test.

This prevents needing to keep the test in sync with ValueTypes.td

This is not the only test that includes ValueTypes.td.

llvm-svn: 369564

4 years ago[mips] Replace call `expandLoadAddress` by `loadAndAddSymbolAddress`. NFC
Simon Atanasyan [Wed, 21 Aug 2019 18:54:51 +0000 (18:54 +0000)]
[mips] Replace call `expandLoadAddress` by `loadAndAddSymbolAddress`. NFC

In case of expanding `lw/sw $reg, symbol($reg)` instruction for PIC it's
enough to call the `loadAndAddSymbolAddress` method. Additional work
performed by the `expandLoadAddress` is not required here.

llvm-svn: 369563

4 years ago[mips] Remove duplicated case from the `StringSwitch`. NFC
Simon Atanasyan [Wed, 21 Aug 2019 18:54:41 +0000 (18:54 +0000)]
[mips] Remove duplicated case from the `StringSwitch`. NFC

llvm-svn: 369562

4 years ago[DAGCombiner] Remove mostly redundant calls to AddToWorklist
Amaury Sechet [Wed, 21 Aug 2019 18:51:08 +0000 (18:51 +0000)]
[DAGCombiner] Remove mostly redundant calls to AddToWorklist

Summary:
These calls change the order in which some nodes are processed and so have an effect on codegen.

The change in fixup-bw-copy.ll is due to (and (load anyext)) gets transformed into (load zext) while previously the and was removed by SimplifyDemandedBits, so the (load anyext) remained.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 369561

4 years ago[docs] Add GwpAsan to toctree.
Mitch Phillips [Wed, 21 Aug 2019 18:31:03 +0000 (18:31 +0000)]
[docs] Add GwpAsan to toctree.

Reverts rL369556 in the process, as it's no longer needed.

llvm-svn: 369560

4 years ago[lld-link] implement -lto-obj-path
Bob Haarman [Wed, 21 Aug 2019 18:24:59 +0000 (18:24 +0000)]
[lld-link] implement -lto-obj-path

Summary:
This adds the -lto-obj-path option to lld-link. This can be
used to specify a path at which to write a native object file for
the full LTO part when using LTO unit splitting.

Reviewers: ruiu, tejohnson, pcc, rnk

Reviewed By: ruiu, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 369559

4 years ago[BitcodeReader] Check if we can create a null constant for type.
Florian Hahn [Wed, 21 Aug 2019 18:20:11 +0000 (18:20 +0000)]
[BitcodeReader] Check if we can create a null constant for type.

We cannot create null constants for certain types, e.g. VoidTy,
FunctionTy or LabelTy. getNullValue asserts if we pass in an
unsupported type. We should also check for opaque types, but I'm not
sure how.

This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14795.

Reviewers: t.p.northover, jfb, vsk

Reviewed By: vsk

Tags: #llvm

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

llvm-svn: 369557

4 years ago[docs] Fix GwpAsan.rst
Jordan Rupprecht [Wed, 21 Aug 2019 18:09:31 +0000 (18:09 +0000)]
[docs] Fix GwpAsan.rst

llvm-svn: 369556

4 years agoGeneralize FindTypes with CompilerContext to support fuzzy lookup
Adrian Prantl [Wed, 21 Aug 2019 18:06:56 +0000 (18:06 +0000)]
Generalize FindTypes with CompilerContext to support fuzzy lookup

This patch generalizes the FindTypes with CompilerContext interface to
support looking up a type of unknown kind by name, as well as looking
up a type inside an unspecified submodule. These features are
motivated by the Swift branch, but are fully tested via unit tests and
lldb-test on llvm.org.  Specifically, this patch adds an AnyModule and
an AnyType CompilerContext kind.

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

rdar://problem/54471165

llvm-svn: 369555

4 years agoAdd newline to GWP-ASan sphinx document.
Mitch Phillips [Wed, 21 Aug 2019 18:03:11 +0000 (18:03 +0000)]
Add newline to GWP-ASan sphinx document.
Should fix the document builder.

llvm-svn: 369554

4 years ago[docs] Convert remaining command guide entries from md to rst.
Jordan Rupprecht [Wed, 21 Aug 2019 18:00:17 +0000 (18:00 +0000)]
[docs] Convert remaining command guide entries from md to rst.

Summary:
Linking between markdown and rst files is currently not supported very well, e.g. the current llvm-addr2line docs [1] link to "llvm-symbolizer" instead of "llvm-symbolizer.html". This is weirdly broken in different ways depending on which versions of sphinx and recommonmark are being used, so workaround the bug by using rst everywhere.

[1] http://llvm.org/docs/CommandGuide/llvm-addr2line.html

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 369553

4 years ago[GWP-ASan] Add public-facing documentation [6].
Mitch Phillips [Wed, 21 Aug 2019 17:53:51 +0000 (17:53 +0000)]
[GWP-ASan] Add public-facing documentation [6].

Summary:
Note: Do not submit this documentation until Scudo support is reviewed and submitted (should be #[5]).

See D60593 for further information.

This patch introduces the public-facing documentation for GWP-ASan, as well as updating the definition of one of the options, which wasn't properly merged. The document describes the design and features of GWP-ASan, as well as how to use GWP-ASan from both a user's standpoint, and development documentation for supporting allocators.

Reviewers: jfb, morehouse, vlad.tsyrklevich

Reviewed By: morehouse, vlad.tsyrklevich

Subscribers: kcc, dexonsmith, kubamracek, cryptoad, jfb, #sanitizers, llvm-commits, vlad.tsyrklevich, morehouse

Tags: #sanitizers, #llvm

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

llvm-svn: 369552

4 years ago[GWP-ASan] Build stack_trace_compressor_fuzzer.
Mitch Phillips [Wed, 21 Aug 2019 17:52:51 +0000 (17:52 +0000)]
[GWP-ASan] Build stack_trace_compressor_fuzzer.

Summary:
Flips the switch to build stack_trace_compressor_fuzzer. This was recently
temporarily disabled in rL369079 as it was breaking the sanitizer buildbots.

My diagnosis of the problem is that on clang-only bootstrap builds, we build
gwp_asan before libfuzzer. This causes a discrepancy when the clang driver
attempts to link libclang_rt.fuzzer* as CMake doesn't see a dependency there.

I've (hopefully) fixed the issue by adding a direct dependency for the fuzz
target so CMake can resolve the build order properly. As part of this, the
libFuzzer 'fuzzer' target has to be discovered before the declaration of the
fuzz target.

pcc@ for mild review + notification as buildcop.

Reviewers: pcc

Reviewed By: pcc

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 369551

4 years ago[LTO] Always mark regular LTO units with EnableSplitLTOUnit=1 under the new pass...
Leonard Chan [Wed, 21 Aug 2019 17:24:14 +0000 (17:24 +0000)]
[LTO] Always mark regular LTO units with EnableSplitLTOUnit=1 under the new pass manager

Match the behavior of D65009 under the new pass manager. This addresses
the test clang/test/CodeGen/split-lto-unit.c when running under the new
PM.

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

llvm-svn: 369550

4 years agoFix -Wimplicit-fallthrough warnings in regcomp.c
Nathan Huckleberry [Wed, 21 Aug 2019 17:07:43 +0000 (17:07 +0000)]
Fix -Wimplicit-fallthrough warnings in regcomp.c

Summary:
Since clang does not support comment style fallthrough annotations
these should be switched.

Reviewers: aaron.ballman, nickdesaulniers, xbolva00

Reviewed By: aaron.ballman, nickdesaulniers, xbolva00

Subscribers: xbolva00, nickdesaulniers, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 369549

4 years ago[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.
Alina Sbirlea [Wed, 21 Aug 2019 17:00:57 +0000 (17:00 +0000)]
[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.

Summary:
Add a flag to the FunctionToLoopAdaptor that allows enabling MemorySSA only for the loop pass managers that are known to preserve it.

If an LPM is known to have only loop transforms that *all* preserve MemorySSA, then use MemorySSA if `EnableMSSALoopDependency` is set.
If an LPM has loop passes that do not preserve MemorySSA, then the flag passed is `false`, regardless of the value of `EnableMSSALoopDependency`.

When using a custom loop pass pipeline via `passes=...`, use keyword `loop` vs `loop-mssa` to use MemorySSA in that LPM. If a loop that does not preserve MemorySSA is added while using the `loop-mssa` keyword, that's an error.

Add the new `loop-mssa` keyword to a few tests where a difference occurs when enabling MemorySSA.

Reviewers: chandlerc

Subscribers: mehdi_amini, Prazek, george.burgess.iv, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 369548

4 years agoGlobalISel: Implement moreElementsVector for G_UNMERGE_VALUES sources
Matt Arsenault [Wed, 21 Aug 2019 16:59:10 +0000 (16:59 +0000)]
GlobalISel: Implement moreElementsVector for G_UNMERGE_VALUES sources

This is necessary for handling <3 x s16> on AMDGPU, assuming this
should be handled as 2 separate legalization actions. The alternative
would be for fewerElementsVector to handle 3->2.

llvm-svn: 369547

4 years agoAdd a couple of extra test noticed in post-commit discussion of rL369541
Philip Reames [Wed, 21 Aug 2019 16:57:53 +0000 (16:57 +0000)]
Add a couple of extra test noticed in post-commit discussion of rL369541

llvm-svn: 369546

4 years ago[ARM] Formatting for ARMInstrMVE.td. NFC
David Green [Wed, 21 Aug 2019 16:20:35 +0000 (16:20 +0000)]
[ARM] Formatting for ARMInstrMVE.td. NFC

This is just some formatting cleanup, prior to the masked load and store patch
in D66534.

llvm-svn: 369545

4 years agogit-llvm: Make push --force suppress error on nothing to commit as well
Nico Weber [Wed, 21 Aug 2019 16:03:34 +0000 (16:03 +0000)]
git-llvm: Make push --force suppress error on nothing to commit as well

llvm-svn: 369544

4 years ago[Sanitizer] Disable -Wframe-larger-than on SystemZ
Ulrich Weigand [Wed, 21 Aug 2019 15:53:08 +0000 (15:53 +0000)]
[Sanitizer] Disable -Wframe-larger-than on SystemZ

SystemZ builds show -Wframe-larger-than warnings in two functions:
 'sanitizer::SuspendedThreadsListLinux::GetRegistersAndSP'
 'sanitizer::SizeClassAllocator32<__sanitizer::AP32>::PopulateFreeList'

In both cases, the frame size looks correct; each of the functions has
a large local variable that brings the frame size close to the limit
even on x86, and the extra 160 bytes of the default register save areas
on SystemZ pushes it over the limit.

PowerPC and MIPS already disable this warning; do the same on SystemZ.

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

llvm-svn: 369543

4 years agoclang: Fix typo in comment
Nico Weber [Wed, 21 Aug 2019 15:52:44 +0000 (15:52 +0000)]
clang: Fix typo in comment

llvm-svn: 369542

4 years ago[instcombine] icmp eq/ne (sub C, Y), C -> icmp eq/ne Y, 0
Philip Reames [Wed, 21 Aug 2019 15:51:57 +0000 (15:51 +0000)]
[instcombine] icmp eq/ne (sub C, Y), C -> icmp eq/ne Y, 0

Noticed while looking at pr43028.

llvm-svn: 369541

4 years agoclang: Fix typo in comment
Nico Weber [Wed, 21 Aug 2019 15:49:21 +0000 (15:49 +0000)]
clang: Fix typo in comment

(Sorry for all these commits; trying to sort out why svn doesn't want to store
my password.)

llvm-svn: 369540

4 years agoclang: Fix typo in comment
Nico Weber [Wed, 21 Aug 2019 15:41:29 +0000 (15:41 +0000)]
clang: Fix typo in comment

llvm-svn: 369539

4 years agogit-llvm: Give "push" a --force flag to disable confirm prompt on multiple commits
Nico Weber [Wed, 21 Aug 2019 15:41:20 +0000 (15:41 +0000)]
git-llvm: Give "push" a --force flag to disable confirm prompt on multiple commits

llvm-svn: 369538

4 years ago[libcxx] Only declare contents of threading API when
David Spickett [Wed, 21 Aug 2019 15:38:24 +0000 (15:38 +0000)]
[libcxx] Only declare contents of threading API when
_LIBCPP_HAS_THREAD_API_EXTERNAL is not defined.

When it is defined they will be declared by the
__external_threading header instead.

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

llvm-svn: 369537

4 years agoclang: Fix typo in comment
Nico Weber [Wed, 21 Aug 2019 15:37:27 +0000 (15:37 +0000)]
clang: Fix typo in comment

llvm-svn: 369536

4 years ago[ELF][ARM] Simplify some llvm-objdump tests with both ARM/Thumb states
Fangrui Song [Wed, 21 Aug 2019 15:30:55 +0000 (15:30 +0000)]
[ELF][ARM] Simplify some llvm-objdump tests with both ARM/Thumb states

llvm-objdump can switch between ARM/Thumb states after D60927.

In a few lld tests, we run both

* llvm-objdump -d -triple=thumbv7a-none-linux-gnueabi %t
* llvm-objdump -d -triple=armv7a-none-linux-gnueabi %t

to test ARM/Thumb parts of the same file. In many cases we can just
run one command. There is a problem that prevents us from cleaning
more tests (e.g. test/ELF/arm-thumb-interwork-thunk.s):

In llvm-objdump, while we have ARM/Thumb (primary and secondary)
MCDisassembler and MCSubtargetInfo, we have just one MCInstrAnalysis
which is used to resolve the targets of calls in both ARM/Thumb parts.

    // ThumbMCInstrAnalysis evaluating ARM parts or ARMMCInstrAnalysis evaluating Thumb parts
    // will have incorrect offsets.
    // An example of llvm-objdump -d -triple=thumbv7a on ARM part:
    1304: 3d ff ff fa  blx     #-780                 # no <...>
    1308: 06 00 00 ea  b       #24 <arm_caller+0x24> # wrong target due to wrong offset

Reviewed By: peter.smith

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

llvm-svn: 369535

4 years agocompiler-rt: Fix warning if COMPILER_RT_HAS_FCNTL_LCK is 0
Nico Weber [Wed, 21 Aug 2019 15:24:25 +0000 (15:24 +0000)]
compiler-rt: Fix warning if COMPILER_RT_HAS_FCNTL_LCK is 0

Fixes "warning: implicit declaration of function 'flock' is invalid in C99"
for flock().

llvm-svn: 369534

4 years agoImproving CodeView debug info type record's inline comments
Nilanjana Basu [Wed, 21 Aug 2019 15:19:58 +0000 (15:19 +0000)]
Improving CodeView debug info type record's inline comments

llvm-svn: 369533

4 years ago[AMDGPU] Prevent VGPR copies from moving across the EXEC mask definitions
Alexander Timofeev [Wed, 21 Aug 2019 15:15:04 +0000 (15:15 +0000)]
[AMDGPU] Prevent VGPR copies from moving across the EXEC mask definitions
Differential Revision: https://reviews.llvm.org/D63731
Reviewers: qcolombet, rampitec

llvm-svn: 369532

4 years ago[LLVM][Alignment] Introduce Alignment In MachineFrameInfo
Guillaume Chatelet [Wed, 21 Aug 2019 14:29:30 +0000 (14:29 +0000)]
[LLVM][Alignment] Introduce Alignment In MachineFrameInfo

Summary:
This is patch is part of a serie to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: jfb

Subscribers: hiraditya, dexonsmith, llvm-commits, courbet

Tags: #llvm

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

llvm-svn: 369531

4 years ago[lldb][NFC] Merge multiple TestApropos.py
Raphael Isemann [Wed, 21 Aug 2019 14:22:59 +0000 (14:22 +0000)]
[lldb][NFC] Merge multiple TestApropos.py

That's cleaner and makes lldb-dotest no longer fail due to conflicting names.

llvm-svn: 369530

4 years ago[DWARF] Adjust return type of DWARFUnit::getLength().
Igor Kudrin [Wed, 21 Aug 2019 14:10:57 +0000 (14:10 +0000)]
[DWARF] Adjust return type of DWARFUnit::getLength().

DWARFUnitHeader::getLength() returns uint64_t.
DWARFUnit::getLength() should do the same.

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

llvm-svn: 369529

4 years ago[RISCV] Add support for RVC HINT instructions
Luis Marques [Wed, 21 Aug 2019 14:00:58 +0000 (14:00 +0000)]
[RISCV] Add support for RVC HINT instructions

The hint instructions are enabled by default (if the standard C extension is
enabled). To disable them pass -mattr=-rvc-hints.

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

llvm-svn: 369528

4 years agoreland [gtest] Fix printing of StringRef and SmallString in assert messages.
Sam McCall [Wed, 21 Aug 2019 13:56:29 +0000 (13:56 +0000)]
reland [gtest] Fix printing of StringRef and SmallString in assert messages.

Renames GTEST_NO_LLVM_RAW_OSTREAM -> GTEST_NO_LLVM_SUPPORT and guards
the new features behind it.

This reverts commit a063bcf3ef5a879adbe9639a3c187d876eee0e66.

llvm-svn: 369527

4 years agoAdd 9.0 release bug to merge request script
Simon Atanasyan [Wed, 21 Aug 2019 13:42:10 +0000 (13:42 +0000)]
Add 9.0 release bug to merge request script

llvm-svn: 369526

4 years agoRevert "[gtest] Fix printing of StringRef and SmallString in assert messages."
Sam McCall [Wed, 21 Aug 2019 13:31:44 +0000 (13:31 +0000)]
Revert "[gtest] Fix printing of StringRef and SmallString in assert messages."

This reverts commit 4becb2ab4e9f52ce98272d1f5930d6942af5172b.

llvm-svn: 369525

4 years ago[lldb] Add tests for 'settings remove' and fix error message typos
Raphael Isemann [Wed, 21 Aug 2019 13:24:21 +0000 (13:24 +0000)]
[lldb] Add tests for 'settings remove' and fix error message typos

llvm-svn: 369524

4 years agoRecommit "Minidump/Windows: Fix module lookup""
Pavel Labath [Wed, 21 Aug 2019 13:20:25 +0000 (13:20 +0000)]
Recommit "Minidump/Windows: Fix module lookup""

This recommits r368416, which was reverted in r368838 because of test
failures under ASAN. These have been dealt with by llvm r369370.

The original commit message was:
When opening a minidump, we were failing to find an executable because
we were searching for i386-unknown-windows, whereas we recognize the
pe/coff files as i386-pc-windows. This fixes the triple computation code
in the minidump parser to match pe/coff, and adds an appropriate test.

NB: I'm not sure setting the vendor to "pc" is really correct for
arm(64) windows, but right now that seems to match what we do in the
pe/coff case (ArchSpec.cpp:935).

Reviewers: clayborg, amccarth

Subscribers: javed.absar, kristof.beyls, rnk, markmentovai, lldb-commits

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

llvm-svn: 369523

4 years agoFix two compiler warnings
Pavel Labath [Wed, 21 Aug 2019 13:11:30 +0000 (13:11 +0000)]
Fix two compiler warnings

llvm-svn: 369522

4 years ago[lldb] Add tests for setting completions and enable 'settings remove' completion
Raphael Isemann [Wed, 21 Aug 2019 12:57:06 +0000 (12:57 +0000)]
[lldb] Add tests for setting completions and enable 'settings remove' completion

llvm-svn: 369521

4 years ago[DAGCombiner] Various nits. NFC
Amaury Sechet [Wed, 21 Aug 2019 12:01:37 +0000 (12:01 +0000)]
[DAGCombiner] Various nits. NFC

llvm-svn: 369520

4 years ago[InstCombine] narrow icmp with extended operands of different widths
Sanjay Patel [Wed, 21 Aug 2019 11:56:08 +0000 (11:56 +0000)]
[InstCombine] narrow icmp with extended operands of different widths

An intermediate extend is used to widen the narrow operand to the width of
the other (wider) operand. At that point, we have the same logic as the
existing transform that was restricted to folds of equal width zext/sext.

This mostly solves PR42700:
https://bugs.llvm.org/show_bug.cgi?id=42700

llvm-svn: 369519

4 years ago[gtest] Fix printing of StringRef and SmallString in assert messages.
Sam McCall [Wed, 21 Aug 2019 11:37:06 +0000 (11:37 +0000)]
[gtest] Fix printing of StringRef and SmallString in assert messages.

Summary:
These are detected by gtest as containers, and so previously printed as e.g.
  { '.' (46, 0x2E), 's' (115, 0x73), 'e' (101, 0x65), 'c' (99, 0x63), '0' (48, 0x30) },

gtest itself overloads PrintTo for std::string and friends, we use the same mechanism.

Reviewers: labath

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 369518

4 years agoMinidumpYAML: move serialization code to MinidumpEmitter.cpp
Pavel Labath [Wed, 21 Aug 2019 11:30:48 +0000 (11:30 +0000)]
MinidumpYAML: move serialization code to MinidumpEmitter.cpp

Summary:
The code for serializing minidumps was living in MinidumpYAML.cpp
so that it would be accessible from unit tests. While this had its
advantages, it was also unfortunate because it broke symmetry with all
other yaml2obj serializers.

Fortunately, nowadays all of yaml2obj is a library, so we don't need to
do anything special. This patch improves the code consistency by moving
the serialization code to MinidumpEmitter.cpp to match the style used in
other backends. It also removes the writeAsBinary entry point in favor
of the more general convertYAML interface.

This patch is just massaging the code a bit. There shouldn't be any
functional change here.

Reviewers: jhenderson, abrachet

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 369517

4 years ago[LLD][ELF] - Simplify the bad-archive.s test case.
George Rimar [Wed, 21 Aug 2019 11:19:50 +0000 (11:19 +0000)]
[LLD][ELF] - Simplify the bad-archive.s test case.

This removes the precompiled binary and improves the
check of the error reported.

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

llvm-svn: 369516

4 years ago[llvm-objdump] - Cleanup the error reporting.
George Rimar [Wed, 21 Aug 2019 11:07:31 +0000 (11:07 +0000)]
[llvm-objdump] - Cleanup the error reporting.

The error reporting function are not consistent.

Before this change:

* They had inconsistent naming (e.g. 'error' vs 'report_error').
* Some of them reported the object name, others - dont.
* Some of them accepted the case when there was no error. (i.e. error code or Error had a success value).

This patch tries to cleanup it a bit.

It also renames report_error -> reportError, report_warning -> reportWarning
and removes a full stop from messages.

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

llvm-svn: 369515

4 years ago[clangd] Ignore implicit conversion-operator nodes in find refs.
Haojian Wu [Wed, 21 Aug 2019 10:54:19 +0000 (10:54 +0000)]
[clangd] Ignore implicit conversion-operator nodes in find refs.

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 369514

4 years ago[lldb][NFC] Add tests for register command
Raphael Isemann [Wed, 21 Aug 2019 10:40:05 +0000 (10:40 +0000)]
[lldb][NFC] Add tests for register command

llvm-svn: 369513

4 years ago[MIPS GlobalISel] NarrowScalar G_ZEXTLOAD and G_SEXTLOAD
Petar Avramovic [Wed, 21 Aug 2019 09:43:20 +0000 (09:43 +0000)]
[MIPS GlobalISel] NarrowScalar G_ZEXTLOAD and G_SEXTLOAD

NarrowScalar G_ZEXTLOAD and G_SEXTLOAD to s32 for MIPS32.

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

llvm-svn: 369512

4 years ago[MIPS GlobalISel] NarrowScalar G_ZEXT and G_SEXT
Petar Avramovic [Wed, 21 Aug 2019 09:35:02 +0000 (09:35 +0000)]
[MIPS GlobalISel] NarrowScalar G_ZEXT and G_SEXT

NarrowScalar G_ZEXT and G_SEXT to s32 for MIPS32.

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

llvm-svn: 369511

4 years ago[MIPS GlobalISel] Consider type1 when legalizing shifts after r351882
Petar Avramovic [Wed, 21 Aug 2019 09:31:29 +0000 (09:31 +0000)]
[MIPS GlobalISel] Consider type1 when legalizing shifts after r351882

r351882 allows different type for shift amount then result and value
being shifted. Fix MIPS Legalizer rules to take r351882 into account.

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

llvm-svn: 369510

4 years ago[MIPS GlobalISel] NarrowScalar G_TRUNC
Petar Avramovic [Wed, 21 Aug 2019 09:26:39 +0000 (09:26 +0000)]
[MIPS GlobalISel] NarrowScalar G_TRUNC

Add NarrowScalar for G_TRUNC when NarrowTy is half the size of source.
NarrowScalar G_TRUNC to s32 for MIPS32.

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

llvm-svn: 369509

4 years ago[DebugInfo] Avoid dropping location info across block boundaries
Jeremy Morse [Wed, 21 Aug 2019 09:22:31 +0000 (09:22 +0000)]
[DebugInfo] Avoid dropping location info across block boundaries

LiveDebugValues propagates variable locations between blocks by creating
new DBG_VALUE insts in the successors, then interpreting them when it
passes back through the block at a later time. However, this flushes out
any extra information about the location that LiveDebugValues holds: for
example, connections between variable locations such as discussed in
D65368. And as reported in PR42772 this causes us to lose track of the
fact that a spill-location is actually a spill, not a register location.

This patch fixes that by deferring the creation of propagated DBG_VALUEs
until after propagation has completed: instead location propagation occurs
only by sharing location ID numbers between blocks.

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

llvm-svn: 369508

4 years agoReland D65242 "[ELF] More dynamic relocation packing""
Fangrui Song [Wed, 21 Aug 2019 09:21:37 +0000 (09:21 +0000)]
Reland D65242 "[ELF] More dynamic relocation packing""

This fixed a bug in r369488. When config->isRela is false, i->r_addend
is not initialized (see encodeDynamicReloc). So we should check
config->isRela before accessing r_addend:

- if (j - i < 3 || i->r_addend)
+ if (j - i < 3 || (config->isRela && i->r_addend != 0))

Original description:

Currently, with Android dynamic relocation packing, only relative
relocations are grouped together. This patch implements similar
packing for non-relative relocations.

The implementation groups non-relative relocations with the same
r_info and r_addend, if using RELA. By requiring a minimum group
size of 3, this achieves smaller relocation sections. Building Android
for an ARM32 device, I see the total size of /system/lib decrease by
392 KB.

Grouping by r_info also allows the runtime dynamic linker to implement
an 1-entry cache to reduce the number of symbol lookup required. With
such 1-entry cache implemented on Android, I'm seeing 10% to 20%
reduction in total time spent in runtime linker for several executables
that I tested.

As a simple correctness check, I've also built x86_64 Android and booted
successfully.

Differential Revision: https://reviews.llvm.org/D65242
Patch by Vic Yang

llvm-svn: 369507

4 years ago[lldb][NFC] Add tests for invalid command invocations
Raphael Isemann [Wed, 21 Aug 2019 09:15:44 +0000 (09:15 +0000)]
[lldb][NFC] Add tests for invalid command invocations

llvm-svn: 369506

4 years ago[AArch64] Update MTE system register encodings
Luke Cheeseman [Wed, 21 Aug 2019 09:09:56 +0000 (09:09 +0000)]
[AArch64] Update MTE system register encodings

The encodings for the system registers TFSRE0_EL1, TFSR_EL1 TFSR_EL2, TFSR_EL3
and TFSR_EL12 have been changed so that they consistently have CRn=5 and CRm=6
as per https://developer.arm.com/docs/ddi0487/latest.

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

llvm-svn: 369505

4 years agoRemoved some dead code in BugReporter and related files
Dmitri Gribenko [Wed, 21 Aug 2019 08:48:24 +0000 (08:48 +0000)]
Removed some dead code in BugReporter and related files

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 369504

4 years agoFix an unused variable warning in ClangASTContext.cpp
Pavel Labath [Wed, 21 Aug 2019 08:22:19 +0000 (08:22 +0000)]
Fix an unused variable warning in ClangASTContext.cpp

llvm-svn: 369503

4 years agoProperly EXCLUDE_FROM_ALL the testing support library
Pavel Labath [Wed, 21 Aug 2019 08:21:51 +0000 (08:21 +0000)]
Properly EXCLUDE_FROM_ALL the testing support library

The EXCLUDE_FROM_ALL variable is used by add_llvm_library, but lldb does
not use that function (it uses llvm_add_library :P). Instead, set the directory
property with the same name directly.

This should fix standalone builds against an llvm install tree.

llvm-svn: 369502

4 years agoBe explicit about Windows coff name trailing character policy
Serge Guelton [Wed, 21 Aug 2019 07:54:42 +0000 (07:54 +0000)]
Be explicit about Windows coff name trailing character policy

It's okay to *not* copy the trailing zero of a windows section/symbol name.
This is compatible with strncpy behavior but gcc doesn't know that and
throws an invalid warning. Encode this behavior in a proper function.

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

llvm-svn: 369501

4 years ago[NFC] Mark CallTargetComparator() as const to fix libc++ warnings
Raphael Isemann [Wed, 21 Aug 2019 07:39:17 +0000 (07:39 +0000)]
[NFC] Mark CallTargetComparator() as const to fix libc++ warnings

We currently get this warning when compiling with libc++:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:454:26: warning: the specified comparator type does not provide a const call operator [-Wuser-defined-warnings]
    static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
                         ^
llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:193:29: note: in instantiation of template class 'std::__1::set<std::__1::pair<llvm::StringRef, unsigned long long>, llvm::sampleprof::SampleRecord::CallTargetComparator, std::__1::allocator<std::__1::pair<llvm::StringRef, unsigned long long> > >' requested here
  const SortedCallTargetSet getSortedCallTargets() const {
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:967:5: note: from 'diagnose_if' attribute on '__diagnose_non_const_comparator<std::__1::pair<llvm::StringRef, unsigned long long>, llvm::sampleprof::SampleRecord::CallTargetComparator>':
    _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
    ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1320:21: note: expanded from macro '_LIBCPP_DIAGNOSE_WARNING'
     __attribute__((diagnose_if(__VA_ARGS__, "warning")))
                    ^           ~~~~~~~~~~~
1 warning generated.

llvm-svn: 369500

4 years agoRevert D65242 "[ELF] More dynamic relocation packing"
Fangrui Song [Wed, 21 Aug 2019 06:50:08 +0000 (06:50 +0000)]
Revert D65242 "[ELF] More dynamic relocation packing"

This reverts r369488 and r369489. The change broke build bots:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/14511
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/34407

llvm-svn: 369497

4 years ago[PPC Docs] Remove duplicate info about __builtin_setrnd()
David Zarzycki [Wed, 21 Aug 2019 06:48:11 +0000 (06:48 +0000)]
[PPC Docs] Remove duplicate info about __builtin_setrnd()

This looks like a combination of a copy-and-paste (and paste and paste)
error and a commit without reviewing the diff first error.

llvm-svn: 369496

4 years agoRevert r369472 and r369441
Vitaly Buka [Wed, 21 Aug 2019 05:06:21 +0000 (05:06 +0000)]
Revert r369472 and r369441

check-sanitizer does not work on Linux

llvm-svn: 369495

4 years ago[Symbol] Remove unused clang headers from Type
Alex Langford [Wed, 21 Aug 2019 04:56:23 +0000 (04:56 +0000)]
[Symbol] Remove unused clang headers from Type

llvm-svn: 369494

4 years ago[NFC] Return llvm::StringRef from StringExtractor::GetStringRef.
Jonas Devlieghere [Wed, 21 Aug 2019 04:55:56 +0000 (04:55 +0000)]
[NFC] Return llvm::StringRef from StringExtractor::GetStringRef.

This patch removes the two variant of StringExtractor::GetStringRef that
return (non-)const references to std::string. The non-const one was
being abused to reinitialize the StringExtractor and its uses are
replaced by calls to the copy asignment operator. The const variant was
refactored to return an actual llvm::StringRef.

llvm-svn: 369493

4 years ago[NFC] Remove unused function GetHexWithFixedSize
Jonas Devlieghere [Wed, 21 Aug 2019 04:55:53 +0000 (04:55 +0000)]
[NFC] Remove unused function GetHexWithFixedSize

The implementation of this function was obviously incorrect, as the
result variable was never used. This led me to check if it was actually
used anywhere, which came back negative.

llvm-svn: 369492

4 years ago[NFC] Simplify code
Jonas Devlieghere [Wed, 21 Aug 2019 04:55:50 +0000 (04:55 +0000)]
[NFC] Simplify code

This simplifies the code and updates the comments.

llvm-svn: 369491

4 years agoFix 'fall through' annotation
Vitaly Buka [Wed, 21 Aug 2019 04:05:34 +0000 (04:05 +0000)]
Fix 'fall through' annotation

llvm-svn: 369490

4 years ago[ELF][test] Add CHECK lines omitted in r369488
Fangrui Song [Wed, 21 Aug 2019 03:15:57 +0000 (03:15 +0000)]
[ELF][test] Add CHECK lines omitted in r369488

Add append .o to some object file names

llvm-svn: 369489

4 years ago[ELF] More dynamic relocation packing
Fangrui Song [Wed, 21 Aug 2019 03:02:08 +0000 (03:02 +0000)]
[ELF] More dynamic relocation packing

Currently, with Android dynamic relocation packing, only relative
relocations are grouped together. This patch implements similar
packing for non-relative relocations.

The implementation groups non-relative relocations with the same
r_info and r_addend, if using RELA. By requiring a minimum group
size of 3, this achieves smaller relocation sections. Building Android
for an ARM32 device, I see the total size of /system/lib decrease by
392 KB.

Grouping by r_info also allows the runtime dynamic linker to implement
an 1-entry cache to reduce the number of symbol lookup required. With
such 1-entry cache implemented on Android, I'm seeing 10% to 20%
reduction in total time spent in runtime linker for several executables
that I tested.

As a simple correctness check, I've also built x86_64 Android and booted
successfully.

Differential Revision: https://reviews.llvm.org/D66491
Patch by Vic Yang!

llvm-svn: 369488

4 years agolibcxx: Rename .hpp files in libcxx/benchmarks to .h
Nico Weber [Wed, 21 Aug 2019 01:59:12 +0000 (01:59 +0000)]
libcxx: Rename .hpp files in libcxx/benchmarks to .h

LLVM uses .h as its extension for header files.

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

llvm-svn: 369487

4 years agoAutogenerate the shebang lines for tools/opt-viewer
Chris Bieneman [Wed, 21 Aug 2019 01:48:28 +0000 (01:48 +0000)]
Autogenerate the shebang lines for tools/opt-viewer

Summary:
Since these files depend on the built python modules, they need to use
the right python binary to run them. So use configure_file
to set the right shebang line.

Patch By: cbiesinger (Christian Biesinger)

Reviewers: chandlerc, beanz, anemet

Reviewed By: anemet

Subscribers: compnerd, JDevlieghere, mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 369486

4 years ago[NFC] Remove lldb_utility namespace.
Jonas Devlieghere [Wed, 21 Aug 2019 00:50:46 +0000 (00:50 +0000)]
[NFC] Remove lldb_utility namespace.

While generating the Doxygen I noticed this lone namespace that has one
class and one function in it. This moves them into lldb_private.

llvm-svn: 369485

4 years agoUpdate a few tests that may change the platform to save & restore
Jason Molenda [Wed, 21 Aug 2019 00:27:30 +0000 (00:27 +0000)]
Update a few tests that may change the platform to save & restore
the platform in the setUp/tearDown methods.  I want to migrate the
re-instatement of the correct plaform to the setUp base method but
haven't had time to look at that yet, so I want to land this handful
of fixes until I get to it.

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

llvm-svn: 369484

4 years agoFix missing __muloti4 function with UBSAN
Eric Fiselier [Wed, 21 Aug 2019 00:16:33 +0000 (00:16 +0000)]
Fix missing __muloti4 function with UBSAN

llvm-svn: 369483

4 years agoAttempt to fix MSAN failures in benchmarks
Eric Fiselier [Wed, 21 Aug 2019 00:14:48 +0000 (00:14 +0000)]
Attempt to fix MSAN failures in benchmarks

llvm-svn: 369482

4 years agolibcxx: Rename .hpp files in libcxx/test/support to .h
Nico Weber [Wed, 21 Aug 2019 00:14:12 +0000 (00:14 +0000)]
libcxx: Rename .hpp files in libcxx/test/support to .h

LLVM uses .h as its extension for header files.

Files renamed using:

    for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done

References to the files updated using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
        a=$(basename $f);
        echo $a;
        rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/";
    done

HPP include guards updated manually using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
      echo ${f%.hpp}.h ;
    done | xargs mvim

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

llvm-svn: 369481

4 years ago[AArch64][GlobalISel] Add support for narrowScalar of G_ZEXT
Amara Emerson [Wed, 21 Aug 2019 00:12:37 +0000 (00:12 +0000)]
[AArch64][GlobalISel] Add support for narrowScalar of G_ZEXT

We do this by merging the source with the high bits set to 0.

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

llvm-svn: 369480

4 years ago[Doxygen] Document private class members.
Jonas Devlieghere [Wed, 21 Aug 2019 00:10:19 +0000 (00:10 +0000)]
[Doxygen] Document private class members.

Given that the C++ documentation is meant for LLDB developers it makes
sense to include private class members in the output.

llvm-svn: 369479

4 years agoRemove llvm/utils/git/find-rev
Nico Weber [Tue, 20 Aug 2019 23:59:07 +0000 (23:59 +0000)]
Remove llvm/utils/git/find-rev

It assumes git-svn, hasn't been touched in ages, and it's replaced
by llvm-git in llvm/utils/git-svn.

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

llvm-svn: 369478

4 years ago[dotest] Don't set the DWARF version override in CFLAGS_EXTRA.
Jonas Devlieghere [Tue, 20 Aug 2019 23:56:32 +0000 (23:56 +0000)]
[dotest] Don't set the DWARF version override in CFLAGS_EXTRA.

We cannot override the DWARF version in the CFLAGS_EXTRA because they
are used by tests that explicitly build without debug info. Instead, we
pass them through the regular CFLAGS.

llvm-svn: 369477

4 years agogn build: Merge r369467
Nico Weber [Tue, 20 Aug 2019 23:49:12 +0000 (23:49 +0000)]
gn build: Merge r369467

llvm-svn: 369476

4 years ago[X86] Automatically generate shift tests. NFC
Amaury Sechet [Tue, 20 Aug 2019 23:47:19 +0000 (23:47 +0000)]
[X86] Automatically generate shift tests. NFC

llvm-svn: 369475

4 years agoAdd triple to new test to try to pacify bots
Reid Kleckner [Tue, 20 Aug 2019 23:32:51 +0000 (23:32 +0000)]
Add triple to new test to try to pacify bots

llvm-svn: 369474

4 years agoAdd TinyPtrVector support for general pointer-like things.
Andrew Trick [Tue, 20 Aug 2019 23:29:28 +0000 (23:29 +0000)]
Add TinyPtrVector support for general pointer-like things.

In particular, make TinyPtrVector<PtrIntPair<T *, 1>> work. Remove all
unnecessary assumptions that the element type has a formal "null"
representation. The important property to maintain is that
default-constructed element type has the same internal representation
as the default-constructed PointerUnion (all zero bits).

Remove the incorrect recursive behavior from
PointerUnion::isNull. This was never generally correct because it only
recursed over the first type parameter. With variadic templates it's
completely unnecessary.

llvm-svn: 369473

4 years ago[AArch64][asan] fix typo in AsanStats::Print
Sebastian Pop [Tue, 20 Aug 2019 23:28:05 +0000 (23:28 +0000)]
[AArch64][asan] fix typo in AsanStats::Print

This created an infinite loop that timed out several build bots while
executing the test in compiler-rt/test/asan/TestCases/atexit_stats.cpp

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

llvm-svn: 369472

4 years agoFix assert in XCOFFObjectWriter related to program code csects.
Sean Fertile [Tue, 20 Aug 2019 23:24:47 +0000 (23:24 +0000)]
Fix assert in XCOFFObjectWriter related to program code csects.

Removed code that added program code csects to a collection as part
of addressing review comments, but I failed to update an assert affected
by the change before commiting.

llvm-svn: 369471

4 years ago[Attributor] Liveness for internal functions.
Stefan Stipanovic [Tue, 20 Aug 2019 23:16:57 +0000 (23:16 +0000)]
[Attributor] Liveness for internal functions.

For an internal function, if all its call sites are dead, the body of the function is considered dead.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 369470

4 years ago[X86] Autogenerate vec_* tests. NFC
Amaury Sechet [Tue, 20 Aug 2019 23:11:29 +0000 (23:11 +0000)]
[X86] Autogenerate vec_* tests. NFC

llvm-svn: 369469

4 years ago[Sanitizer] Remove unused functions
Alexandre Ganea [Tue, 20 Aug 2019 22:56:40 +0000 (22:56 +0000)]
[Sanitizer] Remove unused functions

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

llvm-svn: 369468

4 years ago[RISCV GlobalISel] Adding initial GlobalISel infrastructure
Daniel Sanders [Tue, 20 Aug 2019 22:53:24 +0000 (22:53 +0000)]
[RISCV GlobalISel] Adding initial GlobalISel infrastructure

Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.

Patch by Andrew Wei

Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders

Reviewed By: dsanders

Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

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

llvm-svn: 369467

4 years ago[MemorySSA] Make Phi cleanups consistent.
Alina Sbirlea [Tue, 20 Aug 2019 22:47:58 +0000 (22:47 +0000)]
[MemorySSA] Make Phi cleanups consistent.

Summary:
Make Phi cleanups consistent: remove self as a trivial Phi and
recurse to potentially remove other trivial phis.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 369466

4 years ago[AArch64][GlobalISel] Select logical_imm32 and logical_imm64 patterns
Jessica Paquette [Tue, 20 Aug 2019 22:31:25 +0000 (22:31 +0000)]
[AArch64][GlobalISel] Select logical_imm32 and logical_imm64 patterns

Add a GlobalISel equivalent for the logical_imm32_XFORM and logical_imm64_XFORM
SDNodeXForms in AArch64InstrFormats.td.

- Add select-logical-imm.mir, which contains tests for each imported pattern.

- Update select-pr32733.mir and select-scalar-shift-imm.mir, since they now
select instructions of this form.

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

llvm-svn: 369465