platform/upstream/llvm.git
5 years ago[PowerPC] add test that could infinite loop with reordered transforms; NFC
Sanjay Patel [Wed, 1 May 2019 17:34:30 +0000 (17:34 +0000)]
[PowerPC] add test that could infinite loop with reordered transforms; NFC

This is a slightly reduced version of the test from D61384.
Adding this as a preliminary step, so I can update D61149 with
the proposed fix.

llvm-svn: 359709

5 years ago[sanitizer] Implement reallocarray.
Evgeniy Stepanov [Wed, 1 May 2019 17:33:01 +0000 (17:33 +0000)]
[sanitizer] Implement reallocarray.

Summary:
It's a cross of calloc and realloc. Sanitizers implement calloc-like check for size
overflow.

Reviewers: vitalybuka, kcc

Subscribers: kubamracek, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 359708

5 years ago[X86][SSE] Fold scalar horizontal add/sub for non-0/1 element extractions
Simon Pilgrim [Wed, 1 May 2019 17:13:35 +0000 (17:13 +0000)]
[X86][SSE] Fold scalar horizontal add/sub for non-0/1 element extractions

We already perform horizontal add/sub if we extract from elements 0 and 1, this patch extends it to non-0/1 element extraction indices (as long as they are from the lowest 128-bit vector).

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

llvm-svn: 359707

5 years ago[Driver] Explicitly request platform rtlib in the Driver pic test
Petr Hosek [Wed, 1 May 2019 16:52:45 +0000 (16:52 +0000)]
[Driver] Explicitly request platform rtlib in the Driver pic test

This test checks whether crtbegin.o and crtend.o appear on the link
line, but names of these files may be affected by the choice of the
rtlib, specifically when compiler-rt is used as the default rtlib
the names will be clang_rt.crtbegin.o and clang_rt.crtend.o instead
of crtbeginS.o and crtendS.o. To avoid the test failure, explicitly
request to use the platform rtlib.

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

llvm-svn: 359706

5 years ago[globalisel] Update the legalizer documentation
Daniel Sanders [Wed, 1 May 2019 16:52:29 +0000 (16:52 +0000)]
[globalisel] Update the legalizer documentation

Summary:
* The getActionDefinitionsBuilder() is now documented.
  * Includes descriptions of the various actions (legal*, widenScalar*, lower*,
    etc).
  * Includes descriptions of the various predicates (*If, *For,
    *ForCartesianProduct, etc.)
  * Includes the rule-order details
* Removed the out-of-date prohibition on non-power-of-2 types.
* Removed the Vector types section since it was incorrect and vectors follow the
  same ruleset as scalars. They're only special in the sense that more of the
  actions and predicates are meaningful for them (e.g. moreElements).
* Clarified the position on context sensitive legality (which is not permitted)
  and contrasted this with context sensitive legalization (which is permitted).

Reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, arsenm

Reviewed By: paquette

Subscribers: wdng, rovka, kristof.beyls, jfb, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 359705

5 years ago[AMDGPU] gfx1010 GCNRegBankReassign pass
Stanislav Mekhanoshin [Wed, 1 May 2019 16:49:31 +0000 (16:49 +0000)]
[AMDGPU] gfx1010 GCNRegBankReassign pass

Reassign registers to reduce register bank conflicts.

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

llvm-svn: 359704

5 years ago[WebAssembly] WASI support for libcxx
Dan Gohman [Wed, 1 May 2019 16:47:30 +0000 (16:47 +0000)]
[WebAssembly] WASI support for libcxx

This adds explicit support for the WASI platform to libcxx.

WASI libc uses some components from musl, however it's not fully compatible
with musl, so we're planning to stop using _LIBCPP_HAS_MUSL_LIBC and
customize for WASI libc specifically.

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

Reviewers: sbc100, ldionne
llvm-svn: 359703

5 years agoBump DIAG_SIZE_SEMA, as we've hit it.
Scott Linder [Wed, 1 May 2019 16:45:49 +0000 (16:45 +0000)]
Bump DIAG_SIZE_SEMA, as we've hit it.

$ grep 'DIAG_SIZE_SEMA          =' include/clang/Basic/DiagnosticIDs.h
      DIAG_SIZE_SEMA          = 4000,
$ grep DIAG $(build)/tools/clang/include/clang/Basic/DiagnosticSemaKinds.inc | wc -l
3499

llvm-svn: 359702

5 years agoOption spell checking: Penalize delimiter flags if input has no argument
Nico Weber [Wed, 1 May 2019 16:45:15 +0000 (16:45 +0000)]
Option spell checking: Penalize delimiter flags if input has no argument

If the user passes a flag like `-version` to a program, it's more likely
they mean `--version` than `-version:`, since there's no parameter
passed. Hence, give delimited arguments a penalty of 1 if the user input
doesn't contain the delimiter or no data after it.

The motivation is that with this, lld-link can suggest "--version"
instead of "-version:" for "-version" and "-nodefaultlib" instead of
"-nodefaultlib:" for "-nodefaultlibs".

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

llvm-svn: 359701

5 years ago[AMDGPU] gfx1010 GCNNSAReassign pass
Stanislav Mekhanoshin [Wed, 1 May 2019 16:40:49 +0000 (16:40 +0000)]
[AMDGPU] gfx1010 GCNNSAReassign pass

Convert NSA into non-NSA images.

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

llvm-svn: 359700

5 years agoDisabling test in TestClassTemplateParameterPack.py until we do template lookup correctly
Shafik Yaghmour [Wed, 1 May 2019 16:39:31 +0000 (16:39 +0000)]
Disabling test in TestClassTemplateParameterPack.py until we do template lookup correctly

Summary:
Some tests currently only work because we are pulling all the local variables when we are evaluating an expression. This will soon
change and these test are working but for the wrong reasons. The details can be found in the discussion here:
http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180507/040689.html

Differential Review:  https://reviews.llvm.org/D61266

llvm-svn: 359699

5 years ago[AMDGPU] gfx1010 MIMG implementation
Stanislav Mekhanoshin [Wed, 1 May 2019 16:32:58 +0000 (16:32 +0000)]
[AMDGPU] gfx1010 MIMG implementation

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

llvm-svn: 359698

5 years ago[ThinLTO] Fix unreachable code when parsing summary entries.
Teresa Johnson [Wed, 1 May 2019 16:26:59 +0000 (16:26 +0000)]
[ThinLTO] Fix unreachable code when parsing summary entries.

Summary:
Early returns were causing some code to be skipped. This was missed
since the summary entries are typically at the end of the llvm assembly
file.

Fixes PR41663.

Reviewers: RKSimon, wristow

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 359697

5 years ago[AMDGPU] gfx1010 DS implementation
Stanislav Mekhanoshin [Wed, 1 May 2019 16:11:11 +0000 (16:11 +0000)]
[AMDGPU] gfx1010 DS implementation

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

llvm-svn: 359696

5 years agoRevert "[DAGCombiner] try repeated fdiv divisor transform before building estimate"
Sanjay Patel [Wed, 1 May 2019 16:06:21 +0000 (16:06 +0000)]
Revert "[DAGCombiner] try repeated fdiv divisor transform before building estimate"

This reverts commit fb9a5307a94e6f1f850e4d89f79103b123f16279 (rL359398)
because it can cause an infinite loop due to opposing combines.

llvm-svn: 359695

5 years agoFix 80 column violation. NFCI.
Simon Pilgrim [Wed, 1 May 2019 16:01:49 +0000 (16:01 +0000)]
Fix 80 column violation. NFCI.

llvm-svn: 359694

5 years ago[SCEV] Use isKnownViaNonRecursiveReasoning for smax simplification
Keno Fischer [Wed, 1 May 2019 15:58:24 +0000 (15:58 +0000)]
[SCEV] Use isKnownViaNonRecursiveReasoning for smax simplification

Summary:
Commit
rL331949: SCEV] Do not use induction in isKnownPredicate for simplification umax

changed the codepath for umax from isKnownPredicate to
isKnownViaNonRecursiveReasoning to avoid compile time blow up (and as
I found out also stack overflows). However, there is an exact copy of
the code for umax that was lacking this change. In D50167 I want to unify
these codepaths, but to avoid that being a behavior change for the smax
case, pull this independent bit out of it.

Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D61166

llvm-svn: 359693

5 years ago[analyzer][tests][NFC] Add EOF newlines, normalize reference expected files
Hubert Tong [Wed, 1 May 2019 15:57:00 +0000 (15:57 +0000)]
[analyzer][tests][NFC] Add EOF newlines, normalize reference expected files

Reference expected files not ending with a newline are normalized to
have said newlines. Additionally `plist-macros-with-expansion.cpp.plist`
is modified to add a line that is ignored by `%diff_plist`, but not by
the more sensitive pattern proposed by
http://lists.llvm.org/pipermail/cfe-dev/2019-April/061904.html for
`%normalize_plist`.

llvm-svn: 359692

5 years ago[analyzer][tests] Use diff_plist, correct order of arguments for missed cases; NFC
Hubert Tong [Wed, 1 May 2019 15:53:56 +0000 (15:53 +0000)]
[analyzer][tests] Use diff_plist, correct order of arguments for missed cases; NFC

For various files under `clang/test/Analysis`, D52036 applied
`%diff_plist` to replace `diff` invocations with certain options and
D56340 swapped the order of the arguments so that the reference file
comes first. The tests that used `tail` to filter the test output were
not modified accordingly. This patch applies the corresponding update
to those tests.

llvm-svn: 359691

5 years ago[lit][tests][AIX] Update expected form of diagnostic messages; use `not` to normalize...
Hubert Tong [Wed, 1 May 2019 15:47:16 +0000 (15:47 +0000)]
[lit][tests][AIX] Update expected form of diagnostic messages; use `not` to normalize non-zero exit values

Summary:
Various tests in the `lit` testing suite expect specific return codes
and forms of diagnostic message from utility programs. As per
POSIX.1-2017 XCU Section 1.4, Utility Description Defaults, "[the]
format of diagnostic messages for most utilities is unspecified".
The STDERR subsections of the `cat` and `wc` utilities merely indicate
that "[the] standard error shall be used only for diagnostic messages".
The corresponding EXIT STATUS subsections merely indicate, with regard
to errors, an exit value of >0.

The affected tests are updated to accept the applicable diagnostic
message as produced by the utilities on AIX. The exit value is
normalized using `not` as necessary.

Reviewers: xingxue, sfertile, jasonliu

Reviewed By: xingxue

Subscribers: delcypher, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 359690

5 years ago[tests] Add host-byteorder-*-endian; update XFAILs of big-endian triples
Hubert Tong [Wed, 1 May 2019 15:36:18 +0000 (15:36 +0000)]
[tests] Add host-byteorder-*-endian; update XFAILs of big-endian triples

Summary:
Triple components in `XFAIL` lines are tested against the target triple.
Various tests that are expected to fail on big-endian hosts are marked
as being `XFAIL` for big-endian targets. This patch corrects these tests
by having them test against a new `host-byteorder-big-endian` feature.

Reviewers: xingxue, sfertile, jasonliu

Reviewed By: xingxue

Subscribers: jvesely, nhaehnle, fedor.sergeev, llvm-commits

Tags: #llvm

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

llvm-svn: 359689

5 years ago[llvm-ar][llvm-nm][llvm-size] Change -long-option to --long-option in tests. NFC
Fangrui Song [Wed, 1 May 2019 15:31:15 +0000 (15:31 +0000)]
[llvm-ar][llvm-nm][llvm-size] Change -long-option to --long-option in tests. NFC

llvm-svn: 359688

5 years ago[clang-format] Fix bug that misses some function-like macro usages
Owen Pan [Wed, 1 May 2019 15:03:41 +0000 (15:03 +0000)]
[clang-format] Fix bug that misses some function-like macro usages

Fixes PR41483

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

llvm-svn: 359687

5 years ago[X86][SSE] Add demanded elts support X86ISD::PMULDQ\PMULUDQ
Simon Pilgrim [Wed, 1 May 2019 14:50:50 +0000 (14:50 +0000)]
[X86][SSE] Add demanded elts support X86ISD::PMULDQ\PMULUDQ

Add to SimplifyDemandedVectorEltsForTargetNode and SimplifyDemandedBitsForTargetNode

llvm-svn: 359686

5 years agoFix OptTable::findNearest() adding delimiter for free
Nico Weber [Wed, 1 May 2019 14:46:17 +0000 (14:46 +0000)]
Fix OptTable::findNearest() adding delimiter for free

Prior to this, OptTable::findNearest() thought that the input `--foo`
had an editing distance of 0 from an existing flag `--foo=`, which made
it suggest flags with delimiters more often than flags without one.
After this, it correctly assigns this case an editing distance of 1.

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

llvm-svn: 359685

5 years ago[LoopInfo] Faster implementation of setLoopID. NFC.
Keno Fischer [Wed, 1 May 2019 14:39:11 +0000 (14:39 +0000)]
[LoopInfo] Faster implementation of setLoopID. NFC.

Summary:
This change was part of D46460. However, in the meantime rL341926 fixed the
correctness issue here. What remained was the performance issue in setLoopID
where it would iterate through all blocks in the loop and their successors,
rather than just the predecessor of the header (the later presumably being
much faster). We already have the `getLoopLatches` to compute precisely these
basic blocks in an efficient manner, so just use it (as the original commit
did for `getLoopID`).

Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D61215

llvm-svn: 359684

5 years ago[LLD] Emit dynamic relocations for references to script symbols in -pie links
Ben Dunbobbin [Wed, 1 May 2019 14:07:31 +0000 (14:07 +0000)]
[LLD] Emit dynamic relocations for references to script symbols in -pie links

https://reviews.llvm.org/D55423 caused LLD to stop emitting dynamic relocations for references to script symbols in -pie links.

This patch fixes that regression.

https://reviews.llvm.org/D61298

llvm-svn: 359683

5 years ago[lldb] [lit] Add write tests for r8-r15 & xmm8-xmm15 registers
Michal Gorny [Wed, 1 May 2019 13:55:23 +0000 (13:55 +0000)]
[lldb] [lit] Add write tests for r8-r15 & xmm8-xmm15 registers

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

llvm-svn: 359682

5 years ago[lldb] [lit] Add write tests for MM/XMM registers
Michal Gorny [Wed, 1 May 2019 13:55:13 +0000 (13:55 +0000)]
[lldb] [lit] Add write tests for MM/XMM registers

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

llvm-svn: 359681

5 years ago[X86][SSE] Add SSE vector shift support to SimplifyDemandedVectorEltsForTargetNode...
Simon Pilgrim [Wed, 1 May 2019 13:51:09 +0000 (13:51 +0000)]
[X86][SSE] Add SSE vector shift support to SimplifyDemandedVectorEltsForTargetNode vector splitting

llvm-svn: 359680

5 years agoWrap to 80 columns, no behavior change
Nico Weber [Wed, 1 May 2019 13:04:44 +0000 (13:04 +0000)]
Wrap to 80 columns, no behavior change

llvm-svn: 359679

5 years ago[X86][SSE] Split 512-bit -> 128-bit vector directly in SimplifyDemandedVectorEltsForT...
Simon Pilgrim [Wed, 1 May 2019 12:48:42 +0000 (12:48 +0000)]
[X86][SSE] Split 512-bit -> 128-bit vector directly in SimplifyDemandedVectorEltsForTargetNode

llvm-svn: 359678

5 years ago[X86][SSE] Add 512-bit vector support to SimplifyDemandedVectorEltsForTargetNode...
Simon Pilgrim [Wed, 1 May 2019 12:37:41 +0000 (12:37 +0000)]
[X86][SSE] Add 512-bit vector support to SimplifyDemandedVectorEltsForTargetNode vector splitting

llvm-svn: 359677

5 years agoDAG: allow DAG pointer size different from memory representation.
Tim Northover [Wed, 1 May 2019 12:37:30 +0000 (12:37 +0000)]
DAG: allow DAG pointer size different from memory representation.

In preparation for supporting ILP32 on AArch64, this modifies the SelectionDAG
builder code so that pointers are allowed to have a larger type when "live" in
the DAG compared to memory.

Pointers get zero-extended whenever they are loaded, and truncated prior to
stores.  In addition, a few not quite so obvious locations need updating:

  * A GEP that has not been marked inbounds needs to enforce the IR-documented
    2s-complement wrapping at the memory pointer size. Inbounds GEPs are
    undefined if they overflow the address space, so no additional operations
    are needed.
  * Signed comparisons would give incorrect results if performed on the
    zero-extended values.

This shouldn't affect CodeGen for now, but will become active when the AArch64
ILP32 support is committed.

llvm-svn: 359676

5 years ago[libFuzzer] Add --dump-input-on-failure to help diagnose AArch64 failures
Peter Smith [Wed, 1 May 2019 12:30:04 +0000 (12:30 +0000)]
[libFuzzer] Add --dump-input-on-failure to help diagnose AArch64 failures

The fork-siguser.test and fork.test intermittently fail on the AArch64
buildbot. Unfortunately these failures are not reproducible on a similar
machine and seem to fail when the machines are under load. Before
suggesting the tests be marked unsupported for AArch64 we'd like to see
if we can get some more information about the failures to see if it helps
us reproduce. This patch adds --dump-input-on-failure to the FileCheck
commands to see if we can get some more information about the failures.

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

llvm-svn: 359675

5 years ago[clangd] Delete an unused declaration
Fangrui Song [Wed, 1 May 2019 12:16:37 +0000 (12:16 +0000)]
[clangd] Delete an unused declaration

llvm-svn: 359674

5 years ago[X86][SSE] Add X86ISD::PACKSS\PACKUS to SimplifyDemandedVectorEltsForTargetNode vecto...
Simon Pilgrim [Wed, 1 May 2019 11:29:36 +0000 (11:29 +0000)]
[X86][SSE] Add X86ISD::PACKSS\PACKUS to SimplifyDemandedVectorEltsForTargetNode vector splitting

llvm-svn: 359673

5 years agoGet rid of a bunch of 'unused variable' warnings in test when run with debug_level...
Marshall Clow [Wed, 1 May 2019 11:25:58 +0000 (11:25 +0000)]
Get rid of a bunch of 'unused variable' warnings in test when run with debug_level set. NFC

llvm-svn: 359672

5 years ago[X86][SSE] Add scalar horizontal add/sub tests for element extractions from upper...
Simon Pilgrim [Wed, 1 May 2019 11:17:11 +0000 (11:17 +0000)]
[X86][SSE] Add scalar horizontal add/sub tests for element extractions from upper lanes

As suggested on D61263

llvm-svn: 359671

5 years ago[X86][SSE] Add X86ISD::UNPCKL\UNPCK to SimplifyDemandedVectorEltsForTargetNode vector...
Simon Pilgrim [Wed, 1 May 2019 11:08:03 +0000 (11:08 +0000)]
[X86][SSE] Add X86ISD::UNPCKL\UNPCK to SimplifyDemandedVectorEltsForTargetNode vector splitting

llvm-svn: 359670

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