OSDN Git Service

android-x86/external-llvm.git
5 years ago[MinGW] Enable large file for mingw-w64
Martin Storsjo [Wed, 24 Oct 2018 12:22:12 +0000 (12:22 +0000)]
[MinGW] Enable large file for mingw-w64

64-bit mingw doesn't define _FILE_OFFSET_BITS=64 by default.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345131 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-exegesis] Implements a cache of Instruction objects.
Guillaume Chatelet [Wed, 24 Oct 2018 11:55:06 +0000 (11:55 +0000)]
[llvm-exegesis] Implements a cache of Instruction objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345130 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-mca] [llvm-mca] Improved error handling and error reporting from class InstrBui...
Andrea Di Biagio [Wed, 24 Oct 2018 10:56:47 +0000 (10:56 +0000)]
[llvm-mca] [llvm-mca] Improved error handling and error reporting from class InstrBuilder.

A new class named InstructionError has been added to Support.h in order to
improve the error reporting from class InstrBuilder.
The llvm-mca driver is responsible for handling InstructionError objects, and
printing them out to stderr.

The goal of this patch is to remove all the remaining error handling logic from
the library code.
In particular, this allows us to:
 - Simplify the logic in InstrBuilder by removing a needless dependency from
MCInstrPrinter.
 - Centralize all the error halding logic in a new function named 'runPipeline'
(see llvm-mca.cpp).

This is also a first step towards generalizing class InstrBuilder, so that in
future, we will be able to reuse its logic to also "lower" MachineInstr to
mca::Instruction objects.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345129 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Change parameter type. NFC
Eugene Leviant [Wed, 24 Oct 2018 08:59:58 +0000 (08:59 +0000)]
[ThinLTO] Change parameter type. NFC

Change destination module type for consistency with r345118

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345124 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r345114
Gil Rapaport [Wed, 24 Oct 2018 08:41:22 +0000 (08:41 +0000)]
Revert r345114

Investigating fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345123 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Defined gfx909 Raven Ridge 2
Tim Renouf [Wed, 24 Oct 2018 08:14:07 +0000 (08:14 +0000)]
[AMDGPU] Defined gfx909 Raven Ridge 2

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

Change-Id: Ie3d054f2e956c2768988c0f4c0ffd29a47294eef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345120 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Fix dot dumper for regular LTO modules
Eugene Leviant [Wed, 24 Oct 2018 07:48:32 +0000 (07:48 +0000)]
[ThinLTO] Fix dot dumper for regular LTO modules

Regular LTO module identifier is (unsigned)-1. This patch emits correct
module identifier while printing edges with source summary in regular
LTO module.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345118 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LV] Don't have fold-tail under optsize invalidate interleave-groups when
Dorit Nuzman [Wed, 24 Oct 2018 07:11:38 +0000 (07:11 +0000)]
[LV] Don't have fold-tail under optsize invalidate interleave-groups when
masked-interleaving is enabled

Enable interleave-groups under fold-tail scenario for Opt for size compilation;
D50480 added support for vectorizing loops of arbitrary trip-count without a
remiander, which in turn makes everything in the loop conditional, including
interleave-groups if any. It therefore invalidated all interleave-groups
because we didn't have support for vectorizing predicated interleaved-groups
at the time. In the meantime, D53011 introduced this support, so we don't
have to invalidate interleave-groups when masked-interleaved support is enabled.

Reviewers: Ayal, hsaito, dcaballe, fhahn

Reviewed By: hsaito

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345115 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LSR] Combine unfolded offset into invariant register
Gil Rapaport [Wed, 24 Oct 2018 07:08:38 +0000 (07:08 +0000)]
[LSR] Combine unfolded offset into invariant register

LSR reassociates constants as unfolded offsets when the constants fit as
immediate add operands, which currently prevents such constants from being
combined later with loop invariant registers.
This patch modifies GenerateCombinations() to generate a second formula which
includes the unfolded offset in the combined loop-invariant register.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345114 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Correct a bad isel predicate. Though I don't think it can be exposed.
Craig Topper [Wed, 24 Oct 2018 06:13:36 +0000 (06:13 +0000)]
[X86] Correct a bad isel predicate. Though I don't think it can be exposed.

This B/W VPTEST instructions are only available with AVX512BW. But lowering should prevent any byte or word elements from getting to isel so this can't be exposed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345112 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM64][Windows] Add unwind support to llvm-readobj
Sanjin Sijaric [Wed, 24 Oct 2018 00:03:34 +0000 (00:03 +0000)]
[ARM64][Windows] Add unwind support to llvm-readobj

This patch adds support for dumping the unwind info from ARM64 COFF object
files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345108 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoARM: handle checking aliases with out-of-bounds GEPs
Saleem Abdulrasool [Wed, 24 Oct 2018 00:00:52 +0000 (00:00 +0000)]
ARM: handle checking aliases with out-of-bounds GEPs

A global alias may use indices which are not considered in bounds.  In
such a case, accessing the base object will fail as it only peers
through inbounds accesses.  This pattern is used by the swift compiler
to create references to preceeding members in the type metadata.  This
would cause the code generation to fail when targeting a platform that
used ELF as the object file format.  Be conservative and fail the
read-only check if we run into an alias that we cannot peer through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345107 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCommit missing comment edit and use correct cast to fix std::min overload
Reid Kleckner [Tue, 23 Oct 2018 23:44:44 +0000 (23:44 +0000)]
Commit missing comment edit and use correct cast to fix std::min overload

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345105 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[hurd] Make getMainExecutable get the real binary path
Reid Kleckner [Tue, 23 Oct 2018 23:35:43 +0000 (23:35 +0000)]
[hurd] Make getMainExecutable get the real binary path

On GNU/Hurd, llvm-config is returning bogus value, such as:

$ llvm-config-6.0 --includedir
/usr/include

while it should be:
$ llvm-config-6.0 --includedir
/usr/lib/llvm-6.0/include

This is because getMainExecutable does not get the actual installation
path. On GNU/Hurd, /proc/self/exe is indeed a symlink to the path that
was used to start the program, and not the eventual binary file. Llvm's
getMainExecutable thus needs to run realpath over it to get the actual
place where llvm was installed (/usr/lib/llvm-6.0/bin/llvm-config), and
not /usr/bin/llvm-config-6.0. This will not change the result on Linux,
where /proc/self/exe already points to the eventual file.

Patch by Samuel Thibault!

While making changes here, I reformatted this block a bit to reduce
indentation and match 2 space indent style.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345104 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PM] keeping history when original SCC split and then merge into itself
Wei Mi [Tue, 23 Oct 2018 23:29:45 +0000 (23:29 +0000)]
[PM] keeping history when original SCC split and then merge into itself
in the same round of SCC update.

In https://reviews.llvm.org/rL309784, inline history is added to prevent
infinite inlining across multiple run of inliner and SCC update, but the
history will only be kept when new SCC is actually generated during SCC update.

We found a case that SCC can be split and then merge into itself in the same
round of SCC update, so the same SCC will be pop out from UR.CWorklist and
then added back immediately, without any new SCC generated, that is why the
existing patch cannot catch the infinite inline case.

What the patch does is even if no new SCC is generated, if only the current
SCC appears in UR.CWorklist again, then keep the inline history.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345103 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSelectionDAG: Reuse bigger sized constants in memset expansion.
Matthias Braun [Tue, 23 Oct 2018 23:19:23 +0000 (23:19 +0000)]
SelectionDAG: Reuse bigger sized constants in memset expansion.

When implementing memset's today we often see this pattern:
$x0 = MOV 0xXYXYXYXYXYXYXYXY
store $x0, ...
$w1 = MOV 0xXYXYXYXY
store $w1, ...

We first create a 64bit constant in a 64bit register with all bytes the
same and then create a 32bit constant with all bytes the same in a 32bit
register. In many targets we could just access the lower byte of the
64bit register instead.

- Ideally this would be handled by the ConstantHoist pass but it runs
  too early when memset isn't expanded yet.
- The memset expansion code already had this optimization implemented,
  however SelectionDAG constantfolding would constantfold the
  "trunc(bigconstnat)" pattern to "smallconstant".
- This patch makes the memset expansion mark the constant as Opaque and
  stop DAGCombiner from constant folding in this situation. (Similar to
  how ConstantHoisting marks things as Opaque to avoid folding
  ADD/SUB/etc.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345102 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.
Lang Hames [Tue, 23 Oct 2018 23:01:39 +0000 (23:01 +0000)]
[ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345098 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[ThinLTO] Fix a crash in lazy loading of Metadata"
Teresa Johnson [Tue, 23 Oct 2018 23:00:29 +0000 (23:00 +0000)]
Revert "[ThinLTO] Fix a crash in lazy loading of Metadata"

This reverts commit r345095. It was accidentally committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345097 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[hot-cold-split] Only perform splitting in ThinLTO backend post-link
Teresa Johnson [Tue, 23 Oct 2018 22:57:40 +0000 (22:57 +0000)]
[hot-cold-split] Only perform splitting in ThinLTO backend post-link

Summary:
Fix the new PM to only perform hot cold splitting once during ThinLTO,
by skipping it in the pre-link phase.

This was already fixed in the old PM by the move of the hot cold split
pass later (after the early return when PrepareForThinLTO) by r344869.

Reviewers: vsk, sebpop, hiraditya

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345096 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Fix a crash in lazy loading of Metadata
Teresa Johnson [Tue, 23 Oct 2018 22:57:21 +0000 (22:57 +0000)]
[ThinLTO] Fix a crash in lazy loading of Metadata

Summary:
This is a revised version of D41474.

When the debug location is parsed in BitcodeReader::parseFunction, the
scope and inlinedAt MDNodes are obtained via MDLoader->getMDNodeFwdRefOrNull(),
which will create a forward ref if they were not yet loaded.
Specifically, if one of these MDNodes is in the module level metadata
block, and this is during ThinLTO importing, that metadata block is
lazily loaded.

Most places in that invoke getMDNodeFwdRefOrNull have a corresponding call
to resolveForwardRefsAndPlaceholders which will take care of resolving them.
E.g. places that call getMetadataFwdRefOrLoad, or at the end of parsing a
function-level metadata block, or at the end of the initial lazy load of
module level metadata in order to handle invocations of getMDNodeFwdRefOrNull
for named metadata and global object attachments. However, the calls for
the scope/inlinedAt of debug locations are not backed by any such call to
resolveForwardRefsAndPlaceholders.

To fix this, change the scope and inlinedAt parsing to instead use
getMetadataFwdRefOrLoad, which will ensure the forward refs to lazily
loaded metadata are resolved.

Fixes PR35472.

Reviewers: dexonsmith, Sunil_Srivastava, vsk

Subscribers: inglorion, eraman, steven_wu, sebpop, mehdi_amini, dmikulin, vsk, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345095 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoActually fix test from r345085 REQUIRE: asserts
Fangrui Song [Tue, 23 Oct 2018 22:07:34 +0000 (22:07 +0000)]
Actually fix test from r345085 REQUIRE: asserts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345090 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix test after r345085
Fangrui Song [Tue, 23 Oct 2018 22:04:33 +0000 (22:04 +0000)]
Fix test after r345085

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345089 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Autogenerate comple checks. NFC
Craig Topper [Tue, 23 Oct 2018 21:58:49 +0000 (21:58 +0000)]
[X86] Autogenerate comple checks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345087 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoPrint out DebugCounter info with -print-debug-counter
Zhizhou Yang [Tue, 23 Oct 2018 21:51:56 +0000 (21:51 +0000)]
Print out DebugCounter info with -print-debug-counter

Summary:
This patch will print out {Counter, Skip, StopAfter} info of all passes which have DebugCounter set at destruction.

It can be used to monitor how many times does certain transformation happen in a pass, and also help check if -debug-counter option is set correctly.

Please refer to this [[ http://lists.llvm.org/pipermail/llvm-dev/2018-July/124722.html  | thread ]] for motivation.

Reviewers: george.burgess.iv, davide, greened

Reviewed By: greened

Subscribers: kristina, llozano, mgorny, llvm-commits, mgrang

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345085 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[dwarfdump] Make incompatibility between -diff and -verbose explicit.
Jonas Devlieghere [Tue, 23 Oct 2018 21:51:44 +0000 (21:51 +0000)]
[dwarfdump] Make incompatibility between -diff and -verbose explicit.

Using -diff and -verbose together doesn't work today. We should audit
where these two options interact and fix them. In the meantime we error
out when the user try to specify both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345084 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix typo in verifier error message
Matt Arsenault [Tue, 23 Oct 2018 21:23:52 +0000 (21:23 +0000)]
Fix typo in verifier error message

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345083 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCGP: Clear data structures at the end of a loop iteration instead of the beginning.
Peter Collingbourne [Tue, 23 Oct 2018 21:23:18 +0000 (21:23 +0000)]
CGP: Clear data structures at the end of a loop iteration instead of the beginning.

Clearing LargeOffsetGEPMap at the end fixes a bug where if a large
offset GEP is in a dead basic block, we fail an assertion when trying
to delete the block due to the asserting VH in LargeOffsetGEPMap.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345082 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Fix use-after-move clang-tidy warning
Jordan Rupprecht [Tue, 23 Oct 2018 20:54:51 +0000 (20:54 +0000)]
[llvm-objcopy] Fix use-after-move clang-tidy warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345079 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r345077 "[ORC] Change how non-exported symbols are matched during lookup."
Reid Kleckner [Tue, 23 Oct 2018 20:54:43 +0000 (20:54 +0000)]
Revert r345077 "[ORC] Change how non-exported symbols are matched during lookup."

Doesn't build on Windows. The call to 'lookup' is ambiguous. Clang and
MSVC agree, anyway.

http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/787
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): error C2668: 'llvm::orc::ExecutionSession::lookup': ambiguous call to overloaded function
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(823): note: could be 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(llvm::ArrayRef<llvm::orc::JITDylib *>,llvm::orc::SymbolStringPtr)'
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(817): note: or       'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(const llvm::orc::JITDylibSearchList &,llvm::orc::SymbolStringPtr)'
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): note: while trying to match the argument list '(initializer list, llvm::orc::SymbolStringPtr)'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345078 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Change how non-exported symbols are matched during lookup.
Lang Hames [Tue, 23 Oct 2018 20:20:22 +0000 (20:20 +0000)]
[ORC] Change how non-exported symbols are matched during lookup.

In the new scheme the client passes a list of (JITDylib&, bool) pairs, rather
than a list of JITDylibs. For each JITDylib the boolean indicates whether or not
to match against non-exported symbols (true means that they should be found,
false means that they should not). The MatchNonExportedInJD and MatchNonExported
parameters on lookup are removed.

The new scheme is more flexible, and easier to understand.

This patch also updates JITDylib search orders to be lists of (JITDylib&, bool)
pairs to match the new lookup scheme. Error handling is also plumbed through
the LLJIT class to allow regression tests to fail predictably when a lookup from
a lazy call-through fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345077 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[test-suite/doc] Add list of programs we might add.
Michael Kruse [Tue, 23 Oct 2018 19:46:29 +0000 (19:46 +0000)]
[test-suite/doc] Add list of programs we might add.

Add a list of benchmarks, applications and algorithms which are under
discussion to be added to the test-suite.

The initial list includes the the benchmarks mentioned at
https://llvm.org/PR34216, missing SPEC benchmarks, some image processing
algorithms and a few others. The bug tracker only allows adding to the
discussion, not removing, commenting, adding details to individual
benchmarks.

The first proposal was to add these benchmark into the test-suite
repository, but after a discussion, adding it to llvm/docs/Proposals
seem more appropriate. One advantage is that llvm.org will have a
browsable web page with these suggestions.

Suggested-by: Hal Finkel
Differential Revision: https://reviews.llvm.org/D46714

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345074 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[HotColdSplitting] Attach MinSize to outlined code
Vedant Kumar [Tue, 23 Oct 2018 19:41:12 +0000 (19:41 +0000)]
[HotColdSplitting] Attach MinSize to outlined code

Outlined code is cold by assumption, so it makes sense to optimize it
for minimal code size rather than performance.

After r344869 moved the splitting pass to the end of the IR pipeline,
this does not result in much of a code size reduction. This is probably
because a comparatively small number backend transforms make use of the
MinSize hint.

Running LNT on x86_64, I see that 33/1020 binaries shrink for a total of
919 bytes of TEXT reduction. I didn't measure a significant performance
impact.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345072 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Revert rL343922 combinePMULDQ AddToWorklist (PR39398)
Simon Pilgrim [Tue, 23 Oct 2018 19:07:53 +0000 (19:07 +0000)]
[X86][SSE] Revert rL343922 combinePMULDQ AddToWorklist (PR39398)

We can't add the MULDQ node back to the worklist after the demanded bits change has been committed in case the node has been removed entirely. This will have to wait until we have SimplifyDemandedBitsForTargetNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345070 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy case sensi...
Jordan Rupprecht [Tue, 23 Oct 2018 18:46:33 +0000 (18:46 +0000)]
[llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy case sensitive to support both -s (--strip-all) and -S (--strip-debug).

Summary:
GNU strip supports both `-s` and `-S` as aliases for `--strip-all` and `--strip-debug`, respectfully.

As part of this, it turns out that strip/objcopy were accepting case insensitive command line args. I'm not sure if there was an explicit reason for this. The only others uses of this are llvm-cvtres/llvm-mt/llvm-lib, which are all tools specific for windows support. Forcing case sensitivity allows both aliases to exist, but seems like a good idea anyway.

And as a surprise test case adjustment, the llvm-strip unit test was running with `-keep=unavailable_symbol`, despite `keep` not be a valid flag for strip. This is because there is a flag `-K` which, when case insensitivity is permitted, allows it to be interpreted as `-K` = `eep=unavailable_symbol` (e.g. to allow `-Kfoo` == `--keep-symbol=foo`).

Reviewers: jakehehrlich, jhenderson, alexshap

Reviewed By: jakehehrlich

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345068 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegalizeDAG] Share Vector/Scalar CTPOP Expansion
Simon Pilgrim [Tue, 23 Oct 2018 18:28:24 +0000 (18:28 +0000)]
[LegalizeDAG] Share Vector/Scalar CTPOP Expansion

As suggested on D53258, this patch move the CTPOP expansion code from SelectionDAGLegalize to TargetLowering to allow it to be reused by the VectorLegalizer.

Proper vector support will be added by D53258.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345066 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoX86DAGToDAGISel::matchBitExtract(): lambdas can't have default arguments.
Roman Lebedev [Tue, 23 Oct 2018 18:27:10 +0000 (18:27 +0000)]
X86DAGToDAGISel::matchBitExtract(): lambdas can't have default arguments.

As reported by ctopper.
That is a gcc-only warning at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345065 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegalizeDAG] Share Vector/Scalar CTLZ Expansion
Simon Pilgrim [Tue, 23 Oct 2018 17:48:30 +0000 (17:48 +0000)]
[LegalizeDAG] Share Vector/Scalar CTLZ Expansion

As suggested on D53258, this patch shares common CTLZ expansion code between VectorLegalizer and SelectionDAGLegalize by putting it in TargetLowering.

Extension to D53474

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345060 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix MSVC build by correcting placement of declspec after r345056
Daniel Sanders [Tue, 23 Oct 2018 17:41:39 +0000 (17:41 +0000)]
Fix MSVC build by correcting placement of declspec after r345056

Going by the MSVC toolchains at godbolt.org, declspec comes after the template<...>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345059 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IR] Fix -Wunused-function after r345052
Fangrui Song [Tue, 23 Oct 2018 17:24:15 +0000 (17:24 +0000)]
[IR] Fix -Wunused-function after r345052

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345057 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[tblgen] Allow FixedLenDecoderEmitter to use APInt-like objects as InsnType
Daniel Sanders [Tue, 23 Oct 2018 17:23:31 +0000 (17:23 +0000)]
[tblgen] Allow FixedLenDecoderEmitter to use APInt-like objects as InsnType

Summary:
Some targets have very long encodings and uint64_t isn't sufficient. uint128_t
isn't portable so such targets need to use an object instead.

There is one catch with this at the moment, no string of bits extracted
from the encoding may exceeed 64-bits. Fields are still permitted to
exceed 64-bits so long as they aren't one contiguous string of bits. If
this proves to be a problem then we can modify the generation of
fieldFromInstruction() calls to account for it but for now I've added an
assertion for this.

InsnType must either be integral or an APInt-like object that must:
* Have a static const max_size_in_bits equal to the number of bits in the encoding.
* be default-constructible and copy-constructible
* be constructible from a uint64_t (this is the key area the interface deviates
  from APInt since this constructor does not take the bit width)
* be constructible from an APInt (this can be private)
* be convertible to uint64_t
* Support the ~, &,, ==, !=, and |= operators with other objects of the same type
* Support shift (<<, >>) with signed and unsigned integers on the RHS
* Support put (<<) to raw_ostream&

Reviewers: bogner, charukcs

Subscribers: nhaehnle, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345056 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PDB] Fix -Wunused-private-field in DIA
Reid Kleckner [Tue, 23 Oct 2018 17:20:16 +0000 (17:20 +0000)]
[PDB] Fix -Wunused-private-field in DIA

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345054 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Power9] Add __float128 support in the backend for bitcast to a i128
Stefan Pintilie [Tue, 23 Oct 2018 17:11:36 +0000 (17:11 +0000)]
[Power9] Add __float128 support in the backend for bitcast to a i128

Add support to allow bit-casting from f128 to i128 and then
extracting 64 bits from the result.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345053 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IR] remove fake binop queries for not/neg
Sanjay Patel [Tue, 23 Oct 2018 17:06:03 +0000 (17:06 +0000)]
[IR] remove fake binop queries for not/neg

The initial motivation is that we want to remove the
fneg API because that would silently fail if we add
an actual fneg instruction to IR. The same would be
true for the integer ops, so we might as well get rid
of these too.

We have a newer 'match' API that makes checking for
these patterns simpler. It also works with vectors
that may include undef elements in constants.

If any out-of-tree users need updating, they can model
their code changes on these commits:
rL345050
rL345043
rL345042
rL345041
rL345036
rL345030

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345052 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] use 'match' to simplify code
Sanjay Patel [Tue, 23 Oct 2018 16:54:28 +0000 (16:54 +0000)]
[InstCombine] use 'match' to simplify code

There's probably some vector-with-undef-element pattern
that shows an improvement, so this is probably not quite
'NFC'.

This is the last step towards removing the fake binop
queries for not/neg. Ie, there are no more uses of those
functions in trunk. Fneg should follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345050 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TTI][X86] Treat SK_Transpose shuffles as SK_PermuteTwoSrc - there's no difference...
Simon Pilgrim [Tue, 23 Oct 2018 16:45:26 +0000 (16:45 +0000)]
[TTI][X86] Treat SK_Transpose shuffles as SK_PermuteTwoSrc - there's no difference in lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345048 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo][GlobalOpt] Fix -debugify for globalopt shrinking globals to booleans.
Jordan Rupprecht [Tue, 23 Oct 2018 16:35:51 +0000 (16:35 +0000)]
[DebugInfo][GlobalOpt] Fix -debugify for globalopt shrinking globals to booleans.

Summary:
TryToShrinkGlobalToBoolean, when possible, will split store <value> + load <value> into store <bool> + select <bool ? value : 0>. This preserves DebugLoc during that pass.

Fixes PR37959. The test case here is the simplified .ll for:

```
static int foo;
int bar() {
  foo = 5;
  return foo;
}
```

Reviewers: dblaikie, gbedwell, aprantl

Reviewed By: dblaikie

Subscribers: mehdi_amini, JDevlieghere, dexonsmith, llvm-commits

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345046 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CostModel][X86] Add transpose shuffle cost tests
Simon Pilgrim [Tue, 23 Oct 2018 16:27:14 +0000 (16:27 +0000)]
[CostModel][X86] Add transpose shuffle cost tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345045 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] use 'match' to simplify code; NFC
Sanjay Patel [Tue, 23 Oct 2018 16:05:09 +0000 (16:05 +0000)]
[WebAssembly] use 'match' to simplify code; NFC

Vector types are not possible here because this code explicitly
checks for a scalar type, but this is another step towards
completely removing the fake binop queries for not/neg/fneg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345043 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Reassociate] replace fake binop queries with 'match' API
Sanjay Patel [Tue, 23 Oct 2018 15:55:06 +0000 (15:55 +0000)]
[Reassociate] replace fake binop queries with 'match' API

We need to update this code before introducing an 'fneg' instruction in IR,
so we might as well kill off the integer neg/not queries too.

This is no-functional-change-intended for scalar code and most vector code.
For vectors, we can see that the 'match' API allows for undef elements in
constants, so we optimize those cases better.

Ideally, there would be a test for each code diff, but I don't see evidence
of that for the existing code, so I didn't try very hard to come up with new
vector tests for each code change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345042 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] use 'match' to simplify code; NFC
Sanjay Patel [Tue, 23 Oct 2018 15:46:10 +0000 (15:46 +0000)]
[SelectionDAG] use 'match' to simplify code; NFC

Vector types are not possible here because this code only starts
matching from the scalar bool value of a conditional branch, but
this is another step towards completely removing the fake binop
queries for not/neg/fneg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345041 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegalizeDAG] Remove unused variable
Benjamin Kramer [Tue, 23 Oct 2018 15:43:36 +0000 (15:43 +0000)]
[LegalizeDAG] Remove unused variable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345040 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegalizeDAG] Share Vector/Scalar CTTZ Expansion
Simon Pilgrim [Tue, 23 Oct 2018 15:37:19 +0000 (15:37 +0000)]
[LegalizeDAG] Share Vector/Scalar CTTZ Expansion

As suggested on D53258, this patch demonstrates sharing common CTTZ expansion code between VectorLegalizer and SelectionDAGLegalize by putting it in TargetLowering.

I intend to move CTLZ and (scalar) CTPOP over as well and then update D53258 accordingly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345039 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLPVectorizer] Add basic support for mul/and/or/xor horizontal reductions
Simon Pilgrim [Tue, 23 Oct 2018 15:13:09 +0000 (15:13 +0000)]
[SLPVectorizer] Add basic support for mul/and/or/xor horizontal reductions

Expand arithmetic reduction to include mul/and/or/xor instructions.

This patch just fixes the SLPVectorizer - the effective reduction costs for AVX1+ are still poor (see rL344846) and will need to be improved before SLP sees this as a valid transform - but we can already see the effect on SSE2 tests.

This partially helps PR37731, but doesn't fix it all as it still falls over on the extraction/reduction order for some reason.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345037 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] use 'match' to handle vectors and simplify code
Sanjay Patel [Tue, 23 Oct 2018 15:05:12 +0000 (15:05 +0000)]
[InstCombine] use 'match' to handle vectors and simplify code

This is another step towards completely removing the fake
binop queries for not/neg/fneg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345036 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] swap select profile metadata when swapping select ops
Sanjay Patel [Tue, 23 Oct 2018 14:43:31 +0000 (14:43 +0000)]
[InstCombine] swap select profile metadata when swapping select ops

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345034 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] add/move tests for select with inverted condition; NFC
Sanjay Patel [Tue, 23 Oct 2018 14:37:29 +0000 (14:37 +0000)]
[InstCombine] add/move tests for select with inverted condition; NFC

The transform is broken in 2 ways - it doesn't correct metadata (or even drop it),
and it doesn't work with vectors with undef elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345033 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[MachinePipeliner] Split MachinePipeliner code into header and cpp files"
Aleksandr Urakov [Tue, 23 Oct 2018 14:27:45 +0000 (14:27 +0000)]
Revert "[MachinePipeliner] Split MachinePipeliner code into header and cpp files"

This reverts commit 40760b733d9eef841c897338af5e9d81b12551bf.
It seems that the commit is a cuse of the build failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345032 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLSR] use 'match' to simplify code; NFC
Sanjay Patel [Tue, 23 Oct 2018 14:07:39 +0000 (14:07 +0000)]
[SLSR] use 'match' to simplify code; NFC

This pass could probably be modified slightly to allow
vector splat transforms for practically no cost, but
it only works on scalars for now. So the use of the
newer 'match' API should make no functional difference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345030 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLSR] auto-generate full test assertions; NFC
Sanjay Patel [Tue, 23 Oct 2018 13:39:40 +0000 (13:39 +0000)]
[SLSR] auto-generate full test assertions; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345028 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExperimental re-land of [X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 ...
Roman Lebedev [Tue, 23 Oct 2018 13:19:31 +0000 (13:19 +0000)]
Experimental re-land of [X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 - y) >> (32 - y) pattern

This initially landed in rL345014, but was reverted in rL345017
due to sanitizer-x86_64-linux-fast buildbot failure in
check-lld (ELF/relocatable-versioned.s) test.

While i'm not yet quite sure what is the problem, one obvious
thing here is that extra truncation roundtrip.
Maybe that's it? If not, will re-revert.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345027 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd BROADCAST shuffle cost tests.
Simon Pilgrim [Tue, 23 Oct 2018 13:14:54 +0000 (13:14 +0000)]
Add BROADCAST shuffle cost tests.

Part of a lot of cleanup necessary before PR39368.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345025 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd BROADCAST shuffle cost tests.
Simon Pilgrim [Tue, 23 Oct 2018 13:00:22 +0000 (13:00 +0000)]
Add BROADCAST shuffle cost tests.

Part of a lot of cleanup necessary before PR39368.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345023 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoLeftover bits from https://reviews.llvm.org/D53420 that were accidentally left
Dorit Nuzman [Tue, 23 Oct 2018 11:51:55 +0000 (11:51 +0000)]
Leftover bits from https://reviews.llvm.org/D53420 that were accidentally left
out of revision 344883

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345021 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[lit] Only return a found bash executable on Windows if it can understand Windows...
Greg Bedwell [Tue, 23 Oct 2018 11:34:04 +0000 (11:34 +0000)]
[lit] Only return a found bash executable on Windows if it can understand Windows paths

Some versions of bash.exe, for example WSL's version expect paths in the form
/mnt/c/path/to/dir rather than c:\\path\\to\\dir so will cause failures
for any tests that require an external shell if used by lit.  If we're on
Windows and looking for an external shell, check that the found version
of bash is able to parse a native path before returning that version.

This patch also partially reverts the behaviour of r228221 by
restoring the warning if bash cannot be found.  This shouldn't pollute
the lit stderr anymore as we're now using internal shell by default on
Windows.  If someone is explicitly specifying to use an external shell, it's
probably worth alerting them to the fact that bash could not be found.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345019 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Update raw mask shuffle decoders to handle UNDEF mask elts
Simon Pilgrim [Tue, 23 Oct 2018 11:33:38 +0000 (11:33 +0000)]
[X86][SSE] Update raw mask shuffle decoders to handle UNDEF mask elts

Matches the approach taken in the constant pool shuffle decoders, and uses an UndefElts mask instead of uint64_t(-1) raw mask values, which doesn't work safely for i32/i64 shuffle mask sizes (as the -1 value is legal).

This allows us to remove the constant pool shuffle decoders from most of the getTargetShuffleMask variable shuffle cases (X86ISD::VPERMV3 will be handled in a future commit).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345018 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 - y) >> (32 - y)...
Roman Lebedev [Tue, 23 Oct 2018 10:34:57 +0000 (10:34 +0000)]
Revert "[X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 - y) >> (32 - y) pattern"

*Seems* to be breaking sanitizer-x86_64-linux-fast buildbot,
the ELF/relocatable-versioned.s test:

==17758==MemorySanitizer CHECK failed: /b/sanitizer-x86_64-linux-fast/build/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:191 "((kBlockMagic)) == ((((u64*)addr)[0]))" (0x6a6cb03abcebc041, 0x0)
    #0 0x59716b in MsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /b/sanitizer-x86_64-linux-fast/build/llvm/projects/compiler-rt/lib/msan/msan.cc:393
    #1 0x586635 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /b/sanitizer-x86_64-linux-fast/build/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc:79
    #2 0x57d5ff in __sanitizer::InternalFree(void*, __sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<__sanitizer::AP32> >*) /b/sanitizer-x86_64-linux-fast/build/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:191
    #3 0x7fc21b24193f  (/lib/x86_64-linux-gnu/libc.so.6+0x3593f)
    #4 0x7fc21b241999 in exit (/lib/x86_64-linux-gnu/libc.so.6+0x35999)
    #5 0x7fc21b22c2e7 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e7)
    #6 0x57c039 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld+0x57c039)

This reverts commit r345014.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345017 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TTI] Add generic cost handling of SK_Reverse shuffles
Simon Pilgrim [Tue, 23 Oct 2018 09:42:10 +0000 (09:42 +0000)]
[TTI] Add generic cost handling of SK_Reverse shuffles

These can be treated as a general permute.

This required a fix for missing reverse patterns on ARM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345015 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 - y) >> (32 - y) pattern
Roman Lebedev [Tue, 23 Oct 2018 09:08:44 +0000 (09:08 +0000)]
[X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 - y) >> (32 - y) pattern

Summary:
Continuation of D52348.

We also get the `c) x &  (-1 >> (32 - y))` pattern here, because of the D48768.
I will add extra-uses into those tests and follow-up with a patch to handle those patterns too.

Reviewers: RKSimon, craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345014 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix non-Windows build for D53324
Aleksandr Urakov [Tue, 23 Oct 2018 08:15:00 +0000 (08:15 +0000)]
Fix non-Windows build for D53324

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345011 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Revert "[PDB] Extend IPDBSession's interface to retrieve frame data""
Aleksandr Urakov [Tue, 23 Oct 2018 08:14:53 +0000 (08:14 +0000)]
Revert "Revert "[PDB] Extend IPDBSession's interface to retrieve frame data""

This reverts commit 466ce67d6ec444962e5cc0136243c16a453190c0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345010 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachinePipeliner] Split MachinePipeliner code into header and cpp files
Lama Saba [Tue, 23 Oct 2018 07:58:41 +0000 (07:58 +0000)]
[MachinePipeliner] Split MachinePipeliner code into header and cpp files

Split MachinePipeliner code into header and cpp files to allow inheritance from SwingSchedulerDAG

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345008 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd support for GNU Hurd in Path.inc and other places
Sylvestre Ledru [Tue, 23 Oct 2018 07:13:47 +0000 (07:13 +0000)]
Add support for GNU Hurd in Path.inc and other places

Summary: Patch by Svante Signell & myself

Reviewers: rnk, JDevlieghere, efriedma

Reviewed By: efriedma

Subscribers: efriedma, JDevlieghere, krytarowski, llvm-commits, kristina

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345007 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Regenerate test checks to show fma comments. NFC
Craig Topper [Tue, 23 Oct 2018 04:18:08 +0000 (04:18 +0000)]
[X86] Regenerate test checks to show fma comments. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344999 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RuntimeDyld][COFF] Skip non-loaded sections when calculating ImageBase.
Lang Hames [Tue, 23 Oct 2018 01:36:33 +0000 (01:36 +0000)]
[RuntimeDyld][COFF] Skip non-loaded sections when calculating ImageBase.

Non-loaded sections (whose unused load-address defaults to zero) should not
be taken into account when calculating ImageBase, or ImageBase will be
incorrectly set to 0.

Patch by Andrew Scheidecker. Thanks Andrew!

https://reviews.llvm.org/D51343

+        // The Sections list may contain sections that weren't loaded for
+        // whatever reason: they may be debug sections, and ProcessAllSections
+        // is false, or they may be sections that contain 0 bytes. If the
+        // section isn't loaded, the load address will be 0, and it should not
+        // be included in the ImageBase calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344995 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Show JITDylib search order in JITDylib::dump.
Lang Hames [Tue, 23 Oct 2018 01:36:32 +0000 (01:36 +0000)]
[ORC] Show JITDylib search order in JITDylib::dump.

This can be helpful in debugging search-order related failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344994 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Dump flags for JITDylib symbol table entries.
Lang Hames [Tue, 23 Oct 2018 01:36:31 +0000 (01:36 +0000)]
[ORC] Dump flags for JITDylib symbol table entries.

This can help when debugging flag-specific symbol table issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344993 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[hwasan] add stack frame descriptions.
Kostya Serebryany [Tue, 23 Oct 2018 00:50:40 +0000 (00:50 +0000)]
[hwasan] add stack frame descriptions.

Summary:
At compile-time, create an array of {PC,HumanReadableStackFrameDescription}
for every function that has an instrumented frame, and pass this array
to the run-time at the module-init time.
Similar to how we handle pc-table in SanitizerCoverage.
The run-time is dummy, will add the actual logic in later commits.

Reviewers: morehouse, eugenis

Reviewed By: eugenis

Subscribers: srhines, llvm-commits, kubamracek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344985 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[dsymutil] Improve error reporting when we cannot create output file.
Jonas Devlieghere [Tue, 23 Oct 2018 00:32:22 +0000 (00:32 +0000)]
[dsymutil] Improve error reporting when we cannot create output file.

Before this patch we were returning an empty string in case we couldn't
create the output file. Now we return an expected string so we can
return and print the proper issue. We now return errors instead of bools
and defer printing to the call site.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344983 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Fix assembly printing of br_table
Heejin Ahn [Tue, 23 Oct 2018 00:28:14 +0000 (00:28 +0000)]
[WebAssembly] Fix assembly printing of br_table

Summary: In `br_table's stack version asm string, \t was missing.

Reviewers: aardappel

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344981 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Added test for inline assembly roundtrip.
Wouter van Oortmerssen [Tue, 23 Oct 2018 00:12:49 +0000 (00:12 +0000)]
[WebAssembly] Added test for inline assembly roundtrip.

Summary:
Due to previous work to make WebAssembly MC by default stack-only
inline assembly now "just works" (previously it didn't since it had
no way to know types of registers), so no further work required.

So far we only have tests (in inline-asm.ll) which test with
non-existing instructions, so this adds a test that roundtrips
both the inline assembly and its surrounding code thru the assembler.

Reviewers: dschuff, sunfish

Subscribers: sbc100, jgravelle-google, eraman, aheejin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344977 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoX86: fix a comment copy-paste issue (NFC)
Saleem Abdulrasool [Mon, 22 Oct 2018 23:34:24 +0000 (23:34 +0000)]
X86: fix a comment copy-paste issue (NFC)

The comment was copy-pasted but not updated.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344973 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Remove unused entries from the X86ProcFamily enum. Add a note to discourage...
Craig Topper [Mon, 22 Oct 2018 23:14:55 +0000 (23:14 +0000)]
[X86] Remove unused entries from the X86ProcFamily enum. Add a note to discourage creation of new enum entries.

As we've learned multiple times, a coarse grained enum like this is not scalable and we should be migrating away from it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344972 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Intrinsic] Unigned Saturation Addition Intrinsic
Leonard Chan [Mon, 22 Oct 2018 23:08:40 +0000 (23:08 +0000)]
[Intrinsic] Unigned Saturation Addition Intrinsic

Add an intrinsic that takes 2 integers and perform unsigned saturation
addition on them.

This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344971 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoX86: Do not optimize branches with undef eflags inputs
Matthias Braun [Mon, 22 Oct 2018 22:52:23 +0000 (22:52 +0000)]
X86: Do not optimize branches with undef eflags inputs

analyzeBranch()/insertBranch() etc. do not properly deal with an undef
flag on the eflags input and used to produce invalid MIR.  I don't see
this ever affecting real world inputs (I don't think it is possible to
produce undef flags with llvm IR), so I simply changed the code to bail
out in this case.

rdar://42122367

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344970 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Reassociate] remove bogus tests; NFC
Sanjay Patel [Mon, 22 Oct 2018 22:50:27 +0000 (22:50 +0000)]
[Reassociate] remove bogus tests; NFC

I was trying to provide test coverage for D53533
with rL344964, but these don't do it...and I don't
think they add any value, so deleting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344969 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MC] Shrink MCAsmParser by grouping bools, add const, NFC
Reid Kleckner [Mon, 22 Oct 2018 22:29:09 +0000 (22:29 +0000)]
[MC] Shrink MCAsmParser by grouping bools, add const, NFC

I was considering adding another boolean here. I standardized on bools
since they allow default member initializers in the class definition.
This makes ShowParsedOperands protected instead of private, but that's
probably fine.

Reduce the SmallVector size while we're at it, since the common case is
that there is never a pending error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344967 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Regenerate reverse shuffle costs
Simon Pilgrim [Mon, 22 Oct 2018 22:26:00 +0000 (22:26 +0000)]
[ARM] Regenerate reverse shuffle costs

Came about while cleaning up general shuffle costs for PR39368

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344966 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRecommit r344877 "[X86] Stop promoting integer loads to vXi64"
Craig Topper [Mon, 22 Oct 2018 22:14:05 +0000 (22:14 +0000)]
Recommit r344877 "[X86] Stop promoting integer loads to vXi64"

I've included a fix to DAGCombiner::ForwardStoreValueToDirectLoad that I believe will prevent the previous miscompile.

Original commit message:

Theoretically this was done to simplify the amount of isel patterns that were needed. But it also meant a substantial number of our isel patterns have to match an explicit bitcast. By making the vXi32/vXi16/vXi8 types legal for loads, DAG combiner should be able to change the load type to rem

I had to add some additional plain load instruction patterns and a few other special cases, but overall the isel table has reduced in size by ~12000 bytes. So it looks like this promotion was hurting us more than helping.

I still have one crash in vector-trunc.ll that I'm hoping @RKSimon can help with. It seems to relate to using getTargetConstantFromNode on a load that was shrunk due to an extract_subvector combine after the constant pool entry was created. So we end up decoding more mask elements than the lo

I'm hoping this patch will simplify the number of patterns needed to remove the and/or/xor promotion.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits, RKSimon

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344965 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Reassociate] add vector tests with undef elements; NFC
Sanjay Patel [Mon, 22 Oct 2018 22:04:13 +0000 (22:04 +0000)]
[Reassociate] add vector tests with undef elements; NFC

Also, regenerate checks for these files. We should do better
on the vector tests by using the PatternMatch API instead of
BinaryOperator::isNot/isNeg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344964 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly][NFC] Remove WebAssemblyStackifier TableGen backend
Thomas Lively [Mon, 22 Oct 2018 21:55:26 +0000 (21:55 +0000)]
[WebAssembly][NFC] Remove WebAssemblyStackifier TableGen backend

Summary:
Replace its functionality with a TableGen InstrInfo relational
instruction mapping. Although arguably more complex than the TableGen
backend, the relational mapping is a smaller maintenance burden than a
TableGen backend.

Reviewers: aardappel, aheejin, dschuff

Subscribers: mgorny, sbc100, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344962 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Use a function-local offset for AT_call_return_pc
Vedant Kumar [Mon, 22 Oct 2018 21:44:21 +0000 (21:44 +0000)]
[DWARF] Use a function-local offset for AT_call_return_pc

Logs provided by @stella.stamenova indicate that on Linux, lldb adds a
spurious slide offset to the return PC it loads from AT_call_return_pc
attributes (see the list thread: "[PATCH] D50478: Add support for
artificial tail call frames").

This patch side-steps the issue by getting rid of the load address
calculation in lldb's CallEdge::GetReturnPCAddress.

The idea is to have the DWARF writer emit function-local offsets to the
instruction after a call. I.e. return-pc = label-after-call-insn -
function-entry. LLDB can simply add this offset to the base address of a
function to get the return PC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344960 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Reassociate] add 'using namespace' to reduce bloat; NFC
Sanjay Patel [Mon, 22 Oct 2018 21:37:02 +0000 (21:37 +0000)]
[Reassociate] add 'using namespace' to reduce bloat; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344959 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC] Guard access to the MemMgrs vector in RTDyldObjectLinkingLayer.
Lang Hames [Mon, 22 Oct 2018 21:17:56 +0000 (21:17 +0000)]
[ORC] Guard access to the MemMgrs vector in RTDyldObjectLinkingLayer.

Otherwise we can end up with a data-race when linking concurrently.

This should fix an intermittent failure in the multiple-compile-threads-basic.ll
testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344956 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] add test for PR25498 and complete checks; NFC
Sanjay Patel [Mon, 22 Oct 2018 21:11:15 +0000 (21:11 +0000)]
[x86] add test for PR25498 and complete checks; NFC

Might as well test the actual codegen instead of just the absence of crashing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344955 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoX86: add alias for pushfw/popfw in Intel mode
Tim Northover [Mon, 22 Oct 2018 20:38:13 +0000 (20:38 +0000)]
X86: add alias for pushfw/popfw in Intel mode

A while ago we changed pushf and popf in Intel mode to generate pushfq
and popfq. Unfortunately that left us with no way to get the 16-bit
encoding in Intel mode so this patch adds pushfw and popfw as aliases
there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply "[MachineCopyPropagation] Reimplement CopyTracker in terms of register units"
Justin Bogner [Mon, 22 Oct 2018 19:51:31 +0000 (19:51 +0000)]
Reapply "[MachineCopyPropagation] Reimplement CopyTracker in terms of register units"

Recommits r342942, which was reverted in r343189, with a fix for an
issue where we would propagate unsafely if we defined only the upper
part of a register.

Original message:

  Change the copy tracker to keep a single map of register units
  instead of 3 maps of registers. This gives a very significant
  compile time performance improvement to the pass. I measured a
  30-40% decrease in time spent in MCP on x86 and AArch64 and much
  more significant improvements on out of tree targets with more
  registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344942 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[hot-cold-split] Add opt remark on success
Teresa Johnson [Mon, 22 Oct 2018 19:06:42 +0000 (19:06 +0000)]
[hot-cold-split] Add opt remark on success

Summary: Emit optimization remark on successful hot cold split.

Reviewers: sebpop, hiraditya

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344938 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert rL344931 from llvm/trunk: [X86][SSE] getTargetShuffleMaskIndices - allow opt...
Simon Pilgrim [Mon, 22 Oct 2018 19:01:25 +0000 (19:01 +0000)]
Revert rL344931 from llvm/trunk: [X86][SSE] getTargetShuffleMaskIndices - allow opt-in support for whole undef shuffle mask elements
We can't safely assume that certain RawMask entries are UNDEF as most variable shuffles ignore non-index bits - PSHUFB only works on i8 elts so it'd be safe to use but I'm intending to come up with an alternative approach that works for all.
........
Enable this for PSHUFB constant mask decoding and remove the ConstantPool DecodePSHUFBMask

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344937 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert rL344933 from llvm/trunk: [X86][SSE] Tidyup DecodeVPERMILPMask shuffle mask...
Simon Pilgrim [Mon, 22 Oct 2018 18:58:32 +0000 (18:58 +0000)]
Revert rL344933 from llvm/trunk: [X86][SSE] Tidyup DecodeVPERMILPMask shuffle mask decoding
We can't safely assume that certain RawMask entries are UNDEF as most variable shuffles ignore non-index bits.
........
Add support for UNDEF raw mask elements and remove the ConstantPool DecodeVPERMILPMask usage in X86ISelLowering.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344936 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r344930 as it broke some of the bots on Windows.
Aaron Ballman [Mon, 22 Oct 2018 18:51:29 +0000 (18:51 +0000)]
Revert r344930 as it broke some of the bots on Windows.

http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/739

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344935 91177308-0d34-0410-b5e6-96231b3b80d8