platform/upstream/llvm.git
4 years ago[X86] Custom promote i32->f80 uint_to_fp on AVX512 64-bit targets.
Craig Topper [Tue, 3 Sep 2019 02:51:10 +0000 (02:51 +0000)]
[X86] Custom promote i32->f80 uint_to_fp on AVX512 64-bit targets.

Reuse the same code to promote all i32 uint_to_fp on 64-bit targets
to simplify the X86ISelLowering constructor.

llvm-svn: 370693

4 years ago[x86] Fix bugs of some intrinsic functions in CLANG : _mm512_stream_ps, _mm512_stream...
Pengfei Wang [Tue, 3 Sep 2019 02:06:15 +0000 (02:06 +0000)]
[x86] Fix bugs of some intrinsic functions in CLANG : _mm512_stream_ps, _mm512_stream_pd, _mm512_stream_si512

Reviewers: craig.topper, pengfei, LuoYuanke, RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

Patch by Bing Yu (yubing)

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

llvm-svn: 370691

4 years agoRename -Wc++20-designator to -Wc++2a-designator for consistency and add
Richard Smith [Mon, 2 Sep 2019 23:27:54 +0000 (23:27 +0000)]
Rename -Wc++20-designator to -Wc++2a-designator for consistency and add
some test coverage for the flag.

llvm-svn: 370689

4 years agoSplit -Wreorder into different warnings for reordering a constructor
Richard Smith [Mon, 2 Sep 2019 23:17:32 +0000 (23:17 +0000)]
Split -Wreorder into different warnings for reordering a constructor
mem-initializer list and for reordering a designated initializer list.

llvm-svn: 370688

4 years ago[CostModel][X86] Add scalar sext/zext cost tests
Simon Pilgrim [Mon, 2 Sep 2019 21:02:51 +0000 (21:02 +0000)]
[CostModel][X86] Add scalar sext/zext cost tests

llvm-svn: 370684

4 years ago[X86] Enable fp128 as a legal type with SSE1 rather than with MMX.
Craig Topper [Mon, 2 Sep 2019 20:16:30 +0000 (20:16 +0000)]
[X86] Enable fp128 as a legal type with SSE1 rather than with MMX.

FP128 values are passed in xmm registers so should be asssociated
with an SSE feature rather than MMX which uses a different set
of registers.

llc enables sse1 and sse2 by default with x86_64. But does not
enable mmx. Clang enables all 3 features by default.

I've tried to add command lines to test with -sse
where possible, but any test that returns a value in an xmm
register fails with a fatal error with -sse since we have no
defined ABI for that scenario.

llvm-svn: 370682

4 years ago[ARM] MVE predicate bitcast test and VPSEL adjustment. NFC
David Green [Mon, 2 Sep 2019 19:03:35 +0000 (19:03 +0000)]
[ARM] MVE predicate bitcast test and VPSEL adjustment. NFC

llvm-svn: 370678

4 years ago[Wdocumentation] fixes an assertion failure with typedefed function and block pointer
Dmitri Gribenko [Mon, 2 Sep 2019 18:24:33 +0000 (18:24 +0000)]
[Wdocumentation] fixes an assertion failure with typedefed function and block pointer

Summary:
The assertion happens when compiling with -Wdocumentation with variable declaration to a typedefed function pointer. I not too familiar with the ObjC syntax but first two tests assert without this patch.

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

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 370677

4 years ago[ARM] Use MQPR not QPR for MVE registers
David Green [Mon, 2 Sep 2019 17:18:23 +0000 (17:18 +0000)]
[ARM] Use MQPR not QPR for MVE registers

We should be using MQPR, and if we don't we can get COPYs and PHIs created for
QPR. These get folded into instructions, failing verification checks.

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

llvm-svn: 370676

4 years ago[TargetLowering][PS4] Add sincos(f) lib functions when target is PS4
Robert Lougher [Mon, 2 Sep 2019 16:53:32 +0000 (16:53 +0000)]
[TargetLowering][PS4] Add sincos(f) lib functions when target is PS4

PS4 supports sincosf and sincos. Adding the library functions enables
the sin(f)+cos(f) -> sincos(f) optimization.

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

llvm-svn: 370675

4 years ago[SystemZ] Support constrained fpto[su]i intrinsics
Ulrich Weigand [Mon, 2 Sep 2019 16:49:29 +0000 (16:49 +0000)]
[SystemZ] Support constrained fpto[su]i intrinsics

Now that constrained fpto[su]i intrinsic are available,
add codegen support to the SystemZ backend.

In addition to pure back-end changes, I've also needed
to add the strict_fp_to_[su]int and any_fp_to_[su]int
pattern fragments in the obvious way.

llvm-svn: 370674

4 years ago[SVE][Inline-Asm] Support for SVE asm operands
Kerry McLaughlin [Mon, 2 Sep 2019 16:12:31 +0000 (16:12 +0000)]
[SVE][Inline-Asm] Support for SVE asm operands

Summary:
Adds the following inline asm constraints for SVE:
  - w: SVE vector register with full range, Z0 to Z31
  - x: Restricted to registers Z0 to Z15 inclusive.
  - y: Restricted to registers Z0 to Z7 inclusive.

This change also adds the "z" modifier to interpret a register as an SVE register.

Not all of the bitconvert patterns added by this patch are used, but they have been included here for completeness.

Reviewers: t.p.northover, sdesmalen, rovka, momchil.velikov, rengolin, cameron.mcinally, greened

Reviewed By: sdesmalen

Subscribers: javed.absar, tschuett, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

llvm-svn: 370673

4 years agoThinLTO: Document the option BOOTSTRAP_LLVM_ENABLE_LTO
Sylvestre Ledru [Mon, 2 Sep 2019 15:34:53 +0000 (15:34 +0000)]
ThinLTO: Document the option BOOTSTRAP_LLVM_ENABLE_LTO

llvm-svn: 370671

4 years ago[X86] getPMOVMSKB - add MVT::v64i8 handling and remove from combineBitcastvxi1. NFCI.
Simon Pilgrim [Mon, 2 Sep 2019 15:10:35 +0000 (15:10 +0000)]
[X86] getPMOVMSKB - add MVT::v64i8 handling and remove from combineBitcastvxi1. NFCI.

llvm-svn: 370670

4 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

llvm-svn: 370669

4 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

llvm-svn: 370668

4 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

llvm-svn: 370667

4 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

llvm-svn: 370665

4 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

llvm-svn: 370664

4 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

llvm-svn: 370663

4 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

--

llvm-svn: 370662

4 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

llvm-svn: 370661

4 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

llvm-svn: 370660

4 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

llvm-svn: 370659

4 years ago[dotest] Add @skipIfCursesSupportMissing and annotate the new gui test
Pavel Labath [Mon, 2 Sep 2019 13:33:12 +0000 (13:33 +0000)]
[dotest] Add @skipIfCursesSupportMissing and annotate the new gui test

Summary:
The gui command requires curses support, which can be disabled at
compile time. This patch adds the ability to detect this situation in
the test suite and skip the test accordingly.

Reviewers: teemperor, jankratochvil

Subscribers: lldb-commits

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

llvm-svn: 370658

4 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.

llvm-svn: 370657

4 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

llvm-svn: 370656

4 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

llvm-svn: 370655

4 years ago[LLD] [COFF] Demangle itanium symbols in mingw mode
Martin Storsjo [Mon, 2 Sep 2019 13:25:46 +0000 (13:25 +0000)]
[LLD] [COFF] Demangle itanium symbols in mingw mode

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

llvm-svn: 370654

4 years agoNativeProcessLinux: Remove some register context boilerplate
Pavel Labath [Mon, 2 Sep 2019 12:50:18 +0000 (12:50 +0000)]
NativeProcessLinux: Remove some register context boilerplate

Summary:
This patch follows the spirit of D63594, and removes some null checks
for things which should be operating invariants. Specifically
{Read,Write}[GF]PR now no longer check whether the supplied buffers are
null, because they never are. After this, the Do*** versions of these
function no longer serve any purpose and are inlined into their callers.

Other cleanups are possible here too, but I am taking this one step at a
time because this involves a lot of architecture-specific code, which I
don't have the hardware to test on (I did do a build-test though).

Reviewers: mgorny, jankratochvil, omjavaid, alexandreyy, uweigand

Subscribers: nemanjai, javed.absar, kbarton, lldb-commits

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

llvm-svn: 370653

4 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

llvm-svn: 370652

4 years ago[unittests][AST] CommentParser: don't name variable 'DEBUG'
Roman Lebedev [Mon, 2 Sep 2019 12:34:21 +0000 (12:34 +0000)]
[unittests][AST] CommentParser: don't name variable 'DEBUG'

It's may be an already-defined macro name,
resulting in compilation errors.

llvm-svn: 370650

4 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

llvm-svn: 370649

4 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

llvm-svn: 370648

4 years ago[lldb][NFC] Add test for invalid gui command
Raphael Isemann [Mon, 2 Sep 2019 12:10:16 +0000 (12:10 +0000)]
[lldb][NFC] Add test for invalid gui command

llvm-svn: 370647

4 years ago[lldb][NFC] Remove unused imports from TestIntegerTypesExpr.py
Raphael Isemann [Mon, 2 Sep 2019 11:58:03 +0000 (11:58 +0000)]
[lldb][NFC] Remove unused imports from TestIntegerTypesExpr.py

llvm-svn: 370645

4 years ago[ARM64] Simplify RegisterInfos_arm64.h with macro based RegisterInfo array
Omair Javaid [Mon, 2 Sep 2019 11:53:29 +0000 (11:53 +0000)]
[ARM64] Simplify RegisterInfos_arm64.h with macro based RegisterInfo array

This patches paves way for upcoming SVE RegisterInfo definitions. This is cosmetic change which allows us to define ARM64 RegisterInfo using macros.

In future we ll have define two different RegisterInfos to choose between SVE vs non-SVE RegisterInfo with decision being made at thread creation.

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

llvm-svn: 370644

4 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

llvm-svn: 370643

4 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)

llvm-svn: 370642

4 years ago[lldb][NFC] Remove unused imports from TestIntegerTypes.py
Raphael Isemann [Mon, 2 Sep 2019 11:30:00 +0000 (11:30 +0000)]
[lldb][NFC] Remove unused imports from TestIntegerTypes.py

llvm-svn: 370641

4 years ago[AST] AST structural equivalence to work internally with pairs.
Balazs Keri [Mon, 2 Sep 2019 11:01:09 +0000 (11:01 +0000)]
[AST] AST structural equivalence to work internally with pairs.

Summary:
The structural equivalence check stores now pairs of nodes in the
'from' and 'to' context instead of only the node in 'from' context
and a corresponding one in 'to' context. This is needed to handle
cases when a Decl in the 'from' context is to be compared with
multiple Decls in the 'to' context.

Reviewers: martong, a_sidorin

Reviewed By: martong, a_sidorin

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

Tags: #clang

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

llvm-svn: 370639

4 years ago[lldb][NFC] Add test for source info
Raphael Isemann [Mon, 2 Sep 2019 10:55:52 +0000 (10:55 +0000)]
[lldb][NFC] Add test for source info

llvm-svn: 370638

4 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.

llvm-svn: 370637

4 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

llvm-svn: 370636

4 years ago[ELF] Do not ICF two sections with different output sections (by SECTIONS commands)
Fangrui Song [Mon, 2 Sep 2019 10:33:58 +0000 (10:33 +0000)]
[ELF] Do not ICF two sections with different output sections (by SECTIONS commands)

Fixes PR39418. Complements D47241 (the non-linker-script case).

processSectionCommands() assigns input sections to output sections.
ICF is called before it, so .text.foo and .text.bar may be folded even if
their output sections are made different by SECTIONS commands.

```
markLive<ELFT>()
doIcf<ELFT>()                      // During ICF, we don't know the output sections
writeResult()
  combineEhSections<ELFT>()
  script->processSectionCommands() // InputSection -> OutputSection assignment
```

This patch splits processSectionCommands() into processSectionCommands() and
processSymbolAssignments(), and moves processSectionCommands() before ICF:

```
markLive<ELFT>()
combineEhSections<ELFT>()
script->processSectionCommands()
doIcf<ELFT>()                      // should remove folded input sections
writeResult()
  script->processSymbolAssignments()
```

An alternative approach is to unfold a section `sec` in
processSectionCommands() when we find `sec` and `sec->repl` belong to
different output sections. I feel this patch is superior because this
can fold more sections and the decouple of
SectionCommand/SymbolAssignment gives flexibility:

* An ExprValue can't be evaluated before its section is assigned to an
  output section -> we can delete getOutputSectionVA and simplify
  another place where we had to check if the output section is null.
  Moreover, a case in linkerscript/early-assign-symbol.s can be handled
  now.
* processSectionCommands/processSymbolAssignments can be freely moved
  around.

Reviewed By: ruiu

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

llvm-svn: 370635

4 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

llvm-svn: 370634

4 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

llvm-svn: 370633

4 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

llvm-svn: 370631

4 years ago[ELF] Align SHT_LLVM_PART_EHDR to a maximum page size boundary
Fangrui Song [Mon, 2 Sep 2019 08:49:50 +0000 (08:49 +0000)]
[ELF] Align SHT_LLVM_PART_EHDR to a maximum page size boundary

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=998712

SHT_LLVM_PART_EHDR marks the start of a partition. The partition
sections will be extracted to a separate file. Align to the next maximum
page size boundary so that we can find the ELF header at the start. We
cannot benefit from overlapping p_offset ranges with the previous
segment anyway.

It seems we lack some llvm-objcopy --extract-main-partition and
--extract-partition sanity checks. It may place EHDR at the start
even if p_offset if non zero. Anyway, the lld change is justified for
the reasons above.

Reviewed By: ruiu

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

llvm-svn: 370629

4 years ago[lldb] Add description to option completions.
Raphael Isemann [Mon, 2 Sep 2019 08:34:57 +0000 (08:34 +0000)]
[lldb] Add description to option completions.

Summary:
Right now our argument completions are rather cryptic for command options as they only list the letters:

```
(lldb) breakpoint set -
Available completions:
-G
-C
-c
-d
-i
-o
-q
-t
-x
[...]
```

With the new completion API we can easily extend this with the flag description so that it looks like this now:

```
(lldb) breakpoint set -
Available completions:
-G -- The breakpoint will auto-continue after running its commands.
-C -- A command to run when the breakpoint is hit, can be provided more than once, the commands will get run in order left to right.
-c -- The breakpoint stops only if this condition expression evaluates to true.
-d -- Disable the breakpoint.
-i -- Set the number of times this breakpoint is skipped before stopping.
-o -- The breakpoint is deleted the first time it stop causes a stop.
-q -- The breakpoint stops only for threads in the queue whose name is given by this argument.
-t -- The breakpoint stops only for the thread whose TID matches this argument.
-x -- The breakpoint stops only for the thread whose index matches this argument.
```

The same happens with --long-options now.

Reviewers: #lldb, labath

Reviewed By: labath

Subscribers: labath, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 370628

4 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.

llvm-svn: 370627

4 years ago[lldb][NFC] Add basic test for GUI command
Raphael Isemann [Mon, 2 Sep 2019 08:00:59 +0000 (08:00 +0000)]
[lldb][NFC] Add basic test for GUI command

Summary:
This adds a basic test for the GUI command. Just tests that it starts up, that we can quit the gui
and help window, and that the basic UI elements are rendered. Mostly testing the waters how
testing this command will do on the bots or if that will cause some serious issues when we do
fancy ncurses stuff.

Reviewers: labath, clayborg

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 370625

4 years ago[lldb][NFC] Remove unnecessary lldb_enable_attach in TestMultilineCompletion
Raphael Isemann [Mon, 2 Sep 2019 07:40:06 +0000 (07:40 +0000)]
[lldb][NFC] Remove unnecessary lldb_enable_attach in TestMultilineCompletion

We don't actually need to call this for this test.

llvm-svn: 370623

4 years ago[ASTImporter] At import of records re-order indirect fields too.
Balazs Keri [Mon, 2 Sep 2019 07:17:01 +0000 (07:17 +0000)]
[ASTImporter] At import of records re-order indirect fields too.

Summary:
Correct order of fields and indirect fields in imported RecordDecl
is needed for correct work of record layout calculations.

Reviewers: martong, a.sidorin, shafik, a_sidorin

Reviewed By: martong, a_sidorin

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

Tags: #clang

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

llvm-svn: 370621

4 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

llvm-svn: 370620

4 years ago[lldb] Test and fix invalid log command invocations
Raphael Isemann [Sun, 1 Sep 2019 19:29:01 +0000 (19:29 +0000)]
[lldb] Test and fix invalid log command invocations

llvm-svn: 370619

4 years ago[lldb][NFC] Add test for invalid expression command args
Raphael Isemann [Sun, 1 Sep 2019 18:59:40 +0000 (18:59 +0000)]
[lldb][NFC] Add test for invalid expression command args

llvm-svn: 370618

4 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

llvm-svn: 370617

4 years ago[lldb][NFC] Fix failing tests on macOS after restructuring test folder
Raphael Isemann [Sun, 1 Sep 2019 16:30:06 +0000 (16:30 +0000)]
[lldb][NFC] Fix failing tests on macOS after restructuring test folder

llvm-svn: 370616

4 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.

llvm-svn: 370615

4 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.

llvm-svn: 370614

4 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.

llvm-svn: 370613

4 years ago[lldb] Small optimization of FormatMap::Delete
Jan Kratochvil [Sun, 1 Sep 2019 15:08:33 +0000 (15:08 +0000)]
[lldb] Small optimization of FormatMap::Delete

llvm-svn: 370612

4 years ago[lldb][NFC] Fix failing tests after restructuring test folder
Raphael Isemann [Sun, 1 Sep 2019 13:36:44 +0000 (13:36 +0000)]
[lldb][NFC] Fix failing tests after restructuring test folder

Just adjusts all the relative paths in the Makefiles (and
the breakpoint test which seems to rely on the name of its
folder).

llvm-svn: 370611

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

llvm-svn: 370610

4 years agoFix variable HasArrayDesignator set but not used warning. NFCI.
Simon Pilgrim [Sun, 1 Sep 2019 13:10:08 +0000 (13:10 +0000)]
Fix variable HasArrayDesignator set but not used warning. NFCI.

llvm-svn: 370609

4 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

llvm-svn: 370608

4 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.

llvm-svn: 370607

4 years ago[lldb] Restructure test folders to match LLDB command hierarchy
Raphael Isemann [Sun, 1 Sep 2019 09:12:37 +0000 (09:12 +0000)]
[lldb] Restructure test folders to match LLDB command hierarchy

Summary:
As discussed on lldb-dev, this patch moves some LLDB tests into a hierarchy that more closely
resembles the commands we use in the LLDB interpreter. This patch should only move tests
that use the command interpreter and shouldn't touch any tests that primarily test the SB API.

Reviewers: #lldb, jfb, JDevlieghere

Reviewed By: #lldb, JDevlieghere

Subscribers: dexonsmith, arphaman, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 370605

4 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

llvm-svn: 370604

4 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

llvm-svn: 370603

4 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.

llvm-svn: 370602

4 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.

llvm-svn: 370601

4 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.

llvm-svn: 370600

4 years ago[libc++] Fix directory_iterator compilation on Win32
Nico Weber [Sat, 31 Aug 2019 23:17:38 +0000 (23:17 +0000)]
[libc++] Fix directory_iterator compilation on Win32

This patch fixes some typos and other small errors in
directory_iterator.cpp that prevented this file from being compiled for
Win32.

Patch by Stefan Schmidt <thrimbor.github@gmail.com>!

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

llvm-svn: 370599

4 years ago[clang] Devirtualization for classes with destructors marked as 'final'
David Bolvansky [Sat, 31 Aug 2019 18:52:44 +0000 (18:52 +0000)]
[clang] Devirtualization for classes with destructors marked as 'final'

A class with a destructor marked final cannot be derived from, so it should afford the same devirtualization opportunities as marking the entire class final.

Patch by logan-5 (Logan Smith)
Reviewed by rsmith

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

llvm-svn: 370597

4 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.

llvm-svn: 370596

4 years ago[NFC] Fix for rL370594
David Bolvansky [Sat, 31 Aug 2019 18:35:44 +0000 (18:35 +0000)]
[NFC] Fix for rL370594

llvm-svn: 370595

4 years ago[clang] Warning for non-final classes with final destructors
David Bolvansky [Sat, 31 Aug 2019 18:31:19 +0000 (18:31 +0000)]
[clang] Warning for non-final classes with final destructors

Marking a class' destructor final prevents the class from being inherited from. However, it is a subtle and awkward way to express that at best, and unintended at worst. It may also generate worse code (in other compilers) than marking the class itself final. For these reasons, this revision adds a warning for nonfinal classes with final destructors, with a note to suggest marking the class final to silence the warning.

See https://reviews.llvm.org/D66621 for more background.

Patch by logan-5 (Logan Smith)

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

llvm-svn: 370594

4 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

llvm-svn: 370593

4 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.

llvm-svn: 370592

4 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

llvm-svn: 370591

4 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.

llvm-svn: 370590

4 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.

llvm-svn: 370589

4 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)

llvm-svn: 370588

4 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.

llvm-svn: 370587

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

llvm-svn: 370585

4 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

llvm-svn: 370584

4 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).

llvm-svn: 370583

4 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.

llvm-svn: 370581

4 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.

llvm-svn: 370580

4 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

llvm-svn: 370578

4 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

llvm-svn: 370577

4 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.

llvm-svn: 370576

4 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.

llvm-svn: 370575

4 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.

llvm-svn: 370574

4 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

llvm-svn: 370573

4 years ago[lldb] Unify target checking in CommandObject
Raphael Isemann [Sat, 31 Aug 2019 09:41:25 +0000 (09:41 +0000)]
[lldb] Unify target checking in CommandObject

Summary:
We currently have several CommandObjects that manually reimplement the checking for a selected target
or a target in the execution context (which is the selected target when they are invoked). This patch removes
all these checks and replaces them by setting the eCommandRequiresTarget flag that Pavel suggested. With
this flag we are doing the same check but without having to duplicate this code in all these CommandObjects.

I also added a `GetSelectedTarget()` variant of the `GetSelectedOrDummyTarget()` function to the
CommandObject that checks that the flag is set and then returns a reference to the target. I didn't rewrite
all the `target` variables from `Target *` to `Target &` in this patch as last time this change caused a lot of merge
conflicts in Swift and I would prefer having that in a separate NFC commit.

Reviewers: labath, clayborg

Reviewed By: labath, clayborg

Subscribers: clayborg, JDevlieghere, jingham, amccarth, abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 370571

4 years ago[lldb][NFC] Remove unused prompt variable in TestMultilineCompletion.py
Raphael Isemann [Sat, 31 Aug 2019 09:40:26 +0000 (09:40 +0000)]
[lldb][NFC] Remove unused prompt variable in TestMultilineCompletion.py

llvm-svn: 370570

4 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.

llvm-svn: 370569