OSDN Git Service

android-x86/external-llvm.git
5 years ago[AMDGPU][MC] Corrected handling of tied src for atomic return MUBUF opcodes
Dmitry Preobrazhensky [Wed, 27 Mar 2019 13:07:41 +0000 (13:07 +0000)]
[AMDGPU][MC] Corrected handling of tied src for atomic return MUBUF opcodes

See bug 40917: https://bugs.llvm.org/show_bug.cgi?id=40917

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[X86][SSE] Add shuffle test case for PR41249
Simon Pilgrim [Wed, 27 Mar 2019 11:21:09 +0000 (11:21 +0000)]
[X86][SSE] Add shuffle test case for PR41249

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

5 years ago[AArch64] Adds cases for LDRSHWui and LDRSHXui to getMemOpInfo
Sander de Smalen [Wed, 27 Mar 2019 10:39:03 +0000 (10:39 +0000)]
[AArch64] Adds cases for LDRSHWui and LDRSHXui to getMemOpInfo

This patch also adds cases PRFUMi and PRFMui.
This change was discussed in https://reviews.llvm.org/D59635.

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

5 years ago[Support] MemoryBlock size should reflect the requested size
Andrew Ng [Wed, 27 Mar 2019 10:26:21 +0000 (10:26 +0000)]
[Support] MemoryBlock size should reflect the requested size

This patch mirrors the change made to the Unix equivalent in
r351916. This in turn fixes bugs related to the use of FileOutputBuffer
to output to "-", i.e. stdout, on Windows.

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

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

5 years agoRevert rL356864 : [X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG...
Simon Pilgrim [Wed, 27 Mar 2019 10:25:02 +0000 (10:25 +0000)]
Revert rL356864 : [X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)

Enable SSE41 ZERO_EXTEND_VECTOR_INREG shuffle combines - for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern we reduce the shuffles (port5-bottleneck on Intel) at the expense of creating a zero (pxor v,v) and an extra register move - which is a good trade off as these are pretty cheap and in most cases it doesn't increase register pressure.

This also exposed a missed opportunity to use combine to ZERO_EXTEND_VECTOR_INREG with folded loads - even if we're in the float domain.
........
Causes PR41249

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

5 years ago[DWARF] Add D to Seen early to avoid duplicate elements in Worklist
Fangrui Song [Wed, 27 Mar 2019 09:38:05 +0000 (09:38 +0000)]
[DWARF] Add D to Seen early to avoid duplicate elements in Worklist

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

5 years ago[DWARF] Simplify DWARFVerifier::handleDebugAbbrev. NFC
Fangrui Song [Wed, 27 Mar 2019 08:43:21 +0000 (08:43 +0000)]
[DWARF] Simplify DWARFVerifier::handleDebugAbbrev. NFC

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

5 years ago[DAGCombiner] Don't allow addcarry if the carry producer is illegal.
Jonas Paulsson [Wed, 27 Mar 2019 08:41:46 +0000 (08:41 +0000)]
[DAGCombiner]  Don't allow addcarry if the carry producer is illegal.

getAsCarry() checks that the input argument is a carry-producing node before
allowing a transformation to addcarry. This patch adds a check to make sure
that the carry-producing node is legal. If it is not, it may not remain in a
form that is manageable by the target backend. The test case caused a
compilation failure during instruction selection for this reason on SystemZ.

Patch by Ulrich Weigand.

Review: Sanjay Patel
https://reviews.llvm.org/D59822

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

5 years ago[llvm-dwarfdump] Simplify -o handling
Fangrui Song [Wed, 27 Mar 2019 08:19:36 +0000 (08:19 +0000)]
[llvm-dwarfdump] Simplify -o handling

ToolOutputFile handles '-' so no need to specialize here.
Also, we neither reassign the variable nor pass it around, thus no need
to use std::unique_ptr<ToolOutputFile>.

exit(1) -> return 1;  to call the destructor of raw_fd_stream

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

5 years ago[X86] Add test cases for missed opportunities in (x << C1) op C2 to (x op (C2>>C1...
Craig Topper [Wed, 27 Mar 2019 06:07:05 +0000 (06:07 +0000)]
[X86] Add test cases for missed opportunities in (x << C1) op C2 to (x op (C2>>C1)) << C1 transform.

We handle the case where the C2 does not fit in a signed 32-bit immediate, but
(C2>>C1) does. But there's also some 64-bit opportunities when C2 is not an unsigned
32-bit immediate, but (C2>>C1) is. For OR/XOR this allows us to load the
immediate with with MOV32ri instead of a movabsq. For AND it allows us to use a
32-bit AND and fold the immediate.

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

5 years ago[X86] When iselling (x << C1) and/or/xor C2 as (x and/or/xor (C2>>C1)) << C1, go...
Craig Topper [Wed, 27 Mar 2019 04:45:58 +0000 (04:45 +0000)]
[X86] When iselling (x << C1) and/or/xor C2 as (x and/or/xor (C2>>C1)) << C1, go through the isel table instead of manually selecting.

Previously we manually selected the AND/OR/XOR with immediate and the SHL(or ADD if the shift is 1). But this was missing out on the opportunity to use a 64 bit AND with a 32-bit immediate and possibly other isel tricks we have built into the tables.

Instead, insert the new nodes into the DAG using insertDAGNode and allow them each to be selected through the normal table.

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

5 years ago[NFC][PowerPC] Custom PowerPC specific machine-scheduler
QingShan Zhang [Wed, 27 Mar 2019 03:50:16 +0000 (03:50 +0000)]
[NFC][PowerPC] Custom PowerPC specific machine-scheduler
This patch lays the groundwork for extending the generic machine scheduler by providing a PPC-specific implementation.
There are no functional changes as this is an incremental patch that simply provides the necessary overrides which just
encapsulate the behavior of the generic scheduler. Subsequent patches will add specific behavior.

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

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

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Wed, 27 Mar 2019 02:18:41 +0000 (02:18 +0000)]
[X86] Autogenerate complete checks. NFC

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

5 years ago[X86] Simplify some code in matchBitExtract by using ANY_EXTEND.
Craig Topper [Wed, 27 Mar 2019 02:08:03 +0000 (02:08 +0000)]
[X86] Simplify some code in matchBitExtract by using ANY_EXTEND.

We were manually outputting the code we would get from selecting ANY_EXTEND. We
can save some code by just letting an ANY_EXTEND go through isel on its own.

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

5 years ago[Remarks] Emit a section containing remark diagnostics metadata
Francis Visoiu Mistrih [Wed, 27 Mar 2019 01:13:59 +0000 (01:13 +0000)]
[Remarks] Emit a section containing remark diagnostics metadata

A section containing metadata on remark diagnostics will be emitted if
the flag (-mllvm) -remarks-section is present.

For now, the metadata is:

* a magic number for remarks: "REMARKS\0"
* the version number: a little-endian uint64_t
* the absolute file path to the serialized remark diagnostics: a
  null-terminated string.

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

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

5 years agogn build: Add build files for clang-include-fixer and find-all-symbols
Nico Weber [Wed, 27 Mar 2019 00:17:05 +0000 (00:17 +0000)]
gn build: Add build files for clang-include-fixer and find-all-symbols

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

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

5 years ago[ConstantRange] Exclude full set from isSignWrappedSet()
Nikita Popov [Tue, 26 Mar 2019 22:37:26 +0000 (22:37 +0000)]
[ConstantRange] Exclude full set from isSignWrappedSet()

Split off from D59749. This uses a simpler and more efficient
implementation of isSignWrappedSet(), and considers full sets
as non-wrapped, to be consistent with isWrappedSet(). Otherwise
the behavior is unchanged.

There are currently only two users of this function and both already
check for isFullSet() || isSignWrappedSet(), so this is not going to
cause a change in overall behavior.

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

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

5 years ago[cmake] Reset variable before using it
Shoaib Meenai [Tue, 26 Mar 2019 22:16:53 +0000 (22:16 +0000)]
[cmake] Reset variable before using it

A bunch of macros use the same variable name, and since CMake macros
don't get their own scope, the value persists across macro invocations,
and we can end up exporting targets which shouldn't be exported. Clear
the variable before each use to avoid this.

Converting these macros to functions would also help, since it would
avoid the variable leaking into its parent scope, and that's something I
plan to follow up with. It won't fully address the problem, however,
since functions still inherit variables from their parent scopes, so if
someone in the parent scope just happened to use the same variable name
we'd still have the same issue.

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

5 years ago[PPC] Refactor PPCBranchSelector.cpp
Guozhi Wei [Tue, 26 Mar 2019 21:27:38 +0000 (21:27 +0000)]
[PPC] Refactor PPCBranchSelector.cpp

This patch splits the huge function PPCBranchSelector.cpp:runOnMachineFunction into several smaller functions.

No functional change.

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

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

5 years ago[LiveRange] Reset the VNIs when splitting subranges
Quentin Colombet [Tue, 26 Mar 2019 21:27:15 +0000 (21:27 +0000)]
[LiveRange] Reset the VNIs when splitting subranges

When splitting a subrange we end up with two different subranges covering
two different, non overlapping, lanes.
As part of this splitting the VNIs of the original live-range need
to be dispatched to the subranges according to which lanes they are
actually defining.

Prior to this patch we were assuming that all values were defining
all lanes. This was wrong as demonstrated by llvm.org/PR40835.

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

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

5 years ago[SDAG] add simplifications for FP at node creation time
Sanjay Patel [Tue, 26 Mar 2019 20:54:15 +0000 (20:54 +0000)]
[SDAG] add simplifications for FP at node creation time

We have the folds for fadd/fsub/fmul already in DAGCombiner,
so it may be possible to remove that code if we can guarantee that
these ops are zapped before they can exist.

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

5 years ago[PowerPC] Remove UseVSXReg
Stefan Pintilie [Tue, 26 Mar 2019 20:28:21 +0000 (20:28 +0000)]
[PowerPC] Remove UseVSXReg

The UseVSXReg flag can be safely removed and the code cleaned up.

Patch By: Yi-Hong Liu

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

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

5 years agoRevert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5.""
Ali Tamur [Tue, 26 Mar 2019 20:05:27 +0000 (20:05 +0000)]
Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5.""

This reverts commit rL357020.

The commit broke the test llvm/test/tools/llvm-objdump/embedded-source.test
on some builds including clang-ppc64be-linux-multistage,
clang-s390x-linux, clang-with-lto-ubuntu, clang-x64-windows-msvc,
llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast (and others).

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

5 years ago[WebAssembly] Initial implementation of PIC code generation
Sam Clegg [Tue, 26 Mar 2019 19:46:15 +0000 (19:46 +0000)]
[WebAssembly] Initial implementation of PIC code generation

This change implements lowering of references global symbols in PIC
mode.

This change implements lowering of global references in PIC mode using a
new @GOT reference type. @GOT references can be used with function or
data symbol names combined with the get_global instruction. In this case
the linker will insert the wasm global that stores the address of the
symbol (either in memory for data symbols or in the wasm table for
function symbols).

For now I'm continuing to use the R_WASM_GLOBAL_INDEX_LEB relocation
type for this type of reference which means that this relocation type
can refer to either a global or a function or data symbol. We could
choose to introduce specific relocation types for GOT entries in the
future.  See the current dynamic linking proposal:

https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md

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

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

5 years agogn build: Format all build files
Nico Weber [Tue, 26 Mar 2019 19:16:28 +0000 (19:16 +0000)]
gn build: Format all build files

Re-ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.

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

5 years agogn build: Merge r356929 (effectively relands r353518, reverted in r353621)
Nico Weber [Tue, 26 Mar 2019 18:55:37 +0000 (18:55 +0000)]
gn build: Merge r356929 (effectively relands r353518, reverted in r353621)

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

5 years ago[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."
Ali Tamur [Tue, 26 Mar 2019 18:53:23 +0000 (18:53 +0000)]
[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."

Reapply rL356941 after regenerating the object file in the failing test
llvm/test/tools/llvm-objdump/embedded-source.test from source.

Original commit message:

[llvm] Prevent duplicate files in debug line header in dwarf 5.

Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Tags: #llvm, #debug-info

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

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

5 years ago[llvm-objcopy] - Strip sections before symbols.
George Rimar [Tue, 26 Mar 2019 18:42:15 +0000 (18:42 +0000)]
[llvm-objcopy] - Strip sections before symbols.

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40007.

Idea is to swap the order of stripping. So that we strip sections before
symbols what allows us to strip relocation sections without emitting
the error about relative symbols.

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

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

5 years ago[WebAssembly] Don't analyze branches after CFGStackify
Heejin Ahn [Tue, 26 Mar 2019 18:21:20 +0000 (18:21 +0000)]
[WebAssembly] Don't analyze branches after CFGStackify

Summary:
`WebAssembly::analyzeBranch` now does not analyze anything if the
function is CFG stackified. We were previously doing similar things by
checking if a branch's operand is whether an integer or an MBB, but this
failed to bail out when a BB did not have any terminators.

Consider this case:
```
bb0:
  try $label0
  call @foo    // unwinds to %ehpad
bb1:
  ...
  br $label0   // jumps to %cont. can be deleted
ehpad:
  catch
  ...
cont:
  end_try
```
Here `br $label0` will be deleted in CFGStackify's
`removeUnnecessaryInstrs` function, because we jump to the %cont block
even without the branch. But in this case, MachineVerifier fails to
verify this, because `ehpad` is not a successor of `bb1` even if `bb1`
does not have any terminators. MachineVerifier incorrectly thinks `bb1`
falls through to the next block.

This pass now consistently rejects all analysis after CFGStackify
whether a BB has terminators or not, also making the MachineVerifier
work. (MachineVerifier does not try to verify relationships between BBs
if `analyzeBranch` fails, the behavior we want after CFGStackify.)

This also adds a new option `-wasm-disable-ehpad-sort` for testing. This
option helps create the sorted order we want to test, and without the
fix in this patch, the tests in cfg-stackify-eh.ll fail at
MachineVerifier with `-wasm-disable-ehpad-sort`.

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[ConstantRange] Fix outdated comment; NFC
Nikita Popov [Tue, 26 Mar 2019 18:05:53 +0000 (18:05 +0000)]
[ConstantRange] Fix outdated comment; NFC

Full/empty is required now, so there is no default.

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

5 years ago[InstCombine] Add tests for ssubo X, C -> saddo X, -C; NFC
Nikita Popov [Tue, 26 Mar 2019 18:05:43 +0000 (18:05 +0000)]
[InstCombine] Add tests for ssubo X, C -> saddo X, -C; NFC

Add baseline tests for canonicalization of
ssubo X, C -> saddo X, -C.

Patch by Dan Robertson.

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

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

5 years ago[InstCombine] form uaddsat from add+umin (PR14613)
Sanjay Patel [Tue, 26 Mar 2019 17:50:08 +0000 (17:50 +0000)]
[InstCombine] form uaddsat from add+umin (PR14613)

This is the last step towards solving the examples shown in:
https://bugs.llvm.org/show_bug.cgi?id=14613

With this change, x86 should end up with psubus instructions
when those are available.

All known codegen issues with expanding the saturating intrinsics
were resolved with:
D59006 / rL356855

We also have some early evidence in D58872 that using the intrinsics
will lead to better perf. If some target regresses from this, custom
lowering of the intrinsics (as in the above for x86) may be needed.

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

5 years ago[WebAssembly] Add CFGStacikfied field to WebAssemblyFunctionInfo
Heejin Ahn [Tue, 26 Mar 2019 17:46:14 +0000 (17:46 +0000)]
[WebAssembly] Add CFGStacikfied field to WebAssemblyFunctionInfo

Summary:
This adds `CFGStackified` field and its serialization to
WebAssemblyFunctionInfo.

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[WebAssembly] Support WebAssemblyFunctionInfo serialization
Heejin Ahn [Tue, 26 Mar 2019 17:35:35 +0000 (17:35 +0000)]
[WebAssembly] Support WebAssemblyFunctionInfo serialization

Summary:
The framework for supporting target-specific MachineFunctionInfo was
added in r356215. This adds serialization support for
WebAssemblyFunctionInfo on top of that. This patch only adds the
framework and does not actually serialize anything at this point; we
have to add YAML mapping later for the fields in WebAssemblyFunctionInfo
we want to serialize if necessary.

Reviewers: dschuff, arsenm

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

Tags: #llvm

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

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

5 years ago[WebAssembly] Fix a bug when mixing TRY/LOOP markers
Heejin Ahn [Tue, 26 Mar 2019 17:29:55 +0000 (17:29 +0000)]
[WebAssembly] Fix a bug when mixing TRY/LOOP markers

Summary:
When TRY and LOOP markers are in the same BB and END_TRY and END_LOOP
markers are in the same BB, END_TRY should be _before_ END_LOOP, because
LOOP is always before TRY if they are in the same BB. (TRY is placed in
the latest possible position, whereas LOOP is in the earliest possible
position.)

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[WebAssembly] Fix bugs in BLOCK/TRY placement
Heejin Ahn [Tue, 26 Mar 2019 17:15:55 +0000 (17:15 +0000)]
[WebAssembly] Fix bugs in BLOCK/TRY placement

Summary:
Before we placed all TRY/END_TRY markers before placing BLOCK/END_BLOCK
markers. This couldn't handle this case:
```
bb0:
  br bb2
bb1:          // nearest common dominator of bb3 and bb4
  br_if ... bb3
  br bb4
bb2:
  ...
bb3:
  call @foo   // unwinds to ehpad
bb4:
  call @bar   // unwinds to ehpad
ehpad:
  catch
  ...
```

When we placed TRY markers, we placed it in bb1 because it is the
nearest common dominator of bb3 and bb4. But because bb0 jumps to bb2,
when we placed block markers, we ended up with interleaved scopes like
```
block
try
end_block
catch
end_try
```
which was not correct.

This patch fixes the bug by placing BLOCK and TRY markers in one pass
while iterating BBs in a function. This also adds some more routines to
`placeTryMarkers`, because we now have to assume that there can be
previously placed BLOCK and END_BLOCK.

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[InstCombine] add tests for uaddsat using min; NFC
Sanjay Patel [Tue, 26 Mar 2019 16:19:13 +0000 (16:19 +0000)]
[InstCombine] add tests for uaddsat using min; NFC

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

5 years ago[InstCombine] update tests to use FileCheck; NFC
Sanjay Patel [Tue, 26 Mar 2019 15:58:33 +0000 (15:58 +0000)]
[InstCombine] update tests to use FileCheck; NFC

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

5 years ago[llvm-exegesis] Allow the target to disable the selection of some registers.
Clement Courbet [Tue, 26 Mar 2019 15:44:57 +0000 (15:44 +0000)]
[llvm-exegesis] Allow the target to disable the selection of some registers.

Summary:
This prevents "Cannot encode high byte register in REX-prefixed instruction"
from happening on instructions that require REX encoding when AH & co
get selected.
On the down side, these 4 registers can no longer be selected
automatically, but this avoids having to expose all the X86 encoding
complexity.

Reviewers: gchatelet

Subscribers: tschuett, jdoerfert, llvm-commits, bdb

Tags: #llvm

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

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

5 years ago[RISCV] Update setcc-logic.ll codegen test
Luis Marques [Tue, 26 Mar 2019 15:41:45 +0000 (15:41 +0000)]
[RISCV] Update setcc-logic.ll codegen test

This should have been updated as part of D59753.

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

5 years ago[MCA] Correctly update the UsedResourceGroups mask in the InstrBuilder.
Andrea Di Biagio [Tue, 26 Mar 2019 15:38:37 +0000 (15:38 +0000)]
[MCA] Correctly update the UsedResourceGroups mask in the InstrBuilder.

Found by inspection when looking at the debug output of MCA.
This problem was latent, and none of the upstream models were affected by it.
No functional change intended.

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

5 years agoTest commit: fix typo
Ronald Wampler [Tue, 26 Mar 2019 15:26:15 +0000 (15:26 +0000)]
Test commit: fix typo

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

5 years ago[SystemZ] Remove LRMux pseudo instruction.
Jonas Paulsson [Tue, 26 Mar 2019 15:13:48 +0000 (15:13 +0000)]
[SystemZ]  Remove LRMux pseudo instruction.

This instruction is unused and not needed.

Review: Ulrich Weigand.

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

5 years ago[DAG] Avoid smart constructor-based dangling nodes.
Nirav Dave [Tue, 26 Mar 2019 15:08:14 +0000 (15:08 +0000)]
[DAG] Avoid smart constructor-based dangling nodes.

Various SelectionDAG non-combine operations (e.g. the getNode smart
constructor and legalization) may leave dangling nodes by applying
optimizations or not fully pruning unused result values. This can
result in nodes that are never added to the worklist and therefore can
not be pruned.

Add a node inserter as the current node deleter to make sure such
nodes have the chance of being pruned.

Many minor changes, mostly positive.

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

5 years agoMoved body of methods dump to .cpp file to fix compilation when modules
Mikhail R. Gadelha [Tue, 26 Mar 2019 14:25:12 +0000 (14:25 +0000)]
Moved body of methods dump to .cpp file to fix compilation when modules
are enabled

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

5 years ago[RISCV] Improve codegen for icmp {ne,eq} with a constant
Luis Marques [Tue, 26 Mar 2019 12:55:00 +0000 (12:55 +0000)]
[RISCV] Improve codegen for icmp {ne,eq} with a constant

Adds two patterns to improve the codegen of GPR value comparisons with small
constants. Instead of first loading the constant into another register and then
doing an XOR of those registers, these patterns directly use the constant as an
XORI immediate.

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

5 years ago[TargetLowering] Add SimplifyDemandedBits support for ISD::INSERT_VECTOR_ELT
Simon Pilgrim [Tue, 26 Mar 2019 12:32:01 +0000 (12:32 +0000)]
[TargetLowering] Add SimplifyDemandedBits support for ISD::INSERT_VECTOR_ELT

This helps us relax the extension of a lot of scalar elements before they are inserted into a vector.

Its exposes an issue in DAGCombiner::convertBuildVecZextToZext as some/all the zero-extensions may be relaxed to ANY_EXTEND, so we need to handle that case to avoid a couple of AVX2 VPMOVZX test regressions.

Once this is in it should be easier to fix a number of remaining failures to fold loads into VBROADCAST nodes.

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

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

5 years agoFix nondeterminism introduced in r353954
Yi Kong [Tue, 26 Mar 2019 12:18:08 +0000 (12:18 +0000)]
Fix nondeterminism introduced in r353954

DenseMap iteration order is not guaranteed, use MapVector instead.

Fix provided by srhines.

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

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

5 years ago[TableGen] Let list elements have a trailing comma
Javed Absar [Tue, 26 Mar 2019 11:16:01 +0000 (11:16 +0000)]
[TableGen] Let list elements have a trailing comma

Let lists have an trailing comma to allow cleaner diffs e.g:
  def : Features<[FeatureA,
                  FeatureB,
                 ]>;
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D59247

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

5 years ago[TableGen] Give meaningful msg for def use in multiclass
Javed Absar [Tue, 26 Mar 2019 10:49:09 +0000 (10:49 +0000)]
[TableGen] Give meaningful msg for def use in multiclass

When one mistakenly specifies 'def' instead of using 'defm',
the error message is quite misleading: 'Couldn't find class..'
Instead, it should recommend using defm if the multiclass of
same name exists.

Reviewed By: hfinkel

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

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

5 years ago[ARM][Asm] Accept upper case coprocessor number and registers
Oliver Stannard [Tue, 26 Mar 2019 10:24:03 +0000 (10:24 +0000)]
[ARM][Asm] Accept upper case coprocessor number and registers

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

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

5 years ago[llvm-dlltool] Set a proper machine type for weak symbol object files
Martin Storsjo [Tue, 26 Mar 2019 09:02:44 +0000 (09:02 +0000)]
[llvm-dlltool] Set a proper machine type for weak symbol object files

This makes GNU binutils not reject the libraries outright.

GNU ld handles weak externals slightly differently though, so it
can't use them for aliases in import libraries, but this makes GNU
ld able to use the rest of the import libraries.

LLD accepted object files with machine type 0 aka
IMAGE_FILE_MACHINE_UNKNOWN.

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

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

5 years ago[ADT] Update SmallVectorTest.EmplaceBack tests after rL356312
Fangrui Song [Tue, 26 Mar 2019 05:33:52 +0000 (05:33 +0000)]
[ADT] Update SmallVectorTest.EmplaceBack tests after rL356312

rL356312 changed the return type of emplace_back from void to reference.
Update the tests to check the behavior.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] In matchBitExtract, place all of the new nodes before Node's position in the...
Craig Topper [Tue, 26 Mar 2019 05:31:32 +0000 (05:31 +0000)]
[X86] In matchBitExtract, place all of the new nodes before Node's position in the DAG for the topological sort.

We were using OrigNBits, but that put all the nodes before the node we used to start the control computation. This caused some node earlier than the sequence we inserted to be selected before the sequence we created. We want our new sequence to be selected first since it depends on OrigNBits.

I don't have a test case. Found by reviewing the code.

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

5 years ago[X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put the BEXTR...
Craig Topper [Tue, 26 Mar 2019 05:12:23 +0000 (05:12 +0000)]
[X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put the BEXTR at Node's position in the DAG for the topological sort.

We were using OrigNBits, but that doesn't guarantee that it will be selected before the nodes that make up X.

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

5 years ago[X86] Remove unneeded FIXME. NFC
Craig Topper [Tue, 26 Mar 2019 05:12:21 +0000 (05:12 +0000)]
[X86] Remove unneeded FIXME. NFC

We do fold loads right below this.

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

5 years agoX86Parser: Fix potential reference to deleted object
Craig Topper [Tue, 26 Mar 2019 03:12:43 +0000 (03:12 +0000)]
X86Parser: Fix potential reference to deleted object

Within the MatchFPUWaitAlias function, Operands[0] is potentially overwritten leading to &Op referencing a deleted object. To fix this, assign the reference after the function.

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

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

5 years agoX86AsmParser: Do not process a non-existent token
Craig Topper [Tue, 26 Mar 2019 03:12:41 +0000 (03:12 +0000)]
X86AsmParser: Do not process a non-existent token

This error can only happen if an unfinished operation is at Eof.

Patch by Brandon Jones

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

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

5 years ago[ARM] Add missing memory operands to a bunch of instructions.
Eli Friedman [Mon, 25 Mar 2019 22:42:30 +0000 (22:42 +0000)]
[ARM] Add missing memory operands to a bunch of instructions.

This should hopefully lead to minor improvements in code generation, and
more accurate spill/reload comments in assembly.

Also fix isLoadFromStackSlotPostFE/isStoreToStackSlotPostFE so they
don't lead to misleading assembly comments for merged memory operands;
this is technically orthogonal, but in practice the relevant memory
operand lists don't show up without this change.

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

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

5 years ago[x86] add tests for vector cmps; NFC
Sanjay Patel [Mon, 25 Mar 2019 22:08:45 +0000 (22:08 +0000)]
[x86] add tests for vector cmps; NFC

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

5 years agoRevert "AMDGPU: Scavenge register instead of findUnusedReg"
Matt Arsenault [Mon, 25 Mar 2019 21:41:40 +0000 (21:41 +0000)]
Revert "AMDGPU: Scavenge register instead of findUnusedReg"

This reverts r356149.

This is crashing on rocBLAS.

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

5 years agoAMDGPU: Remove unnecessary check for isFullCopy
Matt Arsenault [Mon, 25 Mar 2019 21:28:53 +0000 (21:28 +0000)]
AMDGPU: Remove unnecessary check for isFullCopy

Subregister indexes are not used for physical register operands, so
isFullCopy is implied by the physical register check.

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

5 years agoAMDGPU: Make collapse-endcf test more useful
Matt Arsenault [Mon, 25 Mar 2019 21:28:51 +0000 (21:28 +0000)]
AMDGPU: Make collapse-endcf test more useful

Without a VALU instruction in the return block, these were mostly
testing the path to delete exec mask code before s_endpgm rather than
the end cf handling.

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

5 years ago[AArch64] Prefer "mov" over "orr" to materialize constants.
Eli Friedman [Mon, 25 Mar 2019 21:25:28 +0000 (21:25 +0000)]
[AArch64] Prefer "mov" over "orr" to materialize constants.

This is generally more readable due to the way the assembler aliases
work.

(This causes a lot of test changes, but it's not really as scary as it
looks at first glance; it's just mechanically changing a bunch of checks
for orr to check for mov instead.)

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

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

5 years agoAMDGPU: Set hasSideEffects 0 on _term instructions
Matt Arsenault [Mon, 25 Mar 2019 21:10:12 +0000 (21:10 +0000)]
AMDGPU: Set hasSideEffects 0 on _term instructions

These were defaulting to true, but they are just wrappers around bit
operations. This avoids regressions in the exec mask optimization
passes in a future commit.

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

5 years agoRevert "[llvm] Prevent duplicate files in debug line header in dwarf 5."
Ali Tamur [Mon, 25 Mar 2019 21:09:07 +0000 (21:09 +0000)]
Revert "[llvm] Prevent duplicate files in debug line header in dwarf 5."

This reverts commit 312ab05887d0e2caa29aaf843cefe39379a98d36.

My commit broke the build; I will revert and find out what happened.

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

5 years ago[LLVM-C] Add binding to look up intrinsic by name
Robert Widmann [Mon, 25 Mar 2019 20:58:58 +0000 (20:58 +0000)]
[LLVM-C] Add binding to look up intrinsic by name

Summary: Add a binding to Function::lookupIntrinsicID so clients don't have to go searching the ID table themselves.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Add support for cross address space synchronization scopes
Konstantin Zhuravlyov [Mon, 25 Mar 2019 20:50:21 +0000 (20:50 +0000)]
AMDGPU: Add support for cross address space synchronization scopes

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

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

5 years ago[llvm] Prevent duplicate files in debug line header in dwarf 5.
Ali Tamur [Mon, 25 Mar 2019 20:08:00 +0000 (20:08 +0000)]
[llvm] Prevent duplicate files in debug line header in dwarf 5.

Summary:

Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Reviewers: dblaikie, probinson, aprantl, espindola

Reviewed By: probinson

Subscribers: emaste, jvesely, nhaehnle, aprantl, javed.absar, arichardson, hiraditya, MaskRay, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

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

5 years ago[SLPVectorizer] Merge reorderAltShuffleOperands into reorderInputsAccordingToOpcode
Simon Pilgrim [Mon, 25 Mar 2019 20:05:27 +0000 (20:05 +0000)]
[SLPVectorizer] Merge reorderAltShuffleOperands into reorderInputsAccordingToOpcode

As discussed on D59738, this generalizes reorderInputsAccordingToOpcode to handle multiple + non-commutative instructions so we can get rid of reorderAltShuffleOperands and make use of the extra canonicalizations that reorderInputsAccordingToOpcode brings.

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

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

5 years ago[SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC
Simon Pilgrim [Mon, 25 Mar 2019 18:51:57 +0000 (18:51 +0000)]
[SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC

First half of PR40800, this patch adds DAG undef handling to icmp instructions to match the behaviour in llvm::ConstantFoldCompareInstruction and SimplifyICmpInst, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).

This involved a lot of tweaking to reduced tests as bugpoint loves to reduce icmp arguments to undef........

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

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

5 years ago[CGP] Build the DominatorTree lazily
Teresa Johnson [Mon, 25 Mar 2019 18:38:48 +0000 (18:38 +0000)]
[CGP] Build the DominatorTree lazily

Summary:
In r355512 CGP was changed to build the DominatorTree only once per
function traversal, to avoid repeatedly building it each time it was
accessed. This solved one compile time issue but introduced another. In
the second case, we now were building the DT unnecessarily many times
when we performed many function traversals (i.e. more than once per
function when running CGP because of changes made each time).

Change to saving the DT in the CodeGenPrepare object, and building it
lazily when needed. It is reset whenever we need to rebuild it.

The case that exposed the issue there are 617 functions, and we walk
them (i.e. execute the "while (MadeChange)" loop in runOnFunction) a
total of 12083 times (so previously we were building the DT 12083
times). With this patch we only build the DT 844 times (average of 1.37
times per function). We dropped the total time to compile this file from
538.11s without this patch to 339.63s with it.

There is still an issue as CGP is taking much longer than all other
passes even with this patch, and before a recent compiler release cut at
r355392 the total time to this compile was only 97 sec with a huge
reduction in CGP time. I suspect that one of the other recent changes to
CGP led to iterating each function many more times on average, but I
need to do some more investigation.

Reviewers: spatel

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[x86] add another vector zext test; NFC
Sanjay Patel [Mon, 25 Mar 2019 17:53:56 +0000 (17:53 +0000)]
[x86] add another vector zext test; NFC

Goes with the proposal in D59777

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

5 years agoMoved everything SMT-related to LLVM and updated the cmake scripts.
Mikhail R. Gadelha [Mon, 25 Mar 2019 17:47:45 +0000 (17:47 +0000)]
Moved everything SMT-related to LLVM and updated the cmake scripts.

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

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

5 years agoMISched: Don't schedule regions with 0 instructions
Matt Arsenault [Mon, 25 Mar 2019 17:15:44 +0000 (17:15 +0000)]
MISched: Don't schedule regions with 0 instructions

I think this is correct, but may not necessarily be the correct fix
for the assertion I'm really trying to solve. If a scheduling region
was found that only has dbg_value instructions, the RegPressure
tracker would end up in an inconsistent state because it would skip
over any debug instructions and point to an instruction outside of the
scheduling region. It may still be possible for this to happen if
there are some real schedulable instructions between dbg_values, but I
haven't managed to break this.

The testcase is extremely sensitive and I'm not sure how to make it
more resistent to future scheduler changes that would avoid stressing
this situation.

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

5 years agomerge-request.sh: Update 8.0 metabug for 8.0.1
Tom Stellard [Mon, 25 Mar 2019 17:01:29 +0000 (17:01 +0000)]
merge-request.sh: Update 8.0 metabug for 8.0.1

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

5 years agoAMDGPU: Preserve LiveIntervals in WQM
Matt Arsenault [Mon, 25 Mar 2019 16:47:42 +0000 (16:47 +0000)]
AMDGPU: Preserve LiveIntervals in WQM

This seems to already be done, but wasn't marked.

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

5 years ago[llvm-objcopy]Preserve data in segments not covered by sections
James Henderson [Mon, 25 Mar 2019 16:36:26 +0000 (16:36 +0000)]
[llvm-objcopy]Preserve data in segments not covered by sections

llvm-objcopy previously knew nothing about data in segments that wasn't
covered by section headers, meaning that it wrote zeroes instead of what
was there. As it is possible for this data to be useful to the loader,
this patch causes llvm-objcopy to start preserving this data. Data in
sections that are explicitly removed continues to be written as zeroes.

This fixes https://bugs.llvm.org/show_bug.cgi?id=41005.

Reviewed by: jakehehrlich, rupprecht

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

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

5 years ago[SLPVectorizer] Update file missed in rL356913
Simon Pilgrim [Mon, 25 Mar 2019 16:14:21 +0000 (16:14 +0000)]
[SLPVectorizer] Update file missed in rL356913

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

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

5 years ago[x86] add tests for vector zext; NFC
Sanjay Patel [Mon, 25 Mar 2019 15:54:34 +0000 (15:54 +0000)]
[x86] add tests for vector zext; NFC

The AVX1 lowering is poor.

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

5 years ago[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization
Simon Pilgrim [Mon, 25 Mar 2019 15:53:55 +0000 (15:53 +0000)]
[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization

Remove attempts to commute non-Instructions to the LHS - the codegen changes appear to rely on chance more than anything else and also have a tendency to fight existing instcombine canonicalization which moves constants to the RHS of commutable binary ops.

This is prep work towards:
(a) reusing reorderInputsAccordingToOpcode for alt-shuffles and removing the similar reorderAltShuffleOperands
(b) improving reordering to optimized cases with commutable and non-commutable instructions to still find splat/consecutive ops.

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

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

5 years agoRevert 356905
Serge Guelton [Mon, 25 Mar 2019 15:18:55 +0000 (15:18 +0000)]
Revert 356905

Commited from wrong directory...

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

5 years agoPython 2/3 compat: queue vs Queue
Serge Guelton [Mon, 25 Mar 2019 15:14:15 +0000 (15:14 +0000)]
Python 2/3 compat: queue vs Queue

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

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

5 years agoMinidumpYAML.cpp: Fix some code standard violations missed during review
Pavel Labath [Mon, 25 Mar 2019 14:45:31 +0000 (14:45 +0000)]
MinidumpYAML.cpp: Fix some code standard violations missed during review

functions should begin with lower case letters. NFC.

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

5 years ago[RegAlloc] Simplify MIR test
Jonas Paulsson [Mon, 25 Mar 2019 14:28:32 +0000 (14:28 +0000)]
[RegAlloc]  Simplify MIR test

Remove the IR part from test/CodeGen/X86/regalloc-copy-hints.mir (added by
r355854).

To make the test remain functional, the parts of the MBB names referring to
BB names have been removed, as well as all machine memory operands.

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

5 years ago[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."
Brock Wyma [Mon, 25 Mar 2019 13:50:26 +0000 (13:50 +0000)]
[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."

Following r354972 the Intel JIT Listener would not report line table
information because the section indices did not match. There was
a similar issue with the PerfJitEventListener. This change performs
the section index lookup when building the object address used to
query the line table information.

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

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

5 years ago[clang-tidy] Separate the check-facing interface
Alexander Kornienko [Mon, 25 Mar 2019 12:36:30 +0000 (12:36 +0000)]
[clang-tidy] Separate the check-facing interface

Summary:
Move ClangTidyCheck to a separate header/.cpp
Switch checks to #include "ClangTidyCheck.h"
Mention ClangTidyCheck.h in the docs

Reviewers: hokein, gribozavr, aaron.ballman

Reviewed By: hokein

Subscribers: mgorny, javed.absar, xazax.hun, arphaman, jdoerfert, llvm-commits, cfe-commits

Tags: #clang, #llvm

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

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

5 years ago[llvm-objcopy] - Refactor the code. NFC.
George Rimar [Mon, 25 Mar 2019 12:34:25 +0000 (12:34 +0000)]
[llvm-objcopy] - Refactor the code. NFC.

The idea of the patch is about to move out the code to a new
helper static functions (to reduce the size of 'handleArgs' and to
isolate the parts of it's logic).

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

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

5 years ago[MIPS GlobalISel] Select copy for arguments from FPRBRegBank
Petar Avramovic [Mon, 25 Mar 2019 11:38:06 +0000 (11:38 +0000)]
[MIPS GlobalISel] Select copy for arguments from FPRBRegBank

Move selectCopy into MipsInstructionSelector class.
Select copy for arguments from FPRBRegBank for MIPS32.

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

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

5 years agogn build: Clean up README.rst a bit
Nico Weber [Mon, 25 Mar 2019 11:33:19 +0000 (11:33 +0000)]
gn build: Clean up README.rst a bit

- Make introduction a bit shorter
- Add a `git clone` step to Quick start
- Put command to run first in each of the Quick start steps
- Use ``code`` instead of `label` throughout; this is .rst not .md

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

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

5 years agogn build: Let get.py keep zip file in memory instead of using a temp file
Nico Weber [Mon, 25 Mar 2019 11:32:27 +0000 (11:32 +0000)]
gn build: Let get.py keep zip file in memory instead of using a temp file

The zip is small, and it's a bit less code this way.
No intended behavior change.

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

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

5 years ago[MIPS GlobalISel] Add floating point register bank
Petar Avramovic [Mon, 25 Mar 2019 11:30:46 +0000 (11:30 +0000)]
[MIPS GlobalISel] Add floating point register bank

Add floating point register bank for MIPS32.
Implement getRegBankFromRegClass for float register classes.

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

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

5 years ago[MIPS GlobalISel] Lower float and double arguments in registers
Petar Avramovic [Mon, 25 Mar 2019 11:23:41 +0000 (11:23 +0000)]
[MIPS GlobalISel] Lower float and double arguments in registers

Lower float and double arguments in registers for MIPS32.
When float/double argument is passed through gpr registers
select appropriate move instruction.

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

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

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Mon, 25 Mar 2019 11:02:49 +0000 (11:02 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: jhenderson, rupprecht

Subscribers: ormris, dyung, RKSimon, llvm-commits

Tags: #llvm

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

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

5 years agoFix the build with GCC 4.8 after r356783
Hans Wennborg [Mon, 25 Mar 2019 09:27:42 +0000 (09:27 +0000)]
Fix the build with GCC 4.8 after r356783

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

5 years ago[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC
Sjoerd Meijer [Mon, 25 Mar 2019 08:54:47 +0000 (08:54 +0000)]
[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC

Moving this to base class TargetTransformInfoImplCRTPBase allows static_cast to
a subtarget so that calls to e.g. getMemcpyCost actually go the overridden
functions.

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

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

5 years ago[ARM GlobalISel] 64-bit memops should be aligned
Diana Picus [Mon, 25 Mar 2019 08:54:29 +0000 (08:54 +0000)]
[ARM GlobalISel] 64-bit memops should be aligned

We currently use only VLDR/VSTR for all 64-bit loads/stores, so the
memory operands must be word-aligned. Mark aligned operations as legal
and narrow non-aligned ones to 32 bits.

While we're here, also mark non-power-of-2 loads/stores as unsupported.

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

5 years ago[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include...
Craig Topper [Mon, 25 Mar 2019 07:22:18 +0000 (07:22 +0000)]
[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include a VT for a EFLAGS result.

This makes the nodes consistent with how they would be emitted from the isel
table.

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

5 years ago[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation...
Craig Topper [Mon, 25 Mar 2019 06:53:45 +0000 (06:53 +0000)]
[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation VT for the target constant.

Normally when the nodes we use here(AND32ri8 for example) are selected their
immediates are just converted from ConstantSDNode to TargetConstantSDNode
without changing VT from the original operation VT. So we should still be
emitting them with the operation VT.

Theoretically this could expose more accurate opportunities for CSE.

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

5 years ago[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI
Craig Topper [Mon, 25 Mar 2019 06:53:44 +0000 (06:53 +0000)]
[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI

We were using this to create an AND32ri8 node from a 64-bit and, but that node
normally still uses a 32-bit immediate. So we should just truncate the existing
immediate to i32. We already verified it has the same value in bits 31:7.

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