platform/upstream/llvm.git
5 years ago[AArch64][SVE2] Add SVE2 target features to backend and TargetParser
Cullen Rhodes [Mon, 13 May 2019 10:10:24 +0000 (10:10 +0000)]
[AArch64][SVE2] Add SVE2 target features to backend and TargetParser

Summary:
This patch adds the following features defined by Arm SVE2 architecture
extension:

  sve2, sve2-aes, sve2-sm4, sve2-sha3, bitperm

For existing CPUs these features are declared as unsupported to prevent
scheduler errors.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewers: SjoerdMeijer, sdesmalen, ostannard, rovka

Reviewed By: SjoerdMeijer, rovka

Subscribers: rovka, javed.absar, tschuett, kristof.beyls, kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 360573

5 years ago[ASTImporter] Separate unittest files
Gabor Marton [Mon, 13 May 2019 10:06:25 +0000 (10:06 +0000)]
[ASTImporter] Separate unittest files

Summary:
Move generic redecl chain tests and visibility tests into their own
separate test files.

Reviewers: a_sidorin, a.sidorin, shafik

Subscribers: mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 360572

5 years agoFix flakiness in lldb lit test
Stefan Granitz [Mon, 13 May 2019 09:48:26 +0000 (09:48 +0000)]
Fix flakiness in lldb lit test

Messages "breakpoint locations added" and "process stopped" may come out of order.

Differential Revision: https://reviews.llvm.org/D61611#anchor-1499662

llvm-svn: 360571

5 years ago[SystemZ] Model floating-point control register
Ulrich Weigand [Mon, 13 May 2019 09:47:26 +0000 (09:47 +0000)]
[SystemZ] Model floating-point control register

This adds the FPC (floating-point control register) as a reserved
physical register and models its use by SystemZ instructions.

Note that only the current rounding modes and the IEEE exception
masks are modeled.  *Changes* of the FPC due to exceptions (in
particular the IEEE exception flags and the DXC) are not modeled.

At this point, this patch is mostly NFC, but it will prevent
scheduling of floating-point instructions across SPFC/LFPC etc.

llvm-svn: 360570

5 years ago[NativePDB] Support member function types in PdbAstBuilder
Aleksandr Urakov [Mon, 13 May 2019 09:41:57 +0000 (09:41 +0000)]
[NativePDB] Support member function types in PdbAstBuilder

    Summary:
    This patch implements missing case in PdbAstBuilder::CreateType for
    LF_MFUNCTION. This is necessary, for example, in stack unwinding of struct
    methods.

    Reviewers: amccarth, aleksandr.urakov

    Reviewed By: amccarth

    Subscribers: abidh, teemperor, lldb-commits, leonid.mashinskiy

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

llvm-svn: 360569

5 years agominidump: Use yaml instead of checked-in binaries for ThreadList tests
Pavel Labath [Mon, 13 May 2019 09:35:00 +0000 (09:35 +0000)]
minidump: Use yaml instead of checked-in binaries for ThreadList tests

yaml2obj now supports the ThreadList stream.

llvm-svn: 360568

5 years ago[ARM][ParallelDSP] Relax alias checks
Sam Parker [Mon, 13 May 2019 09:23:32 +0000 (09:23 +0000)]
[ARM][ParallelDSP] Relax alias checks

When deciding the safety of generating smlad, we checked for any
writes within the block that may alias with any of the loads that
need to be widened. This is overly conservative because it only
matters when there's a potential aliasing write to a location
accessed by a pair of loads.

Now we check for aliasing writes only once, during setup. If two
loads are found to have an aliasing write between them, we don't add
these loads to LoadPairs. This means that later during the transform,
we can safely widened a pair without worrying about aliasing.

However, to maintain correctness, we also need to change the way that
wide loads are inserted because the order is now important.

The MatchSMLAD method has also been changed, absorbing
MatchReductions and AddMACCandidate to hopefully improve readability.

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

llvm-svn: 360567

5 years ago[DAGCombiner] Fix invalid alias analysis.
Clement Courbet [Mon, 13 May 2019 09:07:37 +0000 (09:07 +0000)]
[DAGCombiner] Fix invalid alias analysis.

Summary:
When we know for sure whether two addresses do or do not alias, we
should immediately return from DAGCombiner::isAlias().

I think this comes from a bad copy/paste, Sorry for not catching that during the
code review.

Fixes PR41855.

Reviewers: niravd, gchatelet, EricWF

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360566

5 years ago[DWARF] Use sequential integers for the IDs of the SymbolFileDWOs
Pavel Labath [Mon, 13 May 2019 08:58:34 +0000 (08:58 +0000)]
[DWARF] Use sequential integers for the IDs of the SymbolFileDWOs

Summary:
Instead of using the offset of the contained compile unit, we use it's
ID. The goal of this change is two-fold:
- free up space in the user_id_t representation to enable storing the
  debug-info-carrying section (debug_types/debug_info) without
  decreasing the amount of debug info we can address (as would be the
  case with D61503).
- be a step towards supporting DWO files containing more than one unit
  (important for debug_types+dwo, but can also happen with regular
  dwo+lto). For this part to fully work we'd still need to add a way to
  lookup the SymbolFileDWO without going through GetCompileUnitAtIndex,
  but making sure things don't accidentally work because the SymbolFile
  ID is the same as compile unit offset is a step towards that.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: mehdi_amini, dexonsmith, tberghammer, jankratochvil, lldb-commits

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

llvm-svn: 360565

5 years ago@skipIfLinux flaky lldb-mi tests
Pavel Labath [Mon, 13 May 2019 08:48:03 +0000 (08:48 +0000)]
@skipIfLinux flaky lldb-mi tests

llvm-svn: 360564

5 years agoPR41845: Detect and reject mismatched inner/outer pack expansion sizes
Richard Smith [Mon, 13 May 2019 08:31:14 +0000 (08:31 +0000)]
PR41845: Detect and reject mismatched inner/outer pack expansion sizes
in fold expressions rather than crashing.

llvm-svn: 360563

5 years agoRemove declaratons of deleted structs/classes
Fangrui Song [Mon, 13 May 2019 08:25:53 +0000 (08:25 +0000)]
Remove declaratons of deleted structs/classes

llvm-svn: 360562

5 years ago[DAGCombiner][NFC] Commit test to show fix in D61846.
Clement Courbet [Mon, 13 May 2019 08:15:34 +0000 (08:15 +0000)]
[DAGCombiner][NFC] Commit test to show fix in D61846.

llvm-svn: 360561

5 years agoPR41854: Don't assert when constant-evaluating a member function call on an invalid...
Richard Smith [Mon, 13 May 2019 07:51:29 +0000 (07:51 +0000)]
PR41854: Don't assert when constant-evaluating a member function call on an invalid designator.

llvm-svn: 360560

5 years ago[c++20] P1064R0: Allow virtual function calls in constant expression
Richard Smith [Mon, 13 May 2019 07:42:10 +0000 (07:42 +0000)]
[c++20] P1064R0: Allow virtual function calls in constant expression
evaluation.

llvm-svn: 360559

5 years ago[WebAssembly] Add dependency on WebAssemblyDesc to fix BUILD_SHARED_LIBS=on builds...
Fangrui Song [Mon, 13 May 2019 05:51:39 +0000 (05:51 +0000)]
[WebAssembly] Add dependency on WebAssemblyDesc to fix BUILD_SHARED_LIBS=on builds after rL360550

This fixes the link error

ld.lld: error: undefined symbol: llvm::WebAssembly::anyTypeToString(unsigned int)
>>> referenced by WebAssemblyDisassembler.cpp

llvm-svn: 360558

5 years ago[CMake] Add lli to LLDB_TEST_DEPS
Fangrui Song [Mon, 13 May 2019 05:05:46 +0000 (05:05 +0000)]
[CMake] Add lli to LLDB_TEST_DEPS

lli is used by lit/Breakpoint/jitbp_elf.test
I had a test failure when running check-lldb-lit because my lli was stale.

llvm-svn: 360557

5 years ago[BPF] emit BTF sections only if debuginfo available
Yonghong Song [Mon, 13 May 2019 05:00:23 +0000 (05:00 +0000)]
[BPF] emit BTF sections only if debuginfo available

Currently, without -g, BTF sections may still be emitted with
data sections, e.g., for linux kernel bpf selftest
test_tcp_check_syncookie_kern.c issue discovered by Martin
as shown below.

-bash-4.4$ bpftool btf dump file test_tcp_check_syncookie_kern.o
[1] VAR 'results' type_id=0, linkage=global-alloc
[2] VAR '_license' type_id=0, linkage=global-alloc
[3] DATASEC 'license' size=0 vlen=1
        type_id=2 offset=0 size=4
[4] DATASEC 'maps' size=0 vlen=1
        type_id=1 offset=0 size=28

Let disable BTF generation if no debuginfo, which is
the original design.

Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D61826

llvm-svn: 360556

5 years ago[JITLink] Track section alignment and make sure it is respected during layout.
Lang Hames [Mon, 13 May 2019 04:51:31 +0000 (04:51 +0000)]
[JITLink] Track section alignment and make sure it is respected during layout.

Previously we had only honored alignments on individual atoms, but
tools/runtimes may assume that the section alignment is respected too.

llvm-svn: 360555

5 years agoFix file names in file headers. NFC
Fangrui Song [Mon, 13 May 2019 04:42:32 +0000 (04:42 +0000)]
Fix file names in file headers. NFC

llvm-svn: 360554

5 years agogn build: support host build on ppc64 (a.k.a. powerpc64le)
David L. Jones [Mon, 13 May 2019 04:07:54 +0000 (04:07 +0000)]
gn build: support host build on ppc64 (a.k.a. powerpc64le)

llvm-svn: 360553

5 years agoRecommit r358887 "[TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast...
Craig Topper [Mon, 13 May 2019 04:03:35 +0000 (04:03 +0000)]
Recommit r358887 "[TargetLowering][AMDGPU][X86] Improve SimplifyDemandedBits bitcast handling"

I've included a new fix in X86RegisterInfo to prevent PR41619 without
reintroducing r359392. We might be able to improve that in the base class
implementation of shouldRewriteCopySrc somehow. But this hopefully enables
forward progress on SimplifyDemandedBits improvements for now.

Original commit message:

This patch adds support for BigBitWidth -> SmallBitWidth bitcasts, splitting the DemandedBits/Elts accordingly.

The AMDGPU backend needed an extra  (srl (and x, c1 << c2), c2) -> (and (srl(x, c2), c1) combine to encourage BFE creation, I investigated putting this in DAGComb
but it caused a lot of noise on other targets - some improvements, some regressions.

The X86 changes are all definite wins.

llvm-svn: 360552

5 years agogn build: merge r360550
David L. Jones [Mon, 13 May 2019 03:43:25 +0000 (03:43 +0000)]
gn build: merge r360550

llvm-svn: 360551

5 years ago[WebAssembly] Move InstPrinter files to MCTargetDesc. NFC
David L. Jones [Mon, 13 May 2019 03:32:41 +0000 (03:32 +0000)]
[WebAssembly] Move InstPrinter files to MCTargetDesc. NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc. Merging them together will fix this. For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360550

5 years agogn build: Merge r360540
Nico Weber [Sun, 12 May 2019 23:47:03 +0000 (23:47 +0000)]
gn build: Merge r360540

llvm-svn: 360549

5 years agoFix test to use -cc1.
Leonard Chan [Sun, 12 May 2019 22:44:46 +0000 (22:44 +0000)]
Fix test to use -cc1.

llvm-svn: 360548

5 years ago[JITLink] Add a test for zero-filled content.
Lang Hames [Sun, 12 May 2019 22:26:33 +0000 (22:26 +0000)]
[JITLink] Add a test for zero-filled content.

Also updates RuntimeDyldChecker and llvm-rtdyld to support zero-fill tests by
returning a content address of zero (but no error) for zero-fill atoms, and
treating loads from zero as returning zero.

llvm-svn: 360547

5 years ago[ORC] Fix some typos.
Lang Hames [Sun, 12 May 2019 22:26:32 +0000 (22:26 +0000)]
[ORC] Fix some typos.

Patch by Praveen Velliengiri. Thanks Praveen!

https://reviews.llvm.org/D61793

llvm-svn: 360546

5 years ago[clang] Regenerate AST matcher docs 📖
Stephane Moore [Sun, 12 May 2019 21:52:19 +0000 (21:52 +0000)]
[clang] Regenerate AST matcher docs ðŸ“–

Summary:
The documentation seems to have been manually edited in https://reviews.llvm.org/rGa282bde69e375985edd4c371b79864f617380ad5.

This commit regenerates the documentation and commits the resulting diff.

Reviewers: benhamilton, mwyman

Reviewed By: mwyman

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 360545

5 years agoFix for P41852 where builtin attributes were being caught by FindLocsWithCommonFileID().
Leonard Chan [Sun, 12 May 2019 21:50:01 +0000 (21:50 +0000)]
Fix for P41852 where builtin attributes were being caught by FindLocsWithCommonFileID().

llvm-svn: 360544

5 years ago[X86][AVX] Split VZEXT_MOVL ymm/zmm if the upper elements are not demanded.
Simon Pilgrim [Sun, 12 May 2019 15:16:29 +0000 (15:16 +0000)]
[X86][AVX] Split VZEXT_MOVL ymm/zmm if the upper elements are not demanded.

Removes unnecessary vzeroupper noted in D61806

llvm-svn: 360543

5 years ago[LoopVectorizer] add tests for FP minmax; NFC
Sanjay Patel [Sun, 12 May 2019 14:53:59 +0000 (14:53 +0000)]
[LoopVectorizer] add tests for FP minmax; NFC

llvm-svn: 360542

5 years ago[DAGCombiner] try to move bitcast after extract_subvector
Sanjay Patel [Sun, 12 May 2019 14:43:20 +0000 (14:43 +0000)]
[DAGCombiner] try to move bitcast after extract_subvector

I noticed that we were failing to narrow an x86 ymm math op in a case similar
to the 'madd' test diff. That is because a bitcast is sitting between the math
and the extract subvector and thwarting our pattern matching for narrowing:

       t56: v8i32 = add t59, t58
      t68: v4i64 = bitcast t56
    t73: v2i64 = extract_subvector t68, Constant:i64<2>
  t96: v4i32 = bitcast t73

There are a few wins and neutral diffs in the other tests.

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

llvm-svn: 360541

5 years ago[clang-tidy] new check: bugprone-unhandled-self-assignment
Tamas Zolnai [Sun, 12 May 2019 12:23:56 +0000 (12:23 +0000)]
[clang-tidy] new check: bugprone-unhandled-self-assignment

Summary:
This check searches for copy assignment operators which might not handle self-assignment properly. There are three patterns of
handling a self assignment situation: self check, copy-and-swap or the less common copy-and-move. The new check warns if none of
these patterns is found in a user defined implementation.

See also:
OOP54-CPP. Gracefully handle self-copy assignment
https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP54-CPP.+Gracefully+handle+self-copy+assignment

Reviewers: JonasToth, alexfh, hokein, aaron.ballman

Subscribers: riccibruno, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra

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

llvm-svn: 360540

5 years agomake -ftime-trace also print template arguments
Lubos Lunak [Sun, 12 May 2019 10:39:21 +0000 (10:39 +0000)]
make -ftime-trace also print template arguments

Without this, I get e.g. 'PerformPendingInstantiations' -> 'std::fill',
now I get 'std::fill<unsigned long *, int>'.

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

llvm-svn: 360539

5 years agoReject attempts to call non-static member functions on objects outside
Richard Smith [Sun, 12 May 2019 09:39:08 +0000 (09:39 +0000)]
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.

This reinstates r360499, reverted in r360531.

llvm-svn: 360538

5 years agoFix handling of objects under construction during constant expression
Richard Smith [Sun, 12 May 2019 08:57:59 +0000 (08:57 +0000)]
Fix handling of objects under construction during constant expression
evaluation.

It's not enough to just track the LValueBase that we're evaluating, we
need to also track the path to the objects whose constructors are
running.

This reinstates r360464 (reverted in r360531) with a workaround for an
MSVC bug that previously caused the Windows bots to fail.

llvm-svn: 360537

5 years ago[utils] update_test_checks.py: allow opt-8, opt-9
Fangrui Song [Sun, 12 May 2019 04:55:09 +0000 (04:55 +0000)]
[utils] update_test_checks.py: allow opt-8, opt-9

Allow using Debian's opt-8, opt-9 with update_test_checks.py

Patch by Shawn Landden!

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

llvm-svn: 360536

5 years ago[X86][SSE] SimplifyDemandedBits - call PEXTRB/PEXTRW SimplifyDemandedVectorElts as...
Simon Pilgrim [Sat, 11 May 2019 21:35:50 +0000 (21:35 +0000)]
[X86][SSE] SimplifyDemandedBits - call PEXTRB/PEXTRW SimplifyDemandedVectorElts as well.

See if we can simplify the demanded vector elts from the extraction before trying to simplify the demanded bits.

This helps us with target shuffles and hops in particular.

llvm-svn: 360535

5 years ago[DAG] Add SimplifyDemandedBits support for BITREVERSE
Simon Pilgrim [Sat, 11 May 2019 20:56:05 +0000 (20:56 +0000)]
[DAG] Add SimplifyDemandedBits support for BITREVERSE

Pulled out of D58017 while I continue to investigate the BSWAP regression on PPC

llvm-svn: 360534

5 years ago[X86] Updated shift-mask test targets for D61830
Simon Pilgrim [Sat, 11 May 2019 20:28:20 +0000 (20:28 +0000)]
[X86] Updated shift-mask test targets for D61830

llvm-svn: 360533

5 years ago[CommandLine] Add long option flag for cl::ParseCommandLineOptions . Part 5 of 5
Don Hinton [Sat, 11 May 2019 20:27:01 +0000 (20:27 +0000)]
[CommandLine] Add long option flag for cl::ParseCommandLineOptions . Part 5 of 5

Summary:
If passed, the long option flag makes the CommandLine parser
mimic the behavior or GNU getopt_long.  Short options are a single
character prefixed by a single dash, and long options are multiple
characters prefixed by a double dash.

This patch was motivated by the discussion in the following thread:
http://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Reviewed By: MaskRay

Tags: #llvm

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

llvm-svn: 360532

5 years agoRevert rL360499 and rL360464 from cfe/trunk:
Simon Pilgrim [Sat, 11 May 2019 20:21:59 +0000 (20:21 +0000)]
Revert rL360499 and rL360464 from cfe/trunk:
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.
........
Fix handling of objects under construction during constant expression
evaluation.

It's not enough to just track the LValueBase that we're evaluating, we
need to also track the path to the objects whose constructors are
running.
........
Fixes windows buildbots

llvm-svn: 360531

5 years ago[X86] Add scalar shl+lshr -> shift+mask tests (PR40758)
Simon Pilgrim [Sat, 11 May 2019 19:16:46 +0000 (19:16 +0000)]
[X86] Add scalar shl+lshr -> shift+mask tests (PR40758)

As discussed on D61068, many x86 targets can perform 2 immediate shifts quicker than a shift + mask

llvm-svn: 360530

5 years ago[X86] Add avx512f tests for boolean reduction
Simon Pilgrim [Sat, 11 May 2019 19:14:19 +0000 (19:14 +0000)]
[X86] Add avx512f tests for boolean reduction

llvm-svn: 360529

5 years ago[CostModel][X86] Add min/max reduction costs for all SSE targets
Simon Pilgrim [Sat, 11 May 2019 17:12:52 +0000 (17:12 +0000)]
[CostModel][X86] Add min/max reduction costs for all SSE targets

The original costs stopped at SSE42, I've added conservative estimates for everything down to SSE1/SSE2 and moved some of the SSE42 costs to SSE41 (really only the addition of PCMPGT makes any difference).

I've also added missing vXi8 costs (we use PHMINPOSUW for i8/i16 for scarily quick results) and 256-bit vector costs for AVX1.

llvm-svn: 360528

5 years ago[NFC] yaml2obj/yam2elf.cpp whitespace changes: dos2unix removed CRs.
Puyan Lotfi [Sat, 11 May 2019 17:03:36 +0000 (17:03 +0000)]
[NFC] yaml2obj/yam2elf.cpp whitespace changes: dos2unix removed CRs.

llvm-svn: 360527

5 years ago[X86][SSE] Add SimplifyDemandedVectorElts HADD/HSUB handling.
Simon Pilgrim [Sat, 11 May 2019 16:07:12 +0000 (16:07 +0000)]
[X86][SSE] Add SimplifyDemandedVectorElts HADD/HSUB handling.

Still missing PHADDW/PHSUBW tests because PEXTRW doesn't call SimplifyDemandedVectorElts

llvm-svn: 360526

5 years agoFixupLEAPass::fixupIncDec - non-LEA opcodes should not happen here. NFCI.
Simon Pilgrim [Sat, 11 May 2019 16:02:34 +0000 (16:02 +0000)]
FixupLEAPass::fixupIncDec - non-LEA opcodes should not happen here. NFCI.

Matches what we do in other functions and fixes scan-build warning about uninitialized NewOpcode variable.

llvm-svn: 360525

5 years ago[X86] Add CMOV_FR32X/CMOV_FR64X pseudo instructions. Use them in fast isel to fix...
Craig Topper [Sat, 11 May 2019 16:00:28 +0000 (16:00 +0000)]
[X86] Add CMOV_FR32X/CMOV_FR64X pseudo instructions. Use them in fast isel to fix a machine verifier error after adding test cases.

Fast isel picks the FR32X/FR64X register classes when lowering pseudo select, but it didn't have the right opcode to go with it.

llvm-svn: 360524

5 years ago[X86] Sink some fast isel code into the only if that uses it. NFC
Craig Topper [Sat, 11 May 2019 16:00:19 +0000 (16:00 +0000)]
[X86] Sink some fast isel code into the only if that uses it. NFC

llvm-svn: 360523

5 years ago[X86] Use TLI.getRegClassFor to simplify some more fast isel code. NFCI
Craig Topper [Sat, 11 May 2019 16:00:13 +0000 (16:00 +0000)]
[X86] Use TLI.getRegClassFor to simplify some more fast isel code. NFCI

llvm-svn: 360522

5 years ago[MC][X86] Add test cases from PR14056
Simon Pilgrim [Sat, 11 May 2019 15:51:14 +0000 (15:51 +0000)]
[MC][X86] Add test cases from PR14056

llvm-svn: 360521

5 years agoHexagonConstEvaluator::evaluateHexExt - check incoming opcodes. NFCI.
Simon Pilgrim [Sat, 11 May 2019 15:24:34 +0000 (15:24 +0000)]
HexagonConstEvaluator::evaluateHexExt - check incoming opcodes. NFCI.

Only certain extension opcodes are supported - fixes scan build warning.

llvm-svn: 360520

5 years ago[X86][SSE] Tweaked HADD/HSUB SimplifyDemandedVectorElts
Simon Pilgrim [Sat, 11 May 2019 14:47:54 +0000 (14:47 +0000)]
[X86][SSE] Tweaked HADD/HSUB SimplifyDemandedVectorElts

Try to ensure we LHS and RHS test coverage

llvm-svn: 360519

5 years ago[X86][SSE] Add integer HADD/HSUB SimplifyDemandedVectorElts tests
Simon Pilgrim [Sat, 11 May 2019 14:08:34 +0000 (14:08 +0000)]
[X86][SSE] Add integer HADD/HSUB SimplifyDemandedVectorElts tests

llvm-svn: 360518

5 years ago[X86][SSE] Add HADD/HSUB SimplifyDemandedVectorElts tests
Simon Pilgrim [Sat, 11 May 2019 12:46:38 +0000 (12:46 +0000)]
[X86][SSE] Add HADD/HSUB SimplifyDemandedVectorElts tests

Shows missed opportunities to simplify args.

Will add integer HADD/HSUB tests in a future commit.

llvm-svn: 360517

5 years agoFix uninitialized variable analyzer warning. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:08:24 +0000 (11:08 +0000)]
Fix uninitialized variable analyzer warning. NFCI.

llvm-svn: 360516

5 years agoConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:01:46 +0000 (11:01 +0000)]
ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.

Duplicate getOffset() call.

llvm-svn: 360515

5 years agoSelectionDAGISel::CodeGenAndEmitDAG - remove unused variable. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:00:37 +0000 (11:00 +0000)]
SelectionDAGISel::CodeGenAndEmitDAG - remove unused variable. NFCI.

llvm-svn: 360514

5 years ago[X86] Use getRegClassFor to simplify some code in fast isel. NFCI
Craig Topper [Sat, 11 May 2019 05:18:58 +0000 (05:18 +0000)]
[X86] Use getRegClassFor to simplify some code in fast isel. NFCI

No need to select the register class based on type and features. It should
already be setup by X86ISelLowering.

llvm-svn: 360513

5 years ago[X86] Don't emit MOVNTDQA loads from fast-isel without SSE4.1.
Craig Topper [Sat, 11 May 2019 04:19:33 +0000 (04:19 +0000)]
[X86] Don't emit MOVNTDQA loads from fast-isel without SSE4.1.

We were checking for SSE4.1 for FP types, but not integer 128-bit types.

Fixes PR41837.

llvm-svn: 360512

5 years ago[X86] Add a test case for idempotent atomic operations with speculative load hardenin...
Craig Topper [Sat, 11 May 2019 04:00:27 +0000 (04:00 +0000)]
[X86] Add a test case for idempotent atomic operations with speculative load hardening. Fix an additional issue found by the test.

This test covers the fix from r360475 as well.

llvm-svn: 360511

5 years ago[SystemZ] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 03:36:16 +0000 (03:36 +0000)]
[SystemZ] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360510

5 years ago[Breakpoint] Make breakpoint language agnostic
Alex Langford [Sat, 11 May 2019 03:32:25 +0000 (03:32 +0000)]
[Breakpoint] Make breakpoint language agnostic

Summary:
Breakpoint shouldn't need to depend on any specific details from a
programming language. Currently the only language-specific detail it takes
advantage of are the different qualified names an objective-c method name might
have when adding a name lookup. This is reasonably generalizable.

The current method name I introduced is "GetVariantMethodNames", which I'm not
particularly tied to. If you have a better suggestion, please do let me know.

Reviewers: JDevlieghere, jingham, clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 360509

5 years agogn build: sort tablegen rules for X86 and AArch64
David L. Jones [Sat, 11 May 2019 03:23:37 +0000 (03:23 +0000)]
gn build: sort tablegen rules for X86 and AArch64

llvm-svn: 360508

5 years agogn build: merge r360494 and r360502
David L. Jones [Sat, 11 May 2019 03:20:09 +0000 (03:20 +0000)]
gn build: merge r360494 and r360502

llvm-svn: 360507

5 years ago[Sparc] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:59:02 +0000 (02:59 +0000)]
[Sparc] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360506

5 years ago[RISCV] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:43:58 +0000 (02:43 +0000)]
[RISCV] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure

llvm-svn: 360505

5 years ago[compiler-rt] Fix crtbegin.c compilation
Shoaib Meenai [Sat, 11 May 2019 02:33:33 +0000 (02:33 +0000)]
[compiler-rt] Fix crtbegin.c compilation

We're building with -std=c11 now (as opposed to -std=gnu11), so we can't
use GNU extensions and need to spell inline assembly as __asm__.

llvm-svn: 360503

5 years ago[PowerPC] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:33:18 +0000 (02:33 +0000)]
[PowerPC] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360502

5 years ago[NVPTX] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:09:13 +0000 (02:09 +0000)]
[NVPTX] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360500

5 years agoReject attempts to call non-static member functions on objects outside
Richard Smith [Sat, 11 May 2019 02:00:06 +0000 (02:00 +0000)]
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.

llvm-svn: 360499

5 years ago[MSP430] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:58:52 +0000 (01:58 +0000)]
[MSP430] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360498

5 years ago[Mips] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:38:56 +0000 (01:38 +0000)]
[Mips] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360497

5 years ago[Lanai] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:25:58 +0000 (01:25 +0000)]
[Lanai] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360496

5 years ago[cc1as] Change -compress-debug-sections= to use --
Fangrui Song [Sat, 11 May 2019 01:14:50 +0000 (01:14 +0000)]
[cc1as] Change -compress-debug-sections= to use --

The double dash form is documented by GNU as, used by gcc, and accepted by llvm-mc.

llvm-svn: 360495

5 years ago[BPF] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:13:21 +0000 (01:13 +0000)]
[BPF] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360494

5 years ago[AVR] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:03:03 +0000 (01:03 +0000)]
[AVR] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360493

5 years agogn build: merge r360490
David L. Jones [Sat, 11 May 2019 00:44:30 +0000 (00:44 +0000)]
gn build: merge r360490

llvm-svn: 360492

5 years agogn build: merge r360484 and r360486
David L. Jones [Sat, 11 May 2019 00:35:53 +0000 (00:35 +0000)]
gn build: merge r360484 and r360486

llvm-svn: 360491

5 years ago[ARM] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 00:34:07 +0000 (00:34 +0000)]
[ARM] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360490

5 years agogn build: merge r360345
David L. Jones [Sat, 11 May 2019 00:20:18 +0000 (00:20 +0000)]
gn build: merge r360345

llvm-svn: 360489

5 years ago[ARC] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 00:13:01 +0000 (00:13 +0000)]
[ARC] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360488

5 years ago[AMDGPU] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 00:03:35 +0000 (00:03 +0000)]
[AMDGPU] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360487

5 years ago[AArch64] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Fri, 10 May 2019 23:50:01 +0000 (23:50 +0000)]
[AArch64] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360486

5 years ago[XCore] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Fri, 10 May 2019 23:36:49 +0000 (23:36 +0000)]
[XCore] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360485

5 years ago[X86] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Fri, 10 May 2019 23:24:38 +0000 (23:24 +0000)]
[X86] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360484

5 years ago[Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the builtins...
Amara Emerson [Fri, 10 May 2019 23:24:20 +0000 (23:24 +0000)]
[Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the builtins library.

This driver flag is useful when users want to link against the compiler's
builtins, but nothing else, and so use flags like -nostdlib.

Darwin can't use -nolibc & nostdlib++ like other platforms on because we
disable all runtime lib linking with -static, which we still want to have
an option to link with the builtins.

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

llvm-svn: 360483

5 years agoChange the disabling of packet logging to be in TearDownHook lambdas.
Jason Molenda [Fri, 10 May 2019 23:22:15 +0000 (23:22 +0000)]
Change the disabling of packet logging to be in TearDownHook lambdas.

llvm-svn: 360482

5 years agoRevert [DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor
Jordan Rupprecht [Fri, 10 May 2019 23:20:02 +0000 (23:20 +0000)]
Revert [DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor

This reverts r360171 (git commit a9d6c32eafc645c55b07eb50698c428e14c0bffd). A repro showing the asan/msan failures is forthcoming.

llvm-svn: 360481

5 years agoTed pointed out that some of test tests that are enabling packet
Jason Molenda [Fri, 10 May 2019 23:03:05 +0000 (23:03 +0000)]
Ted pointed out that some of test tests that are enabling packet
logging when the testsuite is run with trace mode enabled are leaving
the logging enabled after the tests have finished.  That state
isn't cleared in a --no-multiprocess testsuite run.

llvm-svn: 360480

5 years agoFactor out redzone ABI checks [NFCI]
Philip Reames [Fri, 10 May 2019 22:55:42 +0000 (22:55 +0000)]
Factor out redzone ABI checks [NFCI]

As requested in D58632, cleanup our red zone detection logic in the X86 backend. The existing X86MachineFunctionInfo flag is used to track whether we *use* the redzone (via a particularly optimization?), but there's no common way to check whether the function *has* a red zone.

I'd appreciate careful review of the uses being updated. I think they are NFC, but a careful eye from someone else would be appreciated.

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

llvm-svn: 360479

5 years ago[ORC] Make a narrowing-cast explicit to silence a compiler warning.
Lang Hames [Fri, 10 May 2019 22:51:03 +0000 (22:51 +0000)]
[ORC] Make a narrowing-cast explicit to silence a compiler warning.

llvm-svn: 360478

5 years ago[JITLink][MachO] Mark atoms in sections 'no-dead-strip' set live by default.
Lang Hames [Fri, 10 May 2019 22:24:37 +0000 (22:24 +0000)]
[JITLink][MachO] Mark atoms in sections 'no-dead-strip' set live by default.

If a MachO section has the no-dead-strip attribute set then its atoms should
be preserved, regardless of whether they're public or referenced elsewhere in
the object.

llvm-svn: 360477

5 years ago[COFF] Update LLD yaml test cases to include .bss size
Reid Kleckner [Fri, 10 May 2019 22:12:51 +0000 (22:12 +0000)]
[COFF] Update LLD yaml test cases to include .bss size

These yaml test cases appear to have been affected by PR41836

Right now what happens is that these empty .bss sections are merged into
.data, then the .data output section ends up having a zero virtual size,
and it is discarded from the output after addresses are assigned.
However, we've already assigned OutputSections to Chunks, so we don't
correctly report the zero-sized chunks that were in there as having been
discarded. Soon, we will report them as discarded, so these test cases
need to be updated to have a non-zero size so they aren't discarded.

llvm-svn: 360476

5 years ago[X86] Disable speculative load hardening for operations with an explicit RSP base.
Craig Topper [Fri, 10 May 2019 22:03:33 +0000 (22:03 +0000)]
[X86] Disable speculative load hardening for operations with an explicit RSP base.

After D58632, we can create idempotent atomic operations to the top of stack.
This confused speculative load hardening because it thinks accesses should have
virtual register base except for the cases it already excluded.

This commit adds a new exclusion for this case. I'll try to reduce a test case
for this, but this fix was verified to work by the reporter. This should avoid
needing to revert D58632.

llvm-svn: 360475

5 years ago[CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when
Akira Hatanaka [Fri, 10 May 2019 21:54:16 +0000 (21:54 +0000)]
[CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when
necessary.

Prior to r349952, clang used to call objc_msgSend when sending a release
messages, emitting an invoke instruction instead of a call instruction
when it was necessary to catch an exception. That changed in r349952
because runtime function objc_release is called as a nounwind function,
which broke programs that were overriding the dealloc method and
throwing an exception from it. This patch restores the behavior prior to
r349952.

rdar://problem/50253394

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

llvm-svn: 360474

5 years ago[COFF] Fix .bss section size bug in obj2yaml / yaml2obj
Reid Kleckner [Fri, 10 May 2019 21:53:44 +0000 (21:53 +0000)]
[COFF] Fix .bss section size bug in obj2yaml / yaml2obj

We need to serialize SizeOfRawData through even when there is no data,
as in a .bss section.

Fixes PR41836

llvm-svn: 360473

5 years ago[LegalizeVectorOps] Remove calls to LegalizeOp on the return value from ExpandLoad...
Craig Topper [Fri, 10 May 2019 21:42:27 +0000 (21:42 +0000)]
[LegalizeVectorOps] Remove calls to LegalizeOp on the return value from ExpandLoad/ExpandStore.

We already updated the LegalizedNodes map at the end of the Expand call. This
would have marked the new node as being mapped to itself. So the LegalizeOp
call will find that an immediately return.

llvm-svn: 360472