]> granicus.if.org Git - llvm/log
llvm
5 years agoRecommit r370661 "[llvm-nm] - Add a test case for case when we dump a symbol that...
George Rimar [Mon, 2 Sep 2019 14:57:35 +0000 (14:57 +0000)]
Recommit r370661 "[llvm-nm] - Add a test case for case when we dump a symbol that belongs to a section with a broken sh_name."

Fix: add a 'consumeError()' call to ObjectFile.cpp.
This error was never checked.

Original commit message:

It adds a test case for a problem fixed by D66976 <https://reviews.llvm.org/D66976>.

It was introduced by me in D66089 <https://reviews.llvm.org/D66089>.
The error reported was never consumed because of a wrong variable name used,
so it could fail when LLVM_ENABLE_ABI_BREAKING_CHECKS is used.

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

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

5 years ago[DAGCombiner] try to form test+set out of shift+mask patterns
Sanjay Patel [Mon, 2 Sep 2019 14:52:09 +0000 (14:52 +0000)]
[DAGCombiner] try to form test+set out of shift+mask patterns

The motivating bugs are:
https://bugs.llvm.org/show_bug.cgi?id=41340
https://bugs.llvm.org/show_bug.cgi?id=42697

As discussed there, we could view this as a failure of IR canonicalization,
but then we would need to implement a backend fixup with target overrides
to get this right in all cases. Instead, we can just view this as a codegen
opportunity. It's not even clear for x86 exactly when we should favor
test+set; some CPUs have better theoretical throughput for the ALU ops than
bt/test.

This patch is made more complicated than I expected because there's an early
DAGCombine for 'and' that can change types of the intermediate ops via
trunc+anyext.

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

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

5 years agoPartially revert D61491 "AMDGPU: Be explicit about whether the high-word in SI_PC_ADD...
Jay Foad [Mon, 2 Sep 2019 14:40:57 +0000 (14:40 +0000)]
Partially revert D61491 "AMDGPU: Be explicit about whether the high-word in SI_PC_ADD_REL_OFFSET is 0"

Summary:
D61491 caused us to use relocs when they're not strictly necessary, to
refer to symbols in the text section. This is a pessimization and it's a
problem for some loaders that don't support relocs yet.

Reviewers: nhaehnle, arsenm, tpr

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[AMDGPU][MC][GFX10] Corrected constant bus checks to exclude null
Dmitry Preobrazhensky [Mon, 2 Sep 2019 14:19:52 +0000 (14:19 +0000)]
[AMDGPU][MC][GFX10] Corrected constant bus checks to exclude null

See AMD SWDEV-157286

Reviewers: atamazov, arsenm

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

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

5 years ago[FileCheck] Make NumericVariable ctor explicit
Thomas Preud'homme [Mon, 2 Sep 2019 14:04:05 +0000 (14:04 +0000)]
[FileCheck] Make NumericVariable ctor explicit

Summary:
Make FileCheckNumericVariable constructor explicit to avoid implicit
conversions from StringRef.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[FileCheck] Forbid using var defined on same line
Thomas Preud'homme [Mon, 2 Sep 2019 14:04:00 +0000 (14:04 +0000)]
[FileCheck] Forbid using var defined on same line

Summary:
Commit r366897 introduced the possibility to set a variable from an
expression, such as [[#VAR2:VAR1+3]]. While introducing this feature, it
introduced extra logic to allow using such a variable on the same line
later on. Unfortunately that extra logic is flawed as it relies on a
mapping from variable to expression defining it when the mapping is from
variable definition to expression. This flaw causes among other issues
PR42896.

This commit avoids the problem by forbidding all use of a variable
defined on the same line, and removes the now useless logic. Redesign
will be done in a later commit because it will require some amount of
refactoring first for the solution to be clean. One example is the need
for some sort of transaction mechanism to set a variable temporarily and
from an expression and rollback if the CHECK pattern does not match so
that diagnostics show the right variable values.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

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

5 years agoRevert r370661 "[llvm-nm] - Add a test case for case when we dump a symbol that belon...
George Rimar [Mon, 2 Sep 2019 14:03:50 +0000 (14:03 +0000)]
Revert r370661 "[llvm-nm] - Add a test case for case when we dump a symbol that belongs to a section with a broken sh_name"

It broke BB:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16955/steps/test/logs/stdio

Expected<T> must be checked before access or destruction.
Unchecked Expected<T> contained error:
a section [index 1] has an invalid sh_name (0xffff) offset which goes past the end of the section name string tableStack dump:
0. Program arguments: /srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm /srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/test/tools/llvm-nm/Output/format-sysv-section.test.tmp2.o --format=sysv
 #0 0x00000000008af7c4 PrintStackTraceSignalHandler(void*) (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x8af7c4)
 #1 0x00000000008ad8be llvm::sys::RunSignalHandlers() (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x8ad8be)
 #2 0x00000000008afbd8 SignalHandler(int) (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x8afbd8)
 #3 0x00007f0a6b989730 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12730)
 #4 0x00007f0a6b48d7bb raise (/lib/x86_64-linux-gnu/libc.so.6+0x377bb)
 #5 0x00007f0a6b478535 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22535)
 #6 0x000000000042004b llvm::Expected<llvm::StringRef>::fatalUncheckedExpected() const (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x42004b)
 #7 0x00000000008367f5 (/sv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x8367f5)
 #8 0x0000000000817b80 llvm::object::IRObjectFile::findBitcodeInObject(llvm::object::ObjectFile const&) (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x817b80)
 #9 0x0000000000838416 llvm::object::SymbolicFile::createSymbolicFile(llvm::MemoryBufferRef, llvm::file_magic, llvm::LLVMContext*) (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x838416)
#10 0x00000000007f36cb llvm::object::createBinary(llvm::MemoryBufferRef, llvm::LLVMContext*) (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x7f36cb)
#11 0x0000000000413123 dumpSymbolNamesFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x413123)
#12 0x0000000000412e38 main (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x412e38)
#13 0x00007f0a6b47a09b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409b)
#14 0x00000000004120da _start (/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/llvm-nm+0x4120da)
FileCheck error: '-' is empty.
FileCheck command line:  /srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/test/tools/llvm-nm/format-sysv-section.test --check-prefix=ERR

--

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

5 years ago[llvm-nm] - Add a test case for case when we dump a symbol that belongs to a section...
George Rimar [Mon, 2 Sep 2019 13:54:45 +0000 (13:54 +0000)]
[llvm-nm] - Add a test case for case when we dump a symbol that belongs to a section with a broken sh_name.

It adds a test case for a problem fixed by D66976.

It was introduced by me in D66089.
The error reported was never consumed because of a wrong variable name used,
so it could fail when LLVM_ENABLE_ABI_BREAKING_CHECKS is used.

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

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

5 years ago[AMDGPU][MC][GFX10] Enabled null with 64-bit operands
Dmitry Preobrazhensky [Mon, 2 Sep 2019 13:42:25 +0000 (13:42 +0000)]
[AMDGPU][MC][GFX10] Enabled null with 64-bit operands

See Bug 42745: https://bugs.llvm.org/show_bug.cgi?id=42745

Reviewers: atamazov, arsenm

https://reviews.llvm.org/D65231

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

5 years ago[InstCombine] recognize bswap disguised as shufflevector
Sanjay Patel [Mon, 2 Sep 2019 13:33:20 +0000 (13:33 +0000)]
[InstCombine] recognize bswap disguised as shufflevector

bitcast <N x i8> (shuf X, undef, <N, N-1,...0>) to i{N*8} --> bswap (bitcast X to i{N*8})

In PR43146:
https://bugs.llvm.org/show_bug.cgi?id=43146
...we have a more complicated case where SLP is making a mess of bswap. This patch won't
do anything for that currently, but we need to improve bswap recognition in instcombine,
SLP, and/or a standalone pass to avoid that problem.

This is limited using the data-layout so we don't try to do this transform with actual
vector types. The backend does not appear to have folds to convert in either direction,
so we don't want to mess up something that is actually better lowered as a shuffle.

On x86, we're trading something like this:

  vmovd %edi, %xmm0
  vpshufb LCPI0_0(%rip), %xmm0, %xmm0 ## xmm0 = xmm0[3,2,1,0,u,u,u,u,u,u,u,u,u,u,u,u]
  vmovd %xmm0, %eax

For:

  movl %edi, %eax
  bswapl %eax

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

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

5 years ago[test] [llvm-dlltool] Improve test strictness a little. NFC.
Martin Storsjo [Mon, 2 Sep 2019 13:28:21 +0000 (13:28 +0000)]
[test] [llvm-dlltool] Improve test strictness a little. NFC.

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

5 years ago[llvm-dlltool] Handle external and internal names with differing decoration
Martin Storsjo [Mon, 2 Sep 2019 13:28:16 +0000 (13:28 +0000)]
[llvm-dlltool] Handle external and internal names with differing decoration

Also add a missed part of the test from SVN r369747.

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

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

5 years ago[llvm-dlltool] Remove support for implying output name
Martin Storsjo [Mon, 2 Sep 2019 13:28:07 +0000 (13:28 +0000)]
[llvm-dlltool] Remove support for implying output name

I don't see GNU dlltool supporting doing this; with only a -d option
and no -l option, GNU dlltool runs successfully but doesn't write any
output file.

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

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

5 years ago[AMDGPU][MC][GFX10] Corrected constant bus limit for 64-bit shift instructions
Dmitry Preobrazhensky [Mon, 2 Sep 2019 12:50:05 +0000 (12:50 +0000)]
[AMDGPU][MC][GFX10] Corrected constant bus limit for 64-bit shift instructions

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

Reviewers: atamazov, arsenm

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

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

5 years ago[X86][BtVer2] Fix latency and throughput of conditional SIMD store instructions.
Andrea Di Biagio [Mon, 2 Sep 2019 12:32:28 +0000 (12:32 +0000)]
[X86][BtVer2] Fix latency and throughput of conditional SIMD store instructions.

On BtVer2 conditional SIMD stores are heavily microcoded.
The latency is directly proportional to the number of packed elements extracted
from the input vector. Also, according to micro-benchmarks, most of the
computation seems to be done in the integer unit.

Only a minority of the uOPs is executed by the FPU. The observed behaviour on
the FPU looks similar to this:
 - The input MASK value is moved to the Integer Unit
   -- [ a VMOVMSK-like uOP-executed on JFPU0].
 - In parallel, each element of the input XMM/YMM is extracted and then sent to
   the IntegerUnit through JFPU1.

As expected, a (conditional) store is executed for every extracted element.
Interestingly, a (speculative) load is executed for every extracted element too.
It is as-if a "LOAD - BIT_EXTRACT- CMOV" sequence of uOPs is repeated by the
integer unit for every contionally stored element.
VMASKMOVDQU is a special case: the number of speculative loads is always 2
(presumably, one load per quadword). That means, extra shifts and masking is
performed on (one of) the loaded quadwords before each conditional store (that
also explains the big number of non-FP uOPs retired).

This patch replaces the existing writes for conditional SIMD stores (i.e.
WriteFMaskedStore, and WriteFMaskedStoreY) with the following new writes:

  WriteFMaskedStore32  [ XMM Packed Single ]
  WriteFMaskedStore32Y [ YMM Packed Single ]
  WriteFMaskedStore64  [ XMM Packed Double ]
  WriteFMaskedStore64Y [ YMM Packed Double ]

Added a wrapper class named X86SchedWriteMaskMove in X86Schedule.td to describe
both RM and MR variants for conditional SIMD moves in a single tablegen
definition.
Instances of that class are then passed in input to multiclass avx_movmask_rm
when constructing MASKMOVPS/PD definitions.

Since this patch introduces new writes, I had to update all the X86 scheduling
models.

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

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

5 years ago[DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations
Jeremy Morse [Mon, 2 Sep 2019 12:28:36 +0000 (12:28 +0000)]
[DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations

The missing line added by this patch ensures that only spilt variable
locations are candidates for being restored from the stack. Otherwise,
register or constant-value information can be interpreted as a spill
location, through a union.

The added regression test replicates a scenario where this occurs: the
stack load from [rsp] causes the register-location DBG_VALUE to be
"restored" to rsi, when it should be left alone. See PR43058 for details.

Un x-fail a test that was suffering from this from a previous patch.

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

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

5 years ago[llvm-strings][test] Merge two closely related tests
James Henderson [Mon, 2 Sep 2019 11:42:30 +0000 (11:42 +0000)]
[llvm-strings][test] Merge two closely related tests

This is a follow-up to feedback on D66015.

Reviewed by: grimar

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

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

5 years agoRevert [Clang Interpreter] Initial patch for the constexpr interpreter
Nandor Licker [Mon, 2 Sep 2019 11:34:47 +0000 (11:34 +0000)]
Revert [Clang Interpreter] Initial patch for the constexpr interpreter

This reverts r370636 (git commit 8327fed9475a14c3376b4860c75370c730e08f33)

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

5 years ago[X86] combineHorizontalPredicateResult - pull out repeated getTargetLoweringInfo...
Simon Pilgrim [Mon, 2 Sep 2019 10:42:48 +0000 (10:42 +0000)]
[X86] combineHorizontalPredicateResult - pull out repeated getTargetLoweringInfo() calls. NFCI.

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

5 years ago[Clang Interpreter] Initial patch for the constexpr interpreter
Nandor Licker [Mon, 2 Sep 2019 10:38:08 +0000 (10:38 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter

Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

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

5 years ago[AMDGPU] Add test
Piotr Sobczak [Mon, 2 Sep 2019 10:02:54 +0000 (10:02 +0000)]
[AMDGPU] Add test

Summary:
Add test checking that the redundant immediate MOV instruction
(by-product of handling phi nodes) is not found in the generated code.

Reviewers: arsenm, anton-afanasyev, craig.topper, rtereshin, bogner

Reviewed By: arsenm

Subscribers: kzhuravl, yaxunl, dstuttard, tpr, t-tye, wdng, jvesely, nhaehnle, llvm-commits

Tags: #llvm

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

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

5 years ago[yaml2obj] - Allow overriding sh_name fields of the sections.
George Rimar [Mon, 2 Sep 2019 09:47:17 +0000 (09:47 +0000)]
[yaml2obj] - Allow overriding sh_name fields of the sections.

This is in line with the previous changes which allowed to
override the sh_offset/sh_size and useful for writing test cases.

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

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

5 years ago[DWARFVerifier] Verify GNU extensions of call site DWARF symbols
Djordje Todorovic [Mon, 2 Sep 2019 09:20:46 +0000 (09:20 +0000)]
[DWARFVerifier] Verify GNU extensions of call site DWARF symbols

Verify that the call site DWARF symbols (added during the implementation
of the debug entry values feature) are generated properly.

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

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

5 years ago[AArch64][GlobalISel] Fix zext narrowScalar to use the right type when creating
Amara Emerson [Mon, 2 Sep 2019 08:18:55 +0000 (08:18 +0000)]
[AArch64][GlobalISel] Fix zext narrowScalar to use the right type when creating
the merges.

Fixes PR43171.

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

5 years ago[X86] Add initial support for unfolding broadcast loads from arithmetic instructions...
Craig Topper [Sun, 1 Sep 2019 22:14:36 +0000 (22:14 +0000)]
[X86] Add initial support for unfolding broadcast loads from arithmetic instructions to enable LICM hoisting of the load

MachineLICM can hoist an invariant load, but if that load is folded it needs to be unfolded. On AVX512 sometimes this load is an broadcast load which we were previously unable to unfold. This patch adds initial support for that with a very basic list of supported instructions as a starting point.

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

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

5 years ago[DAGCombiner] improve throughput of shift+logic+shift
Sanjay Patel [Sun, 1 Sep 2019 18:38:15 +0000 (18:38 +0000)]
[DAGCombiner] improve throughput of shift+logic+shift

The motivating case for this is a long way from here:
https://bugs.llvm.org/show_bug.cgi?id=43146
...but I think this is where we have to start.

We need to canonicalize/optimize sequences of shift and logic to ease
pattern matching for things like bswap and improve perf in general.
But without the artificial limit of '!LegalTypes' (early combining),
there are a lot of test diffs, and not all are good.

In the minimal tests added for this proposal, x86 should have better
throughput in all cases. AArch64 is neutral for scalar tests because
it can fold shifts into bitwise logic ops.

There are 3 shift opcodes and 3 logic opcodes for a total of 9 possible patterns:
https://rise4fun.com/Alive/VlI
https://rise4fun.com/Alive/n1m
https://rise4fun.com/Alive/1Vn

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

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

5 years agoFix MSVC unreferenced formal parameter warning. NFCI.
Simon Pilgrim [Sun, 1 Sep 2019 16:04:51 +0000 (16:04 +0000)]
Fix MSVC unreferenced formal parameter warning. NFCI.

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

5 years agoFix MSVC unreferenced formal parameter warning. NFCI.
Simon Pilgrim [Sun, 1 Sep 2019 16:04:38 +0000 (16:04 +0000)]
Fix MSVC unreferenced formal parameter warning. NFCI.

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

5 years ago[X86][AVX] Rename + cleanup lowerShuffleAsLanePermuteAndBlend. NFCI.
Simon Pilgrim [Sun, 1 Sep 2019 16:04:28 +0000 (16:04 +0000)]
[X86][AVX] Rename + cleanup lowerShuffleAsLanePermuteAndBlend. NFCI.

Rename to lowerShuffleAsLanePermuteAndShuffle to make it clear that not just blends are performed.

Cleanup the in-lane shuffle mask generation to make it more obvious what's going on.

Some prep work noticed while investigating the poor shuffle code mentioned in D66004.

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

5 years agoFix shadow variable warning. NFCI.
Simon Pilgrim [Sun, 1 Sep 2019 13:10:18 +0000 (13:10 +0000)]
Fix shadow variable warning. NFCI.

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

5 years ago[ConstantFolding] Fix 'undef' folding for @llvm.[us]{add,sub}.with.overflow ops ...
Roman Lebedev [Sun, 1 Sep 2019 11:56:52 +0000 (11:56 +0000)]
[ConstantFolding] Fix 'undef' folding for @llvm.[us]{add,sub}.with.overflow ops (PR43188)

As we have already established/fixed in
  https://bugs.llvm.org/show_bug.cgi?id=42209
  https://reviews.llvm.org/D63065
  https://reviews.llvm.org/rL363522
the InstSimplify handling for @llvm.with.overflow ops with undefs
is correct. Therefore if ConstantFolding produces different results,
then it is wrong.

This duplication of code hints at the need for some refactoring,
but for now address the brokenness of ConstantFolding by
copying the known-good handling from rL363522.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43188

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

5 years ago[ARM] Remove MVE masked loads/stores
David Green [Sun, 1 Sep 2019 10:11:40 +0000 (10:11 +0000)]
[ARM] Remove MVE masked loads/stores

These were never enabled correctly and are causing other problems. Taking them
out for the moment, whilst we work on the issues.

This reverts r370329.

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

5 years ago[TargetLowering] Fix Bugzilla ID 43183 to avoid soften comparison broken with constan...
Shiva Chen [Sun, 1 Sep 2019 04:52:54 +0000 (04:52 +0000)]
[TargetLowering] Fix Bugzilla ID 43183 to avoid soften comparison broken with constant inputs

Summary:
  This fixes the bugzilla id 43183 which triggerd by the following commit:
  [RISCV] Avoid generating AssertZext for LP64 ABI when lowering floating LibCall

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

5 years agoAMDGPU: Remove unused custom node definition
Matt Arsenault [Sun, 1 Sep 2019 02:00:08 +0000 (02:00 +0000)]
AMDGPU: Remove unused custom node definition

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

5 years ago[GlobalISel][NFC] Regression test cases for aarch64 legalizer (s128 sext+icmp).
Puyan Lotfi [Sun, 1 Sep 2019 00:45:28 +0000 (00:45 +0000)]
[GlobalISel][NFC] Regression test cases for aarch64 legalizer (s128 sext+icmp).

There were legalizer asserts in aarch64 globalisel (in debug mode) with s128
sext+icmp before r367060 and r366943 landed. These are just a couple reduced
mir and ir regression tests that came from a build where these were encountered.

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

5 years ago[X86] Replace some COPY_TO_REGCLASS from GR32/GR64 to VR128 in isel patterns with...
Craig Topper [Sat, 31 Aug 2019 23:52:25 +0000 (23:52 +0000)]
[X86] Replace some COPY_TO_REGCLASS from GR32/GR64 to VR128 in isel patterns with VMOVDI2PDIrr/VMOV64toPQIrr.

This is what the copies will eventually be turned into. We don't
use COPY_TO_REGCLASS for scalar_to_vector patterns. So we should
use the real instruction here too.

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

5 years ago[X86] Compress the flag bits in the folding tables to make room for more bits in...
Craig Topper [Sat, 31 Aug 2019 23:52:21 +0000 (23:52 +0000)]
[X86] Compress the flag bits in the folding tables to make room for more bits in an upcoming patch.

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

5 years ago[NFC] Fixed -Wdocumentation warning
David Bolvansky [Sat, 31 Aug 2019 18:44:57 +0000 (18:44 +0000)]
[NFC] Fixed -Wdocumentation warning

/srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def:98:1: warning: not a Doxygen trailing comment [-Wdocumentation]
1 warning generated.

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

5 years ago[InstCombine] mempcpy(d,s,n) to memcpy(d,s,n) + n
David Bolvansky [Sat, 31 Aug 2019 18:19:05 +0000 (18:19 +0000)]
[InstCombine] mempcpy(d,s,n) to memcpy(d,s,n) + n

Summary:
Back-end currently expands mempcpy, but middle-end should work with memcpy instead of mempcpy to enable more memcpy-optimization.

GCC backend emits mempcpy, so LLVM backend could form it too, if we know mempcpy libcall is better than memcpy + n.
https://godbolt.org/z/dOCG96

Reviewers: efriedma, spatel, craig.topper, RKSimon, jdoerfert

Reviewed By: efriedma

Subscribers: hjl.tools, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] EltsFromConsecutiveLoads - Don't confuse elt count with vector element count...
Simon Pilgrim [Sat, 31 Aug 2019 16:21:31 +0000 (16:21 +0000)]
[X86] EltsFromConsecutiveLoads - Don't confuse elt count with vector element count (PR43170)

EltsFromConsecutiveLoads was assuming that the number of input elts was the same as the number of elements in the output vector type when creating a zeroing shuffle, causing an assert when subvectors were being combined instead of just scalars.

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

5 years ago[X86][AVX512] Regenerate tests with common prefixes
Simon Pilgrim [Sat, 31 Aug 2019 16:04:39 +0000 (16:04 +0000)]
[X86][AVX512] Regenerate tests with common prefixes

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

5 years ago[AArch64][x86] increase value type coverage in tests; NFC
Sanjay Patel [Sat, 31 Aug 2019 15:49:16 +0000 (15:49 +0000)]
[AArch64][x86] increase value type coverage in tests; NFC
This goes with D67021.

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

5 years agoFix shadow variable warning by making CondCodes names more explicit. NFCI.
Simon Pilgrim [Sat, 31 Aug 2019 15:19:59 +0000 (15:19 +0000)]
Fix shadow variable warning by making CondCodes names more explicit. NFCI.

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

5 years agoRevert [Clang Interpreter] Initial patch for the constexpr interpreter
Nandor Licker [Sat, 31 Aug 2019 15:15:39 +0000 (15:15 +0000)]
Revert [Clang Interpreter] Initial patch for the constexpr interpreter

This reverts r370584 (git commit afcb3de117265a69d21e5673356e925a454d7d02)

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

5 years ago[DAGCombiner] clean up code in visitShiftByConstant()
Sanjay Patel [Sat, 31 Aug 2019 15:08:58 +0000 (15:08 +0000)]
[DAGCombiner] clean up code in visitShiftByConstant()

This is not quite NFC because the SDLoc propagation is changed,
but there are no regression test diffs from that.

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

5 years agoFix shadow variable warning. NFCI.
Simon Pilgrim [Sat, 31 Aug 2019 15:01:03 +0000 (15:01 +0000)]
Fix shadow variable warning. NFCI.

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

5 years ago[Clang Interpreter] Initial patch for the constexpr interpreter
Nandor Licker [Sat, 31 Aug 2019 15:00:38 +0000 (15:00 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter

Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

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

5 years ago[X86ISelLowering] combineCMov - cleanup CMOV->LEA codegen. NFCI.
Simon Pilgrim [Sat, 31 Aug 2019 14:18:26 +0000 (14:18 +0000)]
[X86ISelLowering] combineCMov - cleanup CMOV->LEA codegen. NFCI.

Only compute the diff once and we don't need the truncation code (assert the bitwidth is correct just to be safe).

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

5 years ago[X86ISelLowering] LowerSELECT - remove duplicate value type. NFCI.
Simon Pilgrim [Sat, 31 Aug 2019 13:14:52 +0000 (13:14 +0000)]
[X86ISelLowering] LowerSELECT - remove duplicate value type. NFCI.

VT of SELECT result and selection ops will be the same.

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

5 years agoFix cppcheck shadow variable and variable scope warnings. NFCI.
Simon Pilgrim [Sat, 31 Aug 2019 12:30:19 +0000 (12:30 +0000)]
Fix cppcheck shadow variable and variable scope warnings. NFCI.

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

5 years ago[DAGCombiner] Match (add X, X) as (shl X, 1) when detecting rotate.
Amaury Sechet [Sat, 31 Aug 2019 11:40:02 +0000 (11:40 +0000)]
[DAGCombiner] Match (add X, X) as (shl X, 1) when detecting rotate.

Summary: The combiner transforms (shl X, 1) into (add X, X).

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objcopy] Simplify alignToAddr with llvm::alignTo
Fangrui Song [Sat, 31 Aug 2019 10:48:09 +0000 (10:48 +0000)]
[llvm-objcopy] Simplify alignToAddr with llvm::alignTo

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

5 years ago[DAGCombiner] Don't create illegal narrow stores
James Molloy [Sat, 31 Aug 2019 10:46:16 +0000 (10:46 +0000)]
[DAGCombiner] Don't create illegal narrow stores

Narrowing stores when the target doesn't support the narrow version
forces the target to expand into a load-modify-store sequence, which
is highly suboptimal. The information narrowing throws away (legality
of the inverse transform) is hard to re-analyze. If the target doesn't
support a store of the narrow type, don't narrow even in pre-legalize
mode.

No test as this is DAGCombiner and depends on target bits.

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

5 years ago[LVI] Extract solveBlockValueExtractValue(); NFC
Nikita Popov [Sat, 31 Aug 2019 09:58:50 +0000 (09:58 +0000)]
[LVI] Extract solveBlockValueExtractValue(); NFC

Extract this method in preparation for additional extractvalue
support.

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

5 years ago[CVP] Add tests for simplified with.overflow + icmp; NFC
Nikita Popov [Sat, 31 Aug 2019 09:58:42 +0000 (09:58 +0000)]
[CVP] Add tests for simplified with.overflow + icmp; NFC

These tests are based on D19867.

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

5 years ago[CVP] Generate simpler code for elided with.overflow intrinsics
Nikita Popov [Sat, 31 Aug 2019 09:58:37 +0000 (09:58 +0000)]
[CVP] Generate simpler code for elided with.overflow intrinsics

Use a { iN undef, i1 false } struct as the base, and only insert
the first operand, instead of using { iN undef, i1 undef } as the
base and inserting both. This is the same as what we do in InstCombine.

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

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

5 years ago[CodeGen] Refactor DAGTypeLegalizer::ExpandIntRes_MULFIX. NFC
Bjorn Pettersson [Sat, 31 Aug 2019 09:28:50 +0000 (09:28 +0000)]
[CodeGen] Refactor DAGTypeLegalizer::ExpandIntRes_MULFIX. NFC

Restructured the code a little bit in preparation for adding
UMULFIXSAT. I think it will be easier to understand the code
if not interleaving the codegen for signed/unsigned/saturated
cases that much.

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

5 years ago[LangRef] Update saturating examples for llvm.smul.fix.sat. NFC
Bjorn Pettersson [Sat, 31 Aug 2019 09:01:16 +0000 (09:01 +0000)]
[LangRef] Update saturating examples for llvm.smul.fix.sat. NFC

Some saturation examples for llvm.smul.fix.sat were not showing
the correct result. I've adjusted the operands to make sure that
we actually trigger overflow in those examples.

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

5 years agoFix some errors introduced by rL370563 which were not exposed on my local machine.
Wei Mi [Sat, 31 Aug 2019 03:17:49 +0000 (03:17 +0000)]
Fix some errors introduced by rL370563 which were not exposed on my local machine.
1. zlib::compress accept &size_t but the param is an uint64_t.
2. Some systems don't have zlib installed. Don't use compression by default.

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

5 years ago[SampleFDO] Add profile symbol list section to discriminate function being
Wei Mi [Sat, 31 Aug 2019 02:27:26 +0000 (02:27 +0000)]
[SampleFDO] Add profile symbol list section to discriminate function being
cold versus function being newly added.

This is the second half of https://reviews.llvm.org/D66374.

Profile symbol list is the collection of function symbols showing up in
the binary which generates the current profile. It is used to discriminate
function being cold versus function being newly added. Profile symbol list
is only added for profile with ExtBinary format.

During profile use compilation, when profile-sample-accurate is enabled,
a function without profile will be regarded as cold only when it is
contained in that list.

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

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

5 years agollvm-dwarfdump: Cache CU low_pc when computing statistics.
David Blaikie [Sat, 31 Aug 2019 01:05:46 +0000 (01:05 +0000)]
llvm-dwarfdump: Cache CU low_pc when computing statistics.

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

5 years ago[WebAssembly] Add SIMD QFMA/QFMS
Thomas Lively [Sat, 31 Aug 2019 00:12:29 +0000 (00:12 +0000)]
[WebAssembly] Add SIMD QFMA/QFMS

Summary:
Adds clang builtins and LLVM intrinsics for these experimental
instructions. They are not implemented in engines yet, but that is ok
because the user must opt into using them by calling the builtins.

Reviewers: aheejin, dschuff

Reviewed By: aheejin

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

Tags: #clang, #llvm

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

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

5 years ago[lit] Only set DYLD_LIBRARY_PATH for shared builds
Jonas Devlieghere [Fri, 30 Aug 2019 23:16:02 +0000 (23:16 +0000)]
[lit] Only set DYLD_LIBRARY_PATH for shared builds

In r370135 I committed a temporary workaround for the sanitized bot to
not set (DY)LD_LIBRARY_PATH when (DY)LD_INSERT_LIBRARIES was set.
Setting (DY)LD_LIBRARY_PATH is only necessary for (standalone)
shared-library builds, so a better solution is to only set the
environment variable when necessary.

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

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

5 years ago[MemorySSA] Rename all phi entries.
Alina Sbirlea [Fri, 30 Aug 2019 23:02:53 +0000 (23:02 +0000)]
[MemorySSA] Rename all phi entries.

When renaming Phis incoming values, there may be multiple edges incoming
from the same block (switch). Rename all.

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

5 years ago[GVN] Verify value equality before doing phi translation for call instruction
Wei Mi [Fri, 30 Aug 2019 23:01:22 +0000 (23:01 +0000)]
[GVN] Verify value equality before doing phi translation for call instruction

This is an updated version of https://reviews.llvm.org/D66909 to fix PR42605.

Basically, current phi translatation translates an old value number to an new
value number for a call instruction based on the literal equality of call
expression, without verifying there is no clobber in between. This is incorrect.

To get a finegrain check, use MachineDependence analysis to do the job. However,
this is still not ideal. Although given a call instruction,
`MemoryDependenceResults::getCallDependencyFrom` returns identical call
instructions without clobber in between using MemDepResult with its DepType to
be `Def`. However, identical is too strict here and we want it to be relaxed a
little to consider phi-translation -- callee is the same, param operands can be
different. That means changing the semantic of `MemDepResult::Def` and I don't
know the potential impact.

So currently the patch is still conservative to only handle
MemDepResult::NonFuncLocal, which means the current call has no function local
clobber. If there is clobber, even if the clobber doesn't stand in between the
current call and the call with the new value, we won't do phi-translate.

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

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

5 years agoFix SEH_NoReturn machine verifier error
Reid Kleckner [Fri, 30 Aug 2019 22:40:51 +0000 (22:40 +0000)]
Fix SEH_NoReturn machine verifier error

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

5 years ago[MC] Avoid crashes from improperly nested or wrong target .seh_handlerdata directives
Reid Kleckner [Fri, 30 Aug 2019 22:25:55 +0000 (22:25 +0000)]
[MC] Avoid crashes from improperly nested or wrong target .seh_handlerdata directives

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

5 years ago[X86] Print register names in .seh_* directives
Reid Kleckner [Fri, 30 Aug 2019 21:23:05 +0000 (21:23 +0000)]
[X86] Print register names in .seh_* directives

Also improve assembler parser register validation for .seh_ directives.
This requires moving X86-specific seh directive handling into the x86
backend, which addresses some assembler FIXMEs.

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

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

5 years ago[x86] add tests for shift-logic-shift; NFC
Sanjay Patel [Fri, 30 Aug 2019 20:51:51 +0000 (20:51 +0000)]
[x86] add tests for shift-logic-shift; NFC

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

5 years ago[AArch64] add tests for shift-logic-shift; NFC
Sanjay Patel [Fri, 30 Aug 2019 20:48:43 +0000 (20:48 +0000)]
[AArch64] add tests for shift-logic-shift; NFC

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

5 years ago[Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn
Reid Kleckner [Fri, 30 Aug 2019 20:46:39 +0000 (20:46 +0000)]
[Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn

Users have complained llvm.trap produce two ud2 instructions on Win64,
one for the trap, and one for unreachable. This change fixes that.

TrapUnreachable was added and enabled for Win64 in r206684 (April 2014)
to avoid poorly understood issues with the Windows unwinder.

There seem to be two major things in play:
- the unwinder
- C++ EH, _CxxFrameHandler3 & co

The unwinder disassembles forward from the return address to scan for
epilogues. Inserting a ud2 had the effect of stopping the unwinder, and
ensuring that it ran the EH personality function for the current frame.
However, it's not clear what the unwinder does when the return address
happens to be the last address of one function and the first address of
the next function.

The Visual C++ EH personality, _CxxFrameHandler3, needs to figure out
what the current EH state number is. It does this by consulting the
ip2state table, which maps from PC to state number. This seems to go
wrong when the return address is the last PC of the function or catch
funclet.

I'm not sure precisely which system is involved here, but in order to
address these real or hypothetical problems, I believe it is enough to
insert int3 after a call site if it would otherwise be the last
instruction in a function or funclet.  I was able to reproduce some
similar problems locally by arranging for a noreturn call to appear at
the end of a catch block immediately before an unrelated function, and I
confirmed that the problems go away when an extra trailing int3
instruction is added.

MSVC inserts int3 after every noreturn function call, but I believe it's
only necessary to do it if the call would be the last instruction. This
change inserts a pseudo instruction that expands to int3 if it is in the
last basic block of a function or funclet. I did what I could to run the
Microsoft compiler EH tests, and the ones I was able to run showed no
behavior difference before or after this change.

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

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

5 years ago[IFS][NFC] llvm-ifs: Fixing build bot build break: revert r370517 and r370510.
Puyan Lotfi [Fri, 30 Aug 2019 20:25:46 +0000 (20:25 +0000)]
[IFS][NFC] llvm-ifs: Fixing build bot build break: revert r370517 and r370510.

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

5 years ago[Thumb2] tighten CHECK lines in test; NFC
Sanjay Patel [Fri, 30 Aug 2019 20:15:01 +0000 (20:15 +0000)]
[Thumb2] tighten CHECK lines in test; NFC

The sequence between the function call and the asm start
may change without affecting what this test is looking for,
but we should have a better idea about what that sequence
looks like.

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

5 years ago[IFS][NFC] llvm-ifs: Fixing build bot error due to commit conflicts.
Puyan Lotfi [Fri, 30 Aug 2019 20:09:55 +0000 (20:09 +0000)]
[IFS][NFC] llvm-ifs: Fixing build bot error due to commit conflicts.

r370510 and r370504

Again only on gcc.

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

5 years agogn build: Merge r370512
Nico Weber [Fri, 30 Aug 2019 20:06:44 +0000 (20:06 +0000)]
gn build: Merge r370512

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

5 years ago[X86] Fix mul test cases in avx512-broadcast-unfold.ll to not get canonicalized to...
Craig Topper [Fri, 30 Aug 2019 20:04:23 +0000 (20:04 +0000)]
[X86] Fix mul test cases in avx512-broadcast-unfold.ll to not get canonicalized to fadd. Remove the fsub test cases which were also testing fadd.

Not sure how to prevent an fsub by constant getting turned into an fadd by negative constant.

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

5 years ago[IFS][NFC] llvm-ifs: Fixing build errors for bots using GCC.
Puyan Lotfi [Fri, 30 Aug 2019 19:54:46 +0000 (19:54 +0000)]
[IFS][NFC] llvm-ifs: Fixing build errors for bots using GCC.

gcc produces the error:

error: specialization of
‘template<class T, class Enable> struct llvm::yaml::ScalarTraits’ in
different namespace

For all specializations outside of llvm::yaml. So I added llvm::yaml to these
specializations to fix the errors on the bots building with gcc (/usr/bin/c++).

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

5 years ago[DFAPacketizer] Allow namespacing of automata per-itinerary
James Molloy [Fri, 30 Aug 2019 19:50:49 +0000 (19:50 +0000)]
[DFAPacketizer] Allow namespacing of automata per-itinerary

The Hexagon itineraries are cunningly crafted such that functional units between
itineraries do not clash. Because all itineraries are bundled into the same DFA,
a functional unit index clash would cause an incorrect DFA to be generated.

A workaround for this is to ensure all itineraries declare the universe of all
possible functional units, but this isn't ideal for three reasons:
  1) We only have a limited number of FUs we can encode in the packetizer, and
     using the universe causes us to hit the limit without care.
  2) Silent codegen faults are bad, and careful triage of the FU list shouldn't
     be required.
  3) Smooshing all itineraries into the same automaton allows combinations of
     instruction classes that cannot exist, which bloats the table.

A simple solution is to allow "namespacing" packetizers.

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

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

5 years ago[X86] Regenerate the test cases added in r370506.
Craig Topper [Fri, 30 Aug 2019 19:42:48 +0000 (19:42 +0000)]
[X86] Regenerate the test cases added in r370506.

Something weird happened with the v2i64/v2f64 test cases which
don't use broadcast. So they should already be hoisted, but
weren't in the version I submitted in r370506. This fixes that.
Not sure if something changed or I screwed up.

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

5 years ago[X86] Add test caes for opportunities for machine LICM to unfold broadcasted constant...
Craig Topper [Fri, 30 Aug 2019 19:26:06 +0000 (19:26 +0000)]
[X86] Add test caes for opportunities for machine LICM to unfold broadcasted constant pool loads.

MachineLICM is able to unfold loads to move an invariant load out
a loop, but X86 infrastructure currently lacks the ability to do
this when avx512 embedded broadcasting is used.

This test adds examples for the basic float point operations,
add, mul, and, or, and xor.

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

5 years ago[PowerPC][NFC] Avoid checking non-relevant .cfi instructions
Jinsong Ji [Fri, 30 Aug 2019 19:24:25 +0000 (19:24 +0000)]
[PowerPC][NFC] Avoid checking non-relevant .cfi instructions

Summary:
This is brought up in
https://reviews.llvm.org/D64662?id=209923#inline-599490

CFI information are non-relevant to quite some testcases,
we should get rid of checking them when its unecessary.

This patch avoid generating cfi info in testcases that are not
testing prolog/epilog or exception handling.

Reviewers: kbarton, hfinkel, nemanjai, #powerpc

Reviewed By: hfinkel

Subscribers: MaskRay, shchenz, llvm-commits

Tags: #llvm

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

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

5 years agoFix compilation warnings. NFC.
Michael Liao [Fri, 30 Aug 2019 19:23:28 +0000 (19:23 +0000)]
Fix compilation warnings. NFC.

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

5 years agogn build: Merge r370500
Nico Weber [Fri, 30 Aug 2019 18:55:11 +0000 (18:55 +0000)]
gn build: Merge r370500

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

5 years ago[MachinePipeliner] Separate schedule emission, NFC
James Molloy [Fri, 30 Aug 2019 18:49:50 +0000 (18:49 +0000)]
[MachinePipeliner] Separate schedule emission, NFC

This is the first stage in refactoring the pipeliner and making it more
accessible for backends to override and control. This separates the logic and
state required to *emit* a scheudule from the logic that *computes* and
validates a schedule.

This will enable (a) new schedule emitters and (b) new modulo scheduling
implementations to coexist.

NFC.

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

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

5 years ago[llvm-ifs][IFS] llvm Interface Stubs merging + object file generation tool.
Puyan Lotfi [Fri, 30 Aug 2019 18:26:05 +0000 (18:26 +0000)]
[llvm-ifs][IFS] llvm Interface Stubs merging + object file generation tool.

This tool merges interface stub files to produce a merged interface stub file
or a stub library. Currently it for stub library generation it can produce an
ELF .so stub file, or a TBD file (experimental). It will be used by the clang
-emit-interface-stubs compilation pipeline to merge and assemble the per-CU
stub files into a stub library.

The new IFS format is as follows:

--- !experimental-ifs-v1
IfsVersion:      1.0
Triple:          <llvm triple>
ObjectFileFormat: <ELF | TBD>
Symbols:
  _ZSymbolName: { Type: <type>, etc... }
...

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

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

5 years ago[DAGCombine] ReduceLoadWidth - remove duplicate SDLoc. NFCI.
Simon Pilgrim [Fri, 30 Aug 2019 18:19:02 +0000 (18:19 +0000)]
[DAGCombine] ReduceLoadWidth - remove duplicate SDLoc. NFCI.

SDLoc(N0) and SDLoc(cast<LoadSDNode>(N0)) should be equivalent.

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

5 years ago[TargetLowering] SimplifyDemandedBits ADD/SUB/MUL - correctly inherit SDNodeFlags...
Simon Pilgrim [Fri, 30 Aug 2019 17:58:55 +0000 (17:58 +0000)]
[TargetLowering] SimplifyDemandedBits ADD/SUB/MUL - correctly inherit SDNodeFlags from the original node.

Just disable NSW/NUW flags. This matches what we're already doing for the other situations for these nodes, it was just missed for the demanded constant case.

Noticed by inspection - confirmed in offline discussion with @spatel. I've checked we have test coverage in the x86 extract-bits.ll and extract-lowbits.ll tests

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

5 years agoGlobalISel: Fix missing pass dependency
Matt Arsenault [Fri, 30 Aug 2019 17:41:58 +0000 (17:41 +0000)]
GlobalISel: Fix missing pass dependency

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

5 years ago[X86] Pass v32i16/v64i8 in zmm registers on KNL target.
Craig Topper [Fri, 30 Aug 2019 17:35:08 +0000 (17:35 +0000)]
[X86] Pass v32i16/v64i8 in zmm registers on KNL target.

gcc and icc pass these types in zmm registers in zmm registers.

This patch implements a quick hack to override the register
type before calling convention handling to one that is legal.
Longer term we might want to do something similar to 256-bit
integer registers on AVX1 where we just split all the operations.

Fixes PR42957

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

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

5 years ago[ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName
Craig Topper [Fri, 30 Aug 2019 17:34:29 +0000 (17:34 +0000)]
[ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName

Missed these when I hadded the enum entries

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

5 years agogn build: Merge r370490
Nico Weber [Fri, 30 Aug 2019 17:30:08 +0000 (17:30 +0000)]
gn build: Merge r370490

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

5 years agoMemTag: unchecked load/store optimization.
Evgeniy Stepanov [Fri, 30 Aug 2019 17:23:02 +0000 (17:23 +0000)]
MemTag: unchecked load/store optimization.

Summary:
MTE allows memory access to bypass tag check iff the address argument
is [SP, #imm]. This change takes advantage of this to demote uses of
tagged addresses to regular FrameIndex operands, reducing register
pressure in large functions.

MO_TAGGED target flag is used to signal that the FrameIndex operand
refers to memory that might be tagged, and needs to be handled with
care. Such operand must be lowered to [SP, #imm] directly, without a
scratch register.

The transformation pass attempts to predict when the offset will be
out of range and disable the optimization.
AArch64RegisterInfo::eliminateFrameIndex has an escape hatch in case
this prediction has been wrong, but it is quite inefficient and should
be avoided.

Reviewers: pcc, vitalybuka, ostannard

Subscribers: mgorny, javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[DAGCombine] visitVSELECT - remove equivalent getValueType() call. NFCI.
Simon Pilgrim [Fri, 30 Aug 2019 17:21:20 +0000 (17:21 +0000)]
[DAGCombine] visitVSELECT - remove equivalent getValueType() call. NFCI.

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

5 years ago[INSTRUCTIONS] Add support of const for getLoadStorePointerOperand() and
Whitney Tsang [Fri, 30 Aug 2019 16:41:35 +0000 (16:41 +0000)]
[INSTRUCTIONS] Add support of const for getLoadStorePointerOperand() and
getLoadStorePointerOperand().
Reviewer: hsaito, sebpop, reames, hfinkel, mkuper, bogner, haicheng,
arsenm, lattner, chandlerc, grosser, rengolin
Reviewed By: reames
Subscribers: wdng, llvm-commits, bmahjour
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66595

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

5 years ago[Attributor] Fix: do not pretend to preserve the CFG
Johannes Doerfert [Fri, 30 Aug 2019 16:35:10 +0000 (16:35 +0000)]
[Attributor] Fix: do not pretend to preserve the CFG

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

5 years ago[X86] Merge X86InstrInfo::loadRegFromAddr/storeRegToAddr into their only call site.
Craig Topper [Fri, 30 Aug 2019 16:05:57 +0000 (16:05 +0000)]
[X86] Merge X86InstrInfo::loadRegFromAddr/storeRegToAddr into their only call site.

I'm looking at unfolding broadcast loads on AVX512 which will
require refactoring this code to select broadcast opcodes instead
of regular load/stores in some cases. Merging them to avoid
further complicating their interfaces.

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

5 years ago[Attributor] Use existing function information for the call site
Johannes Doerfert [Fri, 30 Aug 2019 15:24:52 +0000 (15:24 +0000)]
[Attributor] Use existing function information for the call site

Summary:
Instead of recomputing information for call sites we now use the
function information directly. This is always valid and once we have
call site specific information we can improve here.

This patch also bootstraps attributes that are created on-demand through
an initial update call. Information that is known will then directly be
available in the new attribute without causing an iteration delay.

The tests show how this improves the iteration count.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

5 years ago[Attributor] Manifest load/store alignment generally
Johannes Doerfert [Fri, 30 Aug 2019 15:22:28 +0000 (15:22 +0000)]
[Attributor] Manifest load/store alignment generally

Summary:
Any pointer could have load/store users not only floating ones so we
move the manifest logic for alignment into the AAAlignImpl class.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

5 years ago[DAGCombine] visitVSELECT - remove duplicate getOperand calls. NFCI.
Simon Pilgrim [Fri, 30 Aug 2019 15:17:37 +0000 (15:17 +0000)]
[DAGCombine] visitVSELECT - remove duplicate getOperand calls. NFCI.

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

5 years ago[InstCombine][AMDGPU] Simplify tbuffer loads
Piotr Sobczak [Fri, 30 Aug 2019 14:20:04 +0000 (14:20 +0000)]
[InstCombine][AMDGPU] Simplify tbuffer loads

Summary: Add missing tbuffer loads intrinsics in SimplifyDemandedVectorElts.

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

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