platform/upstream/llvm.git
5 years ago[X86][SSE] Move extract_subvector(pshufb) fold to SimplifyDemandedVectorEltsForTargetNode
Simon Pilgrim [Wed, 1 May 2019 10:58:38 +0000 (10:58 +0000)]
[X86][SSE] Move extract_subvector(pshufb) fold to SimplifyDemandedVectorEltsForTargetNode

This lets us hit more cases than combineExtractSubvector and allows us reuse more code.

llvm-svn: 359669

5 years ago[llvm-objdump] Print newlines before and after "Disassembly of section ...:"
Fangrui Song [Wed, 1 May 2019 10:40:48 +0000 (10:40 +0000)]
[llvm-objdump] Print newlines before and after "Disassembly of section ...:"

This improves readability and the behavior is consistent with GNU objdump.

The new test test/tools/llvm-objdump/X86/disassemble-section-name.s
checks we print newlines before and after "Disassembly of section ...:"

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

llvm-svn: 359668

5 years ago[X86] SimplifyDemandedVectorEltsForTargetNode - pull out vector halving code. NFCI.
Simon Pilgrim [Wed, 1 May 2019 10:38:10 +0000 (10:38 +0000)]
[X86] SimplifyDemandedVectorEltsForTargetNode - pull out vector halving code. NFCI.

Pull out the HADD/HSUB code to halve vector widths if the upper half isn't used - prep work to adding support for other opcodes.

llvm-svn: 359667

5 years ago[X86][SSE] Extract i1 elements from vXi1 bool vectors
Simon Pilgrim [Wed, 1 May 2019 10:02:22 +0000 (10:02 +0000)]
[X86][SSE] Extract i1 elements from vXi1 bool vectors

This is an alternative to D59669 which more aggressively extracts i1 elements from vXi1 bool vectors using a MOVMSK.

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

llvm-svn: 359666

5 years agoFix build URL in new LLDB website
Raphael Isemann [Wed, 1 May 2019 09:55:00 +0000 (09:55 +0000)]
Fix build URL in new LLDB website

Summary:
After the LLDB website was migrated to be generated by Sphinx the build.html file lives in another location.

See http://lists.llvm.org/pipermail/lldb-dev/2019-April/014992.html.

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 359665

5 years agoRemoved unnecessary conversion to StringRef
Raphael Isemann [Wed, 1 May 2019 09:49:07 +0000 (09:49 +0000)]
Removed unnecessary conversion to StringRef

llvm-svn: 359664

5 years ago[yaml2obj] - Report when unknown section is referenced from program header declaratio...
George Rimar [Wed, 1 May 2019 09:45:55 +0000 (09:45 +0000)]
[yaml2obj] - Report when unknown section is referenced from program header declaration block.

Previously we did not report this.
Also this removes multiple lookups in the map
what cleanups the code.

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

llvm-svn: 359663

5 years agoChange llvm-{objdump,readobj} -long-option to --long-option or well-known short optio...
Fangrui Song [Wed, 1 May 2019 09:30:45 +0000 (09:30 +0000)]
Change llvm-{objdump,readobj} -long-option to --long-option or well-known short options in tests. NFC

llvm-svn: 359662

5 years ago[llvm-readobj] Change -t to --symbols in tests. NFC
Fangrui Song [Wed, 1 May 2019 09:28:24 +0000 (09:28 +0000)]
[llvm-readobj] Change -t to --symbols in tests. NFC

-t is --symbols in llvm-readobj but --section-details (unimplemented) in readelf.
The confusing option should not be used since we aim for improving
compatibility.

Keep just one llvm-readobj -t use case in test/tools/llvm-readobj/symbols.test

llvm-svn: 359661

5 years ago[gold] Fix two readelf tests after rL359649
Fangrui Song [Wed, 1 May 2019 09:01:10 +0000 (09:01 +0000)]
[gold] Fix two readelf tests after rL359649

llvm-svn: 359660

5 years ago[compiler-rt] Use correct spelling of the -Wno-pedantic variable
Petr Hosek [Wed, 1 May 2019 07:00:27 +0000 (07:00 +0000)]
[compiler-rt] Use correct spelling of the -Wno-pedantic variable

This addresses the issue introduced in r359646 which is causing
sanitizer bots to fail.

llvm-svn: 359659

5 years ago[X86FixupLEAs] Hoist the calls to isLEA out of the 3 separate functions and put it...
Craig Topper [Wed, 1 May 2019 06:53:03 +0000 (06:53 +0000)]
[X86FixupLEAs] Hoist the calls to isLEA out of the 3 separate functions and put it in the basic block instruction loop. NFC

Now need to check it 3 different times. Just do it once at the top of the loop.

llvm-svn: 359658

5 years agoFix test/tools/llvm-readobj/mips-plt.test
Fangrui Song [Wed, 1 May 2019 06:46:34 +0000 (06:46 +0000)]
Fix test/tools/llvm-readobj/mips-plt.test

llvm-svn: 359657

5 years ago[libcxx] Move CMake file to src, avoid using globs
Petr Hosek [Wed, 1 May 2019 06:40:36 +0000 (06:40 +0000)]
[libcxx] Move CMake file to src, avoid using globs

This addresses the longstanding FIXME and makes libc++ build more
similar to other runtimes.

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

llvm-svn: 359656

5 years agoUse __extension__ to suppress __EH_FRAME_LIST__ warnings
Fangrui Song [Wed, 1 May 2019 06:25:21 +0000 (06:25 +0000)]
Use __extension__ to suppress __EH_FRAME_LIST__ warnings

gcc -pedantic => warning: ISO C forbids empty initializer braces
clang -pedantic => -Wzero-length-array + -Wgnu-empty-initializer

llvm-svn: 359655

5 years agolib/Header: Fix Visual Studio builds try #2
Tom Stellard [Wed, 1 May 2019 06:18:03 +0000 (06:18 +0000)]
lib/Header: Fix Visual Studio builds try #2

Summary:
This is a follow up to r355253 and a better fix than the first attempt
which was r359257.

We can't install anything from ${CMAKE_CFG_INTDIR}, because this value
is only defined at build time, but we still must make sure to copy the
headers into ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include, because the lit
tests look for headers there.  So for this fix we revert to the
old behavior of copying the headers to ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include
during the build and then installing them from the source tree.

Reviewers: smeenai, vzakhari, phosek

Reviewed By: smeenai, vzakhari

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 359654

5 years ago[llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf
Fangrui Song [Wed, 1 May 2019 06:02:16 +0000 (06:02 +0000)]
[llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf

While updating the test, change -l -S to -S -l as the output of -S goes
before -l.

llvm-svn: 359653

5 years ago[llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf. NFC
Fangrui Song [Wed, 1 May 2019 05:55:22 +0000 (05:55 +0000)]
[llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf. NFC

The latter is much more common.

A dedicated --elf-output-style=GNU test demonstrating it is the same as
llvm-readelf is sufficient.

llvm-svn: 359652

5 years ago[test] Change llvm-readobj -long-option to --long-option or well-known short options...
Fangrui Song [Wed, 1 May 2019 05:49:01 +0000 (05:49 +0000)]
[test] Change llvm-readobj -long-option to --long-option or well-known short options. NFC

Also change some options that have different semantics (cause confusion) in llvm-readelf mode:

-s => -S
-t => --symbols
-sd => --section-data

llvm-svn: 359651

5 years ago[compiler-rt] Cleanup the --target and --sysroot handling
Petr Hosek [Wed, 1 May 2019 05:41:58 +0000 (05:41 +0000)]
[compiler-rt] Cleanup the --target and --sysroot handling

This addresses issue introduced in r359646.

llvm-svn: 359650

5 years ago[llvm-readobj] Change -long-option to --long-option in tests. NFC
Fangrui Song [Wed, 1 May 2019 05:27:20 +0000 (05:27 +0000)]
[llvm-readobj] Change -long-option to --long-option in tests. NFC

We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

llvm-svn: 359649

5 years agoRevert "[llvm] r359313 - [PowerPC] Update P9 vector costs for insert/extract element"
David L. Jones [Wed, 1 May 2019 05:01:03 +0000 (05:01 +0000)]
Revert "[llvm] r359313 - [PowerPC] Update P9 vector costs for insert/extract element"

This causes segfaults during optimized builds. More details, including a reproducer, are on the llvm-commits thread for r359313.

llvm-svn: 359648

5 years agoDelete outdated comment about DISubprogram. NFC
Fangrui Song [Wed, 1 May 2019 03:38:41 +0000 (03:38 +0000)]
Delete outdated comment about DISubprogram. NFC

rL301501 deleted DisplayName and rearranged the operands.

llvm-svn: 359647

5 years ago[compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.o
Petr Hosek [Wed, 1 May 2019 03:30:51 +0000 (03:30 +0000)]
[compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.o

These are needed to make bots happy.

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

llvm-svn: 359646

5 years ago[CMake] Correct lldbPluginProcessPOSIX dependencies
Alex Langford [Wed, 1 May 2019 03:23:09 +0000 (03:23 +0000)]
[CMake] Correct lldbPluginProcessPOSIX dependencies

This plugin does not depend on lldbInterpreter. It only depends on
lldbUtility.

llvm-svn: 359645

5 years ago[compiler-rt] Rework the object build support
Petr Hosek [Wed, 1 May 2019 02:49:45 +0000 (02:49 +0000)]
[compiler-rt] Rework the object build support

The initial implementation didn't properly support cross-compilation
via the runtime build, the updated implementation should address that
by expanding the CMAKE_C_COMPILE_OBJECT variable with correct values.

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

llvm-svn: 359644

5 years ago[JITLink] Make sure we explicitly deallocate memory on failure.
Lang Hames [Wed, 1 May 2019 02:43:52 +0000 (02:43 +0000)]
[JITLink] Make sure we explicitly deallocate memory on failure.

JITLinkGeneric phases 2 and 3 (focused on applying fixups and finalizing memory,
respectively) may fail for various reasons. If this happens, we need to
explicitly de-allocate the memory allocated in phase 1 (explicitly, because
deallocation may also fail and so is implemented as a method returning error).

No testcase yet: I am still trying to decide on the right way to test totally
platform agnostic code like this.

llvm-svn: 359643

5 years agoFix a bunch of unordered container tests that were failing when _LIBCPP_DEBUG was...
Marshall Clow [Wed, 1 May 2019 01:52:51 +0000 (01:52 +0000)]
Fix a bunch of unordered container tests that were failing when _LIBCPP_DEBUG was set.

llvm-svn: 359642

5 years ago[libFuzzer] Disable i386 on non-Linux platforms
Jonathan Metzman [Wed, 1 May 2019 01:40:31 +0000 (01:40 +0000)]
[libFuzzer] Disable i386 on non-Linux platforms

Summary: Disable i386 on non-Linux platforms since it is unwanted and broken on Windows.

Reviewers: morehouse, rnk

Reviewed By: morehouse

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 359641

5 years agoMake some comments that were meant to be for public documentation
Eric Christopher [Wed, 1 May 2019 01:28:12 +0000 (01:28 +0000)]
Make some comments that were meant to be for public documentation
actually public documentation (i.e. // -> ///).

llvm-svn: 359640

5 years ago[llvm-objcopy] Simplify SHT_NOBITS -> SHT_PROGBITS promotion
Fangrui Song [Wed, 1 May 2019 00:39:31 +0000 (00:39 +0000)]
[llvm-objcopy] Simplify SHT_NOBITS -> SHT_PROGBITS promotion

GNU objcopy uses bfd_elf_get_default_section_type to decide the candidate section type,
which roughly translates to our [a] (I assume SEC_COMMON implies SHF_ALLOC):

  (!(Sec.Flags & ELF::SHF_ALLOC) || Flags & (SectionFlag::SecContents | SectionFlag::SecLoad)))

Then, it updates the section type in bfd/elf.c:elf_fake_sections if:

  if (this_hdr->sh_type == SHT_NULL)
    this_hdr->sh_type = sh_type; // common case
  else if (this_hdr->sh_type == SHT_NOBITS
           && sh_type == SHT_PROGBITS
           && (asect->flags & SEC_ALLOC) != 0)  // uncommon case
    ...
    this_hdr->sh_type = sh_type;

If the following condition is met the uncommon branch is executed:

  if (elf_section_type (osec) == SHT_NULL
      && (osec->flags == isec->flags
  || (final_link
      && ((osec->flags ^ isec->flags)
  & ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC)) == 0)))

I suggest we just ignore this clause and follow the common case
behavior, which is done in this patch. Rationales to do so:

If --set-section-flags is a no-op (osec->flags == isec->flags)
(corresponds to the "readonly" test in set-section-flags.test), GNU
objcopy will require (Sec.Flags & ELF::SHF_ALLOC). [a] is essentially:

  Flags & (SectionFlag::SecContents | SectionFlag::SecLoad)

This special case is not really useful. Non-SHF_ALLOC SHT_NOBITS
sections do not make much sense and it doesn't matter if they are
SHT_NOBITS or SHT_PROGBITS.

For all other RUN lines in set-section-flags.test, the new behavior
matches GNU objcopy, i.e. this patch improves compatibility.

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

llvm-svn: 359639

5 years ago[libFuzzer] Fix failing test: sigint.test
Jonathan Metzman [Tue, 30 Apr 2019 23:46:52 +0000 (23:46 +0000)]
[libFuzzer] Fix failing test: sigint.test

Summary:
Fix sigint.test by making it require msan rather
than enumerating unsupported platforms.

Reviewers: kcc

Reviewed By: kcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 359638

5 years agogn build: Fix build on macOS after r359570 / r359527
Nico Weber [Tue, 30 Apr 2019 23:40:58 +0000 (23:40 +0000)]
gn build: Fix build on macOS after r359570 / r359527

llvm-svn: 359637

5 years agoFix auto-init test
JF Bastien [Tue, 30 Apr 2019 23:27:28 +0000 (23:27 +0000)]
Fix auto-init test

r359628 changed the initialization of padding to follow C, but I didn't update the C++ tests.

llvm-svn: 359636

5 years agogn build: Merge r359626
Nico Weber [Tue, 30 Apr 2019 23:22:40 +0000 (23:22 +0000)]
gn build: Merge r359626

llvm-svn: 359635

5 years ago[WebAssembly] Update expectations for gcc torture tests
Sam Clegg [Tue, 30 Apr 2019 23:10:28 +0000 (23:10 +0000)]
[WebAssembly] Update expectations for gcc torture tests

This is needed to make the wasm waterfall green again
after we land the update to WASI:
https://github.com/WebAssembly/waterfall/pull/492

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

llvm-svn: 359634

5 years ago[InstCombine] Limit a vector demanded elts rule which was producing invalid IR.
Philip Reames [Tue, 30 Apr 2019 23:09:26 +0000 (23:09 +0000)]
[InstCombine] Limit a vector demanded elts rule which was producing invalid IR.

The demanded elts rules introduced for GEPs in https://reviews.llvm.org/rL356293 replaced vector constants with undefs (by design).  It turns out that the LangRef disallows such cases when indexing structs.  The right fix is probably to relax the langref requirement, and update other passes to expect the result, but for the moment, limit the transform to avoid compiler crashes.

This should fix https://bugs.llvm.org/show_bug.cgi?id=41624.

llvm-svn: 359633

5 years agoAdded test.
Mitch Phillips [Tue, 30 Apr 2019 23:07:12 +0000 (23:07 +0000)]
Added test.

llvm-svn: 359632

5 years ago[sanitizer_common] Added 64-bit signed flag parser.
Mitch Phillips [Tue, 30 Apr 2019 23:07:10 +0000 (23:07 +0000)]
[sanitizer_common] Added 64-bit signed flag parser.

Summary: Adds a 64-bit signed flag parser for GWP-ASan's use.

Reviewers: vlad.tsyrklevich, eugenis

Subscribers: kubamracek, #sanitizers, llvm-commits, vitalybuka, morehouse, pcc, kcc

Tags: #sanitizers, #llvm

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

llvm-svn: 359631

5 years ago[WebAssembly] Use the "wasm32-wasi" triple in tests
Dan Gohman [Tue, 30 Apr 2019 23:06:07 +0000 (23:06 +0000)]
[WebAssembly] Use the "wasm32-wasi" triple in tests

Similar to https://reviews.llvm.org/D61334, update clang tests to use the
"wasm32-wasi" triple, removing the "-musl" environment and omitting the
"-unknown" vendor.

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

Reviewer: sbc100
llvm-svn: 359630

5 years ago[WebAssembly] Test the "wasm32-wasi" triple
Dan Gohman [Tue, 30 Apr 2019 23:04:49 +0000 (23:04 +0000)]
[WebAssembly] Test the "wasm32-wasi" triple

Add triple tests for "wasm32-wasi" and "wasm64-wasi", and also remove the
"-musl" component from the existing wasm triple tests as we're not using that
in practice (WASI libc is derived in part from musl, but it is not fully
musl-compatible).

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

Reviewer: sbc100
llvm-svn: 359629

5 years agoVariable auto-init: don't initialize aggregate padding of all aggregates
JF Bastien [Tue, 30 Apr 2019 22:56:53 +0000 (22:56 +0000)]
Variable auto-init: don't initialize aggregate padding of all aggregates

Summary:
C guarantees that brace-init with fewer initializers than members in the
aggregate will initialize the rest of the aggregate as-if it were static
initialization. In turn static initialization guarantees that padding is
initialized to zero bits.

Quoth the Standard:

C17 6.7.9 Initialization ❡21

If there are fewer initializers in a brace-enclosed list than there are elements
or members of an aggregate, or fewer characters in a string literal used to
initialize an array of known size than there are elements in the array, the
remainder of the aggregate shall be initialized implicitly the same as objects
that have static storage duration.

C17 6.7.9 Initialization ❡10

If an object that has automatic storage duration is not initialized explicitly,
its value is indeterminate. If an object that has static or thread storage
duration is not initialized explicitly, then:

 * if it has pointer type, it is initialized to a null pointer;
 * if it has arithmetic type, it is initialized to (positive or unsigned) zero;
 * if it is an aggregate, every member is initialized (recursively) according to
   these rules, and any padding is initialized to zero bits;
 * if it is a union, the first named member is initialized (recursively)
   according to these rules, and any padding is initialized to zero bits;

<rdar://problem/50188861>

Reviewers: glider, pcc, kcc, rjmccall, erik.pilkington

Subscribers: jkorous, dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 359628

5 years ago[MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.
Alina Sbirlea [Tue, 30 Apr 2019 22:43:55 +0000 (22:43 +0000)]
[MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.

Summary:
MemorySSA keeps internal pointers of AA and DT.
If these get invalidated, so should MemorySSA.

Reviewers: george.burgess.iv, chandlerc

Subscribers: jlebar, Prazek, llvm-commits

Tags: LLVM

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

llvm-svn: 359627

5 years ago[ORC] Move SimpleCompiler/ConcurrentIRCompiler definitions into a .cpp file.
Lang Hames [Tue, 30 Apr 2019 22:42:01 +0000 (22:42 +0000)]
[ORC] Move SimpleCompiler/ConcurrentIRCompiler definitions into a .cpp file.

SimpleCompiler is no longer templated, so there's no reason for this code to be
in a header any more.

llvm-svn: 359626

5 years ago[llvm-profdata] Fix indentation error in docs. NFC.
Rong Xu [Tue, 30 Apr 2019 22:35:35 +0000 (22:35 +0000)]
[llvm-profdata] Fix indentation error in docs. NFC.

llvm-svn: 359625

5 years ago[libFuzzer] temporarily disable a test on windows, where there is no memmem in the...
Kostya Serebryany [Tue, 30 Apr 2019 22:27:38 +0000 (22:27 +0000)]
[libFuzzer] temporarily disable a test on windows, where there is no memmem in the usual place

llvm-svn: 359624

5 years agoRemove two unnecessary wrappers of canPassInRegisters
Reid Kleckner [Tue, 30 Apr 2019 22:23:20 +0000 (22:23 +0000)]
Remove two unnecessary wrappers of canPassInRegisters

These extra layers aren't necessary.

llvm-svn: 359623

5 years ago[AliasAnalysis/NewPassManager] Invalidate AAManager less often.
Alina Sbirlea [Tue, 30 Apr 2019 22:15:47 +0000 (22:15 +0000)]
[AliasAnalysis/NewPassManager] Invalidate AAManager less often.

Summary:
This is a redo of D60914.

The objective is to not invalidate AAManager, which is stateless, unless
there is an explicit invalidate in one of the AAResults.

To achieve this, this patch adds an API to PAC, to check precisely this:
is this analysis not invalidated explicitly == is this analysis not abandoned == is this analysis stateless, so preserved without explicitly being marked as preserved by everyone

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, george.burgess.iv, llvm-commits

Tags: #llvm

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

llvm-svn: 359622

5 years ago[AMDGPU] gfx1010 VMEM and SMEM implementation
Stanislav Mekhanoshin [Tue, 30 Apr 2019 22:08:23 +0000 (22:08 +0000)]
[AMDGPU] gfx1010 VMEM and SMEM implementation

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

llvm-svn: 359621

5 years ago[libFuzzer] add MagicSeparatorTest
Kostya Serebryany [Tue, 30 Apr 2019 22:05:55 +0000 (22:05 +0000)]
[libFuzzer] add MagicSeparatorTest

llvm-svn: 359620

5 years ago[llvm-profdata] Fix indentation error. NFC
Rong Xu [Tue, 30 Apr 2019 22:05:11 +0000 (22:05 +0000)]
[llvm-profdata] Fix indentation error. NFC

llvm-svn: 359619

5 years agoAdd an include of Module since we actually access it now and remove
Eric Christopher [Tue, 30 Apr 2019 21:55:15 +0000 (21:55 +0000)]
Add an include of Module since we actually access it now and remove
the forward declaration.

llvm-svn: 359618

5 years agoFix a few -Werror warnings:
Eric Christopher [Tue, 30 Apr 2019 21:44:21 +0000 (21:44 +0000)]
Fix a few -Werror warnings:
 - Remove a variable only used in an assert
 - Fix pessimizing move warning around copy elision

llvm-svn: 359617

5 years agoSet LoopInterleaved in the PassManagerBuilder.
Alina Sbirlea [Tue, 30 Apr 2019 21:29:23 +0000 (21:29 +0000)]
Set LoopInterleaved in the PassManagerBuilder.

Summary: Corresponds to D61030.

Subscribers: jlebar, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 359616

5 years ago[PassManagerBuilder] Add option for interleaved loops, for loop vectorize.
Alina Sbirlea [Tue, 30 Apr 2019 21:29:20 +0000 (21:29 +0000)]
[PassManagerBuilder] Add option for interleaved loops, for loop vectorize.

Summary:
Match NewPassManager behavior: add option for interleaved loops in the
old pass manager, and use that instead of the flag used to disable loop unroll.
No changes in the defaults.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, dmgreen, hsaito, llvm-commits

Tags: #llvm

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

llvm-svn: 359615

5 years ago[JITLink] Add debugging output to print resolved external atoms.
Lang Hames [Tue, 30 Apr 2019 21:28:07 +0000 (21:28 +0000)]
[JITLink] Add debugging output to print resolved external atoms.

llvm-svn: 359614

5 years ago[ORC][JITLink] Name in-memory compiled objects after their source modules.
Lang Hames [Tue, 30 Apr 2019 21:27:56 +0000 (21:27 +0000)]
[ORC][JITLink] Name in-memory compiled objects after their source modules.

In-memory compiled object buffer identifiers will now be derived from the
identifiers of their source IR modules. This makes it easier to connect
in-memory objects with their source modules in debugging output.

llvm-svn: 359613

5 years ago[llvm-profdata] Add overlap command to compute similarity b/w two profile files
Rong Xu [Tue, 30 Apr 2019 21:19:12 +0000 (21:19 +0000)]
[llvm-profdata] Add overlap command to compute similarity b/w two profile files

Add overlap functionality to llvm-profdata tool to compute the similarity
between two profile files.

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

llvm-svn: 359612

5 years agoRevert r359325 "[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void"
Reid Kleckner [Tue, 30 Apr 2019 20:59:56 +0000 (20:59 +0000)]
Revert r359325 "[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void"

Changing INTERCEPT_FUNCTION to return void is not functionally correct.
IMO the best way to communicate failure or success of interception is
with a return value, not some external address comparison.

This change was also creating link errors for _except_handler4_common,
which is exported from ucrtbase.dll in 32-bit Windows.

Also revert dependent changes r359362 and r359466.

llvm-svn: 359611

5 years ago[libFuzzer] Replace -seed_corpus to better support fork mode on Win
Jonathan Metzman [Tue, 30 Apr 2019 20:56:18 +0000 (20:56 +0000)]
[libFuzzer] Replace -seed_corpus to better support fork mode on Win

Summary:
Pass seed corpus list in a file to get around argument length limits on Windows.
This limit was preventing many uses of fork mode on Windows.

Reviewers: kcc, morehouse

Reviewed By: kcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 359610

5 years ago[NFC][InlineCost] cleanup - comments, overflow handling.
Fedor Sergeev [Tue, 30 Apr 2019 20:44:53 +0000 (20:44 +0000)]
[NFC][InlineCost] cleanup - comments, overflow handling.

Reviewed By: apilipenko
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60751

llvm-svn: 359609

5 years ago[X86][SSE] Fold extract_subvector(extend(x)) -> extend_vector_inreg(x)
Simon Pilgrim [Tue, 30 Apr 2019 20:31:07 +0000 (20:31 +0000)]
[X86][SSE] Fold extract_subvector(extend(x)) -> extend_vector_inreg(x)

This adds any extend support - folding to zero_extend_vector_inreg (PMOVZX) for legality

Minor improvement for PR39709

llvm-svn: 359608

5 years ago[compiler-rt][builtins][sanitizers] Update compiler-rt test cases for
Amy Kwan [Tue, 30 Apr 2019 20:09:00 +0000 (20:09 +0000)]
[compiler-rt][builtins][sanitizers] Update compiler-rt test cases for
compatibility with system's toolchain

This patch aims to:
- Guard ompiler-rt/test/builtins/Unit/compiler_rt_logb_test.c with macros, so
the test runs on GLIBC versions >= 2.23. This is because the test relies on
comparing its computed values to libm. Oolder versions might not compute to the
same value as the compiler-rt value.
- Update compiler-rt/test/sanitizer_common/TestCases/Posix/getpw_getgr.cc
so that std::string is not used, since false positives may be detected.

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

llvm-svn: 359606

5 years ago[WebAssembly] Fix test after r359602
Dan Gohman [Tue, 30 Apr 2019 19:58:56 +0000 (19:58 +0000)]
[WebAssembly] Fix test after r359602

Update the expected output for this test now that the EXPLICIT_NAME
flag is being printed.

llvm-svn: 359605

5 years agoFix stack-use-after free after r359580
Nico Weber [Tue, 30 Apr 2019 19:43:35 +0000 (19:43 +0000)]
Fix stack-use-after free after r359580

`Candidate` was a StringRef refering to a temporary string.
Instead, create a local variable for the string and use
a StringRef referring to that.

llvm-svn: 359604

5 years ago[Driver] Support compiler-rt crtbegin.o/crtend.o for Linux
Petr Hosek [Tue, 30 Apr 2019 19:35:14 +0000 (19:35 +0000)]
[Driver] Support compiler-rt crtbegin.o/crtend.o for Linux

When compiler-rt is selected as the runtime library for Linux targets
use its crtbegin.o/crtend.o implemenetation rather than platform one
if available.

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

llvm-svn: 359603

5 years ago[WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobj
Dan Gohman [Tue, 30 Apr 2019 19:30:24 +0000 (19:30 +0000)]
[WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobj

Teach llvm-readobj about WASM_SYMBOL_EXPLICIT_NAME.

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

Reviewer: sbc100
llvm-svn: 359602

5 years ago[OpenMP] Add OpenMP 5.0 nonmonotonic code
Jonathan Peyton [Tue, 30 Apr 2019 19:20:35 +0000 (19:20 +0000)]
[OpenMP] Add OpenMP 5.0 nonmonotonic code

This patch adds:
* New omp_sched_monotonic flag to omp_sched_t which is handled within the runtime
* Parsing of monotonic/nonmonotonic in OMP_SCHEDULE
* Tests for the monotonic flag and envirable parsing
* Logic to force monotonic when hierarchical scheduling is used

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

llvm-svn: 359601

5 years ago[WebAssembly] Support f16 libcalls
Dan Gohman [Tue, 30 Apr 2019 19:17:59 +0000 (19:17 +0000)]
[WebAssembly] Support f16 libcalls

Add support for f16 libcalls in WebAssembly. This entails adding signatures
for the remaining F16 libcalls, and renaming gnu_f2h_ieee/gnu_h2f_ieee to
truncsfhf2/extendhfsf2 for consistency between f32 and f64/f128 (compiler-rt
already supports this).

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

Reviewer: dschuff
llvm-svn: 359600

5 years ago[OpenMP] Eliminate some compiler warnings
Jonathan Peyton [Tue, 30 Apr 2019 19:13:37 +0000 (19:13 +0000)]
[OpenMP] Eliminate some compiler warnings

* Remove accidental == for =
* Assign values to variables to appease compiler
* Surround debug code with KMP_DEBUG
* Remove unused local typedefs

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

llvm-svn: 359599

5 years agoAdd requires amdgpu-registered-target for amdgpu-float16.cpp
Yaxun Liu [Tue, 30 Apr 2019 19:06:15 +0000 (19:06 +0000)]
Add requires amdgpu-registered-target for amdgpu-float16.cpp

llvm-svn: 359598

5 years ago[X86] Remove if that's always true
Craig Topper [Tue, 30 Apr 2019 19:02:15 +0000 (19:02 +0000)]
[X86] Remove if that's always true

It's been like this since it was added in a refactor of this code.

Fixes PR41659

llvm-svn: 359597

5 years agoSupport overaligned types in `aligned_storage`.
Eric Fiselier [Tue, 30 Apr 2019 18:44:45 +0000 (18:44 +0000)]
Support overaligned types in `aligned_storage`.

Summary:
The current implementation of aligned storage was written before we had `alignas`, so it used a list of builtin types to force the alignment. But this doesn't work overaligned requests.

This patch adds a fallback case supporting over-alignment. It only affects case that were previously ill-formed.

Reviewers: rsmith, ldionne, dlj, mclow.lists

Reviewed By: mclow.lists

Subscribers: mclow.lists, dexonsmith, libcxx-commits

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

llvm-svn: 359596

5 years ago[SimplifyLibCalls] Clean up code (NFC)
Evandro Menezes [Tue, 30 Apr 2019 18:35:38 +0000 (18:35 +0000)]
[SimplifyLibCalls] Clean up code (NFC)

Fix pointer check after dereferencing (PR41665).

llvm-svn: 359595

5 years agoAMDGPU: Enable _Float16
Yaxun Liu [Tue, 30 Apr 2019 18:35:37 +0000 (18:35 +0000)]
AMDGPU: Enable _Float16

llvm-svn: 359594

5 years agoAdd CxxModuleHandler to Xcode project
Jonas Devlieghere [Tue, 30 Apr 2019 18:21:14 +0000 (18:21 +0000)]
Add CxxModuleHandler to Xcode project

llvm-svn: 359593

5 years ago[AArch64] add more tests for constant folding failures; NFC
Sanjay Patel [Tue, 30 Apr 2019 18:15:18 +0000 (18:15 +0000)]
[AArch64] add more tests for constant folding failures; NFC

llvm-svn: 359592

5 years agoReland "[compiler-rt] Simple crtbegin.o and crtend.o implementation"
Petr Hosek [Tue, 30 Apr 2019 18:13:22 +0000 (18:13 +0000)]
Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation"

Clang relies on existence of certain symbols that are normally
provided by crtbegin.o/crtend.o. However, LLVM does not currently
provide implementation of these files, instead relying on either
libgcc or implementations provided as part of the system.

This change provides an initial implementation of crtbegin.o/crtend.o
that can be used on system that don't provide crtbegin.o/crtend.o as
part of their C library.

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

llvm-svn: 359591

5 years agofix broken test
Jonathan Metzman [Tue, 30 Apr 2019 17:58:59 +0000 (17:58 +0000)]
fix broken test

llvm-svn: 359590

5 years agoremove extra zeros
Jonathan Metzman [Tue, 30 Apr 2019 17:58:58 +0000 (17:58 +0000)]
remove extra zeros

llvm-svn: 359589

5 years agoremove stale comment
Jonathan Metzman [Tue, 30 Apr 2019 17:58:58 +0000 (17:58 +0000)]
remove stale comment

llvm-svn: 359588

5 years agochange order
Jonathan Metzman [Tue, 30 Apr 2019 17:58:57 +0000 (17:58 +0000)]
change order

llvm-svn: 359587

5 years agofix comment
Jonathan Metzman [Tue, 30 Apr 2019 17:58:57 +0000 (17:58 +0000)]
fix comment

llvm-svn: 359586

5 years ago[libFuzzer] Enable for i386
Jonathan Metzman [Tue, 30 Apr 2019 17:58:56 +0000 (17:58 +0000)]
[libFuzzer] Enable for i386

Summary: Get libFuzzer to build on i386 and fix tests.

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 359585

5 years agoFix issues with testing for i386
Jonathan Metzman [Tue, 30 Apr 2019 17:58:55 +0000 (17:58 +0000)]
Fix issues with testing for i386

llvm-svn: 359584

5 years agoEnable x86 builds
Jonathan Metzman [Tue, 30 Apr 2019 17:58:54 +0000 (17:58 +0000)]
Enable x86 builds

llvm-svn: 359583

5 years ago[X86] If PreprocessISelDAG reorders a load before a call, make sure we remove dead...
Craig Topper [Tue, 30 Apr 2019 17:56:47 +0000 (17:56 +0000)]
[X86] If PreprocessISelDAG reorders a load before a call, make sure we remove dead nodes from the graph

The reordering can leave at least a dead TokenFactor in the graph. This cause the linearize scheduler to fail with something like the assert seen in PR22614. This is only one of many ways we can break the linearize scheduler today so I can't say for sure that any of the other failures in that bug were caused by this issue.

This takes the heavy hammer approach of just running RemoveDeadNodes unconditionally at the end of the PreprocessISelDAG. If this turns out to be a compile time hit, we can try to refine it.

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

llvm-svn: 359582

5 years ago[X86] Initial cleanups on the FixupLEAs pass. Separate Atom LEA creation from other...
Craig Topper [Tue, 30 Apr 2019 17:56:28 +0000 (17:56 +0000)]
[X86] Initial cleanups on the FixupLEAs pass. Separate Atom LEA creation from other LEA optimizations.

This removes some of the class variables. Merge basic block processing into
runOnMachineFunction to keep the flags local.

Pass MachineBasicBlock around instead of an iterator. We can get the iterator in
the few places that need it. Allows a range-based outer for loop.

Separate the Atom optimization from the rest of the optimizations. This allows
fixupIncDec to create INC/DEC and still allow Atom to turn it back into LEA
when profitable by its heuristics.

I'd like to improve fixupIncDec to turn LEAs into ADD any time the base or index
register is equal to the destination register. This is profitable regardless of
the various slow flags. But again we would want Atom to be able to undo that.

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

llvm-svn: 359581

5 years agoRe-reland "[Option] Fix PR37006 prefix choice in findNearest"
Nico Weber [Tue, 30 Apr 2019 17:46:00 +0000 (17:46 +0000)]
Re-reland "[Option] Fix PR37006 prefix choice in findNearest"

This was first reviewed in https://reviews.llvm.org/D46776 and
landed in r332299, but got reverted because it broke the PS4
bots.

https://reviews.llvm.org/D50410 fixed this, and then this
change was re-reviewed at https://reviews.llvm.org/D50515 and
relanded in r341329. It got reverted due to causing MSan issues.
However, nobody wrote down the error message and the bot link
is dead, so I'm relanding this to capture the MSan error.
I'll then either fix it, or copy it somewhere and revert if
fixing looks difficult.

llvm-svn: 359580

5 years agoRevert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"
Petr Hosek [Tue, 30 Apr 2019 17:32:05 +0000 (17:32 +0000)]
Revert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"

This reverts commit r359576 since it's failing on Windows bots.

llvm-svn: 359579

5 years ago[LibTooling] Fix broken test after r359574.
Yitzhak Mandelbaum [Tue, 30 Apr 2019 17:24:36 +0000 (17:24 +0000)]
[LibTooling] Fix broken test after r359574.

r359574 changed the way that failures are reported, which broke the test TransformerTest.NodePartNameDeclRefFailure which detects a faiure.

llvm-svn: 359578

5 years agoSort Symbol/CMakeLists.txt
Jonas Devlieghere [Tue, 30 Apr 2019 17:22:29 +0000 (17:22 +0000)]
Sort Symbol/CMakeLists.txt

This makes resolving merge conflicts downstream a tad easier.

llvm-svn: 359577

5 years ago[compiler-rt] Simple crtbegin.o and crtend.o implementation
Petr Hosek [Tue, 30 Apr 2019 17:21:13 +0000 (17:21 +0000)]
[compiler-rt] Simple crtbegin.o and crtend.o implementation

Clang relies on existence of certain symbols that are normally
provided by crtbegin.o/crtend.o. However, LLVM does not currently
provide implementation of these files, instead relying on either
libgcc or implementations provided as part of the system.

This change provides an initial implementation of crtbegin.o/crtend.o
that can be used on system that don't provide crtbegin.o/crtend.o as
part of their C library.

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

llvm-svn: 359576

5 years agoXFAIL x86-64-zmm-read on Darwin
Jonas Devlieghere [Tue, 30 Apr 2019 17:21:05 +0000 (17:21 +0000)]
XFAIL x86-64-zmm-read on Darwin

llvm-svn: 359575

5 years ago[LibTooling] Change Transformer's TextGenerator to a partial function.
Yitzhak Mandelbaum [Tue, 30 Apr 2019 16:48:33 +0000 (16:48 +0000)]
[LibTooling] Change Transformer's TextGenerator to a partial function.

Summary:
Changes the signature of the TextGenerator std::function to return an Expected<std::string>
instead of std::string to allow for (non-fatal) failures.  Previously, we
expected that any failures would be expressed with assertions. However, that's
unfriendly to running the code in servers or other places that don't want their
library calls to crash the program.

Correspondingly, updates Transformer's handling of failures in TextGenerators
and the signature of `ChangeConsumer`.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 359574

5 years agoUn-xfail the TestMiniDump tests on Windows
Stella Stamenova [Tue, 30 Apr 2019 16:42:39 +0000 (16:42 +0000)]
Un-xfail the TestMiniDump tests on Windows

After Aaron's commit for ObjectFilePECOFF:: GetUUID, the tests are now passing

llvm-svn: 359573

5 years ago[lldb] [Process/NetBSD] Fix handling piod_len from PT_IO calls
Michal Gorny [Tue, 30 Apr 2019 16:30:32 +0000 (16:30 +0000)]
[lldb] [Process/NetBSD] Fix handling piod_len from PT_IO calls

Fix bugs in piod_len return value processing in ReadMemory()
and WriteMemory() methods.  In particular, add support for piod_len == 0
indicating EOF, and fix summing bytes_read/bytes_written when PT_IO does
partial reads/writes.

The EOF condition could happen if LLDB attempts to read past
vm.maxaddress, e.g. as a result of RBP containing large (invalid) value.
Previously, the 0 return caused the function to retry reading via PT_IO
indefinitely, effectively deadlooping lldb-server.

Partial reads probably did not occur in practice, yet they would cause
ReadMemory() to return incorrect bytes_read and/or overwrite previously
read data.

WriteMemory() suffered from analoguous problems.

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

llvm-svn: 359572

5 years ago[libc++][CMake] Refactor how we link against system libraries
Louis Dionne [Tue, 30 Apr 2019 15:44:19 +0000 (15:44 +0000)]
[libc++][CMake] Refactor how we link against system libraries

Summary:
Instead of populating the global LIBCXX_LIBRARIES, we use the link-time
dependency management built into CMake to propagate link flags. This
leads to a cleaner and easier-to-follow build.

Reviewers: phosek, smeenai, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, mstorsjo, libcxx-commits

Tags: #libc

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

llvm-svn: 359571

5 years agogn build: Add check-clangd target after r3359424
Nico Weber [Tue, 30 Apr 2019 15:36:02 +0000 (15:36 +0000)]
gn build: Add check-clangd target after r3359424

r359527 already merged some of that to the GN build,
but it was missing some bits as well.

The check-clangd target works (at least for now) differently than all
the other check-foo targets, see https://reviews.llvm.org/D61187

For that reason, there's no gni file and the generated lit configs are
not (yet?) added to llvm-lit/BUILD.gn.

llvm-svn: 359570

5 years agoAdd llvm-profdata to LLVM_TOOLCHAIN_TOOLS
Russell Gallop [Tue, 30 Apr 2019 15:35:16 +0000 (15:35 +0000)]
Add llvm-profdata to LLVM_TOOLCHAIN_TOOLS

This is required for using PGO on Windows but isn't in the Windows
release packages. Windows packages are built with
LLVM_INSTALL_TOOLCHAIN_ONLY so only includes llvm "tools" listed here.

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

llvm-svn: 359569