platform/upstream/llvm.git
6 years agoAllow passing additional compiler/linker flags for the tests
Alexander Richardson [Fri, 23 Feb 2018 15:19:48 +0000 (15:19 +0000)]
Allow passing additional compiler/linker flags for the tests

Summary:
These flags can be specified using the CMake variables
LIBCXX_TEST_LINKER_FLAGS and LIBCXX_TEST_COMPILER_FLAGS.
When building the tests for CHERI I need to pass additional
flags (such as -mabi=n64 or -mabi=purecap) to the compiler
for our test configurations

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, mgorny, cfe-commits

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

llvm-svn: 325914

6 years agoSupport for the mno-stack-arg-probe flag
Hans Wennborg [Fri, 23 Feb 2018 13:47:36 +0000 (13:47 +0000)]
Support for the mno-stack-arg-probe flag

Adds support for this flag. There is also another piece for llvm
(separate review). More info:
https://bugs.llvm.org/show_bug.cgi?id=36221

By Ruslan Nikolaev!

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

llvm-svn: 325901

6 years agoSupport for the mno-stack-arg-probe flag
Hans Wennborg [Fri, 23 Feb 2018 13:46:25 +0000 (13:46 +0000)]
Support for the mno-stack-arg-probe flag

Adds support for this flag. There is also another piece for clang
(separate review). More info:
https://bugs.llvm.org/show_bug.cgi?id=36221

By Ruslan Nikolaev!

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

llvm-svn: 325900

6 years ago[mips] Revert r325872
Stefan Maksimovic [Fri, 23 Feb 2018 13:46:14 +0000 (13:46 +0000)]
[mips] Revert r325872

There are still outstanding issues with byVal arguments
that prevent this from being committed. Revert for now.

llvm-svn: 325899

6 years ago[SystemZ] Also update the CHECK line for VPDI
Jonas Paulsson [Fri, 23 Feb 2018 13:22:46 +0000 (13:22 +0000)]
[SystemZ]  Also update the CHECK line for VPDI

llvm-svn: 325898

6 years ago[SystemZ] Fix VPDI argument in test.
Jonas Paulsson [Fri, 23 Feb 2018 13:20:57 +0000 (13:20 +0000)]
[SystemZ] Fix VPDI argument in test.

To select element 1 from each half with VPDI, a constant of 5 should be used.

llvm-svn: 325897

6 years ago[X86][F16C] Regenerate half conversion tests
Simon Pilgrim [Fri, 23 Feb 2018 13:18:13 +0000 (13:18 +0000)]
[X86][F16C] Regenerate half conversion tests

llvm-svn: 325896

6 years agollvm-config: Add advapi32 to --system-libs on Windows (PR36372)
Hans Wennborg [Fri, 23 Feb 2018 12:20:26 +0000 (12:20 +0000)]
llvm-config: Add advapi32 to --system-libs on Windows (PR36372)

llvm-svn: 325894

6 years ago[WebAssembly] NDEBUG is spelled without a leading underscore.
Benjamin Kramer [Fri, 23 Feb 2018 12:20:18 +0000 (12:20 +0000)]
[WebAssembly] NDEBUG is spelled without a leading underscore.

llvm-svn: 325893

6 years ago[DAGCOmbine] Ensure that (brcond (setcc ...)) is handled in a canonical manner.
Amaury Sechet [Fri, 23 Feb 2018 11:50:42 +0000 (11:50 +0000)]
[DAGCOmbine] Ensure that (brcond (setcc ...)) is handled in a canonical manner.

Summary:
There are transformation that change setcc into other constructs, and transform that try to reconstruct a setcc from the brcond condition. Depending on what order these transform are done, the end result differs.

Most of the time, it is preferable to get a setcc as a brcond argument (and this is why brcond try to recreate the setcc in the first place) so we ensure this is done every time by also doing it at the setcc level when the only user is a brcond.

Reviewers: spatel, hfinkel, niravd, craig.topper

Subscribers: nhaehnle, llvm-commits

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

llvm-svn: 325892

6 years agoRevert "TableGen: Fix typeIsConvertibleTo for record types"
Nicolai Haehnle [Fri, 23 Feb 2018 11:31:49 +0000 (11:31 +0000)]
Revert "TableGen: Fix typeIsConvertibleTo for record types"

This reverts r325884.

Clang's TableGen has dependencies on the exact ordering of superclasses.
Revert this change fully for now to fix the build.

Change-Id: Ib297f5571cc7809f00838702ad7ab53d47335b26
llvm-svn: 325891

6 years ago[ELF][MIPS] Set EI_ABIVERSION flag accordingly to MIPS ABIs requirement
Simon Atanasyan [Fri, 23 Feb 2018 11:28:57 +0000 (11:28 +0000)]
[ELF][MIPS] Set EI_ABIVERSION flag accordingly to MIPS ABIs requirement

MIPS ABIs require that if an executable file uses non-PIC model, the
EI_ABIVERSION entry in the ELF header should be incremented from 0 to 1.
That allows obsoleted / limited dynamic linkers refuse to link them.

llvm-svn: 325890

6 years ago[MIPS GlobalISel] Adding GlobalISel
Petar Jovanovic [Fri, 23 Feb 2018 11:06:40 +0000 (11:06 +0000)]
[MIPS GlobalISel] Adding GlobalISel

Add GlobalISel infrastructure up to the point where we can select a ret
void.

Patch by Petar Avramovic.

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

llvm-svn: 325888

6 years ago[ELF] - Do not remove empty output sections that are explicitly assigned to phdr...
George Rimar [Fri, 23 Feb 2018 10:53:04 +0000 (10:53 +0000)]
[ELF] - Do not remove empty output sections that are explicitly assigned to phdr in script.

This continues direction started in D43069.

We can keep sections that are explicitly assigned to segment in script.
It helps to simplify code.

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

llvm-svn: 325887

6 years agoTableGen: Avoid using resolveListElementReference in TGParser
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:21 +0000 (10:46 +0000)]
TableGen: Avoid using resolveListElementReference in TGParser

A subsequent change intends to remove resolveListElementReference
entirely. This part of the removal can be split out for better
bisectability.

Change-Id: Ibd762d88fd2d1e2cc116a259e2a27a5e9f9a8b10

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

Change-Id: Ifb695041cef1964ad8a3102f448249501a9243f0
llvm-svn: 325886

6 years agoTableGen: BitInit and VarBitInit are typed
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:18 +0000 (10:46 +0000)]
TableGen: BitInit and VarBitInit are typed

Summary: Change-Id: I54e337a0b525e9649534bc5f90e5e07c0772e334

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

Change-Id: I07f78e793192974c2b90690ce644589fe4891e41
llvm-svn: 325885

6 years agoTableGen: Fix typeIsConvertibleTo for record types
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:13 +0000 (10:46 +0000)]
TableGen: Fix typeIsConvertibleTo for record types

Summary:
Only check whether the left-hand side type is a subclass (or equal to)
the right-hand side type.

This requires a further fix in handling !if expressions and in type
resolution.

Furthermore, reverse the order of superclasses so that resolveTypes will
find a least common ancestor at least in simple cases.

Add a test that used to be accepted without flagging the obvious type
error.

Change-Id: Ib366db1a4e6a079f1a0851e469b402cddae76714

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325884

6 years agoTableGen: Add !size operation
Nicolai Haehnle [Fri, 23 Feb 2018 10:46:07 +0000 (10:46 +0000)]
TableGen: Add !size operation

Summary:
Returns the size of a list. I have found this to be rather useful in some
development for the AMDGPU backend where we could simplify our .td files
by concatenating list<LLVMType> for complex intrinsics. Doing so requires
us to compute the position argument for LLVMMatchType.

Basically, the usage is in a pattern that looks somewhat like this:

    list<LLVMType> argtypes =
        !listconcat(base,
                    [llvm_any_ty, LLVMMatchType<!size(base)>]);

Change-Id: I360a0b000fd488d18bea412228230fd93722bd2c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits, tpr

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

llvm-svn: 325883

6 years agoAMDGPU: Track physreg uses in SILoadStoreOptimizer
Nicolai Haehnle [Fri, 23 Feb 2018 10:45:56 +0000 (10:45 +0000)]
AMDGPU: Track physreg uses in SILoadStoreOptimizer

Summary:
This handles def-after-use of physregs, and allows us to merge loads and
stores even across some physreg defs (typically M0 defs).

Change-Id: I076484b2bda27c2cf46013c845a0380c5b89b67b

Reviewers: arsenm, mareko, rampitec

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

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

llvm-svn: 325882

6 years agoStructurizeCFG: Test for branch divergence correctly
Nicolai Haehnle [Fri, 23 Feb 2018 10:45:46 +0000 (10:45 +0000)]
StructurizeCFG: Test for branch divergence correctly

Summary:
This fixes cases like the new test @nonuniform. In that test, %cc itself
is a uniform value; however, when reading it after the end of the loop in
basic block %if, its value is effectively non-uniform.

This problem was encountered in
https://bugs.freedesktop.org/show_bug.cgi?id=103743; however, this change
in itself is not sufficient to fix that bug, as there is another issue
in the AMDGPU backend.

Change-Id: I32bbffece4a32f686fab54964dae1a5dd72949d4

Reviewers: arsenm, rampitec, jlebar

Subscribers: wdng, tpr, llvm-commits

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

llvm-svn: 325881

6 years agoMark MergedLoadStoreMotion as not preserving MemDep results
Bjorn Steinbrink [Fri, 23 Feb 2018 10:41:57 +0000 (10:41 +0000)]
Mark MergedLoadStoreMotion as not preserving MemDep results

Summary:
MemDep caches results that signify that a dependence is non-local, and
there is currently no way to invalidate such cache entries.
Unfortunately, when MLSM sinks a store that can result in a non-local
dependence becoming a local one, and then MemDep gives wrong answers.
The easiest way out here is to just say that MLSM does indeed not
preserve MemDep results.

Reviewers: davide, Gerolf

Subscribers: llvm-commits

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

llvm-svn: 325880

6 years agoRecommit "[ELF] - Do not crash with --emit-relocs and --icf=all together."
George Rimar [Fri, 23 Feb 2018 10:37:33 +0000 (10:37 +0000)]
Recommit "[ELF] - Do not crash with --emit-relocs and --icf=all together."

Latest patch version now.

Original commit message:

[ELF] - Do not crash with --emit-relocs and --icf=all together.

Previously we would crash because did not mark .rel[a] sections
as dead and they tried to access parent which was not live
after ICF and therefore was null.

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

llvm-svn: 325879

6 years ago[ELF] - Revert r325877 "[ELF] - Do not crash with --emit-relocs and --icf=all together."
George Rimar [Fri, 23 Feb 2018 10:30:31 +0000 (10:30 +0000)]
[ELF] - Revert r325877 "[ELF] - Do not crash with --emit-relocs and --icf=all together."

Not latest version of patch was committed by mistake.

llvm-svn: 325878

6 years ago[ELF] - Do not crash with --emit-relocs and --icf=all together.
George Rimar [Fri, 23 Feb 2018 10:27:13 +0000 (10:27 +0000)]
[ELF] - Do not crash with --emit-relocs and --icf=all together.

Previously we would crash because did not mark .rel[a] sections
as dead and they tried to access parent which was not live
after ICF and therefore was null.

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

llvm-svn: 325877

6 years ago[ELF] - Report error if removed empty output section declaration used undefined symbols.
George Rimar [Fri, 23 Feb 2018 10:15:54 +0000 (10:15 +0000)]
[ELF] - Report error if removed empty output section declaration used undefined symbols.

This is for fixing PR36297.

Issue itself is that if we have SECTIONS { .bar (a+b) : { *(.stub) } };
script and no section .stub, when LLD will remove .bar, but
produce output with undefined symbols a and b.

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

llvm-svn: 325875

6 years ago[ELF] - Added testcase for testing visibility of weak_odr symbols.
George Rimar [Fri, 23 Feb 2018 10:08:15 +0000 (10:08 +0000)]
[ELF] - Added testcase for testing visibility of weak_odr symbols.

This is relative to "Bug 36166 - tools/gold/X86/comdat.ll is failing only on Debian Unstable" (PR36166).
Something changed in newer versions of gold and now together with gold-plugin
there is an issue shown in PR, symbol may get wrong visibility.

LLD works fine, but we have no testcase for the same use case, patch adds it.

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

llvm-svn: 325874

6 years ago[ELF] - Add testcase documenting flags assigned when empty synthetic section is removed.
George Rimar [Fri, 23 Feb 2018 09:57:17 +0000 (09:57 +0000)]
[ELF] - Add testcase documenting flags assigned when empty synthetic section is removed.

This responds to PR36475,

r325763 led to unexprected layout change, though
new behavior seems to be more correct.

Previously we could have following script:

.foo : { *(.foo) }
.bar : { *(.synthetic_empty) BYTE(0x11) }}
where synthetic_empty is a synthetic section which is empty and
hence removed by linker.

Before r325763 .bar would receive section flags from .synthetic_empty,
but after this revision it receives flags the same as .foo section has.

It is the same as if there would not be any synthetic_empty section in a script,
so looks reasonable and consistent behavior:
.foo : { *(.foo) }
.bar : { BYTE(0x11) }}

Patch adds testcase to document it.

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

llvm-svn: 325873

6 years ago[mips] Reland r310704
Stefan Maksimovic [Fri, 23 Feb 2018 08:37:48 +0000 (08:37 +0000)]
[mips] Reland r310704

Recommit this change which was previously reverted
for the 5.0.0 release since the failures identified
were dealt with in r325782.

llvm-svn: 325872

6 years ago[Mips] Return true in enableMultipleCopyHints().
Jonas Paulsson [Fri, 23 Feb 2018 08:30:15 +0000 (08:30 +0000)]
[Mips]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Simon Dardis
llvm-svn: 325870

6 years agoReleaseNotes: user lower-case for lld in the text
Hans Wennborg [Fri, 23 Feb 2018 08:27:38 +0000 (08:27 +0000)]
ReleaseNotes: user lower-case for lld in the text

llvm-svn: 325869

6 years ago[clangd] BindWithForward -> Bind. NFC
Sam McCall [Fri, 23 Feb 2018 07:54:17 +0000 (07:54 +0000)]
[clangd] BindWithForward -> Bind. NFC

llvm-svn: 325868

6 years agoutils: Adapt to llvm r325155
Jan Vesely [Fri, 23 Feb 2018 07:37:03 +0000 (07:37 +0000)]
utils: Adapt to llvm r325155

r325155 ("Pass a reference to a module to the bitcode writer.")
changed bit writer interface from pointer to reference

Reviewer: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325867

6 years agoamdgcn: Fix build after GDS/const AS swap in r325030
Jan Vesely [Fri, 23 Feb 2018 07:37:01 +0000 (07:37 +0000)]
amdgcn: Fix build after GDS/const AS swap in r325030

Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325866

6 years agoamdgcn: Fix datalayout after addition of 32bit const AS in r324747
Jan Vesely [Fri, 23 Feb 2018 07:36:54 +0000 (07:36 +0000)]
amdgcn: Fix datalayout after addition of 32bit const AS in r324747

Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325865

6 years agor600: Fix datalayout after clang r324101
Jan Vesely [Fri, 23 Feb 2018 07:36:51 +0000 (07:36 +0000)]
r600: Fix datalayout after clang r324101

r324101 switched around AS numbering

Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325864

6 years agoamdgcn: Fix datalayout after clang r324101
Jan Vesely [Fri, 23 Feb 2018 07:36:39 +0000 (07:36 +0000)]
amdgcn: Fix datalayout after clang r324101

r324101 switched around AS numbering

Acked-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325863

6 years agoFix TestMultithreaded when there's no debugserver specified
Frederic Riss [Fri, 23 Feb 2018 05:29:27 +0000 (05:29 +0000)]
Fix TestMultithreaded when there's no debugserver specified

r325858 was bogus and would error out with a KeyError when --server
was not passed to dotest.py.

llvm-svn: 325862

6 years ago[WebAssembly] Add explicit symbol table
Sam Clegg [Fri, 23 Feb 2018 05:08:53 +0000 (05:08 +0000)]
[WebAssembly] Add explicit symbol table

This change modified lld to in response the llvm change which
moved to a more explicit symbol table in the object format.

Based on patches by Nicholas Wilson:
 1. https://reviews.llvm.org/D41955
 2. https://reviews.llvm.org/D42585

The primary difference that we see in the test output is that
for relocatable (-r) output we now have symbol table which
replaces exports/imports and globals.

See: https://github.com/WebAssembly/tool-conventions/issues/38
Differential Revision: https://reviews.llvm.org/D43264

llvm-svn: 325861

6 years ago[WebAssembly] Add first claass symbol table to wasm objects
Sam Clegg [Fri, 23 Feb 2018 05:08:34 +0000 (05:08 +0000)]
[WebAssembly] Add first claass symbol table to wasm objects

This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

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

llvm-svn: 325860

6 years agoFix TestUbsanBasic
Frederic Riss [Fri, 23 Feb 2018 05:03:10 +0000 (05:03 +0000)]
Fix TestUbsanBasic

Summary:
Potentially due to the recent testuite refactorings, this test now reports
a full absolute path but expect just the filename. For some reason this
test is skipped on GreenDragon so we've never seen the issue.

Reviewers: vsk

Subscribers: kubamracek, lldb-commits

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

llvm-svn: 325859

6 years agoFix TestMultithreaded when specifying an alternative debugserver.
Frederic Riss [Fri, 23 Feb 2018 05:03:09 +0000 (05:03 +0000)]
Fix TestMultithreaded when specifying an alternative debugserver.

Summary:
This test launches a helper that uses the debugserver. The environment
variable sepcifying the debug server wasn't passed to this helper, thus
it was using the default one.

Subscribers: lldb-commits

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

llvm-svn: 325858

6 years ago[WebAssembly] Move lambda declaration output of loop. NFC.
Sam Clegg [Fri, 23 Feb 2018 04:59:57 +0000 (04:59 +0000)]
[WebAssembly] Move lambda declaration output of loop. NFC.

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

llvm-svn: 325857

6 years agoremove FreeBSD xfail from lit TestCallStdStringFunction
Ed Maste [Fri, 23 Feb 2018 02:50:07 +0000 (02:50 +0000)]
remove FreeBSD xfail from lit TestCallStdStringFunction

This test is consistently reporting unexpected pass for me, and the
expectedFailure decorator was removed from the legacy test in r310626.
Apply the same change to the lit version of this test.

Will investigate further if this fails once the new buildbot is running
tests.

llvm.org/pr17807

llvm-svn: 325856

6 years ago[ELF] Add comment for preemptible and fix typo. NFC
Fangrui Song [Fri, 23 Feb 2018 02:05:48 +0000 (02:05 +0000)]
[ELF] Add comment for preemptible and fix typo. NFC

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 325855

6 years agoAdd a test to ensure we don't permit mutable access on temporaries outside the evalua...
Richard Smith [Fri, 23 Feb 2018 02:03:26 +0000 (02:03 +0000)]
Add a test to ensure we don't permit mutable access on temporaries outside the evaluation in which they were created.

llvm-svn: 325854

6 years agoRemove file missed by r325852 due to merge conflict.
Richard Smith [Fri, 23 Feb 2018 01:57:28 +0000 (01:57 +0000)]
Remove file missed by r325852 due to merge conflict.

llvm-svn: 325853

6 years agoRevert r325128 ("[X86] Reduce Store Forward Block issues in HW").
Richard Smith [Fri, 23 Feb 2018 01:43:46 +0000 (01:43 +0000)]
Revert r325128 ("[X86] Reduce Store Forward Block issues in HW").

This is causing miscompiles in some situations. See the llvm-commits thread for the commit for details.

llvm-svn: 325852

6 years ago[testsuite] Throw away test/debug_info/apple_types.
Davide Italiano [Fri, 23 Feb 2018 01:33:20 +0000 (01:33 +0000)]
[testsuite] Throw away test/debug_info/apple_types.

This test was only testing that clang produced the correct informations
for __apple accelerated tables. So, it's a clang test. Also, it
doesn't require any debugger intervention, the object file can
be analyzed statically with a dumper. Also, the input program
was highly verbose (unnecessarily).

r325850 commits a clang test instead, so it's time to retire this.

llvm-svn: 325851

6 years ago[Darwin] Add a test to check clang produces accelerator tables.
Davide Italiano [Fri, 23 Feb 2018 01:25:03 +0000 (01:25 +0000)]
[Darwin] Add a test to check clang produces accelerator tables.

This test was previously in lldb, and was only checking that clang
was emitting the correct section. So, it belongs here and not
in the debugger.

llvm-svn: 325850

6 years agoMake undefined symbol in DSO to pull out object files from archive files.
Rui Ueyama [Fri, 23 Feb 2018 01:16:57 +0000 (01:16 +0000)]
Make undefined symbol in DSO to pull out object files from archive files.

We have an internal program that does't link without this patch. I don't
know of any open-source program that needs this, but there might be.
Since this patch improves compatibility with GNU linkers with a few lines
of code, I think it's worth to be committed.

The problem is about undefined symbols in DSOs. Some programs depend on
the GNU linkers' behavior that they pull out object files from archive
files to resolve undefined symbols in DSOs. We already allow that kind of
"reverse" dependency (from DSOs to the main executable) for regular
symbols, in particular, for "__progname" symbol (which is usually in
crt0.o), but that doesn't work if the symbol is in an archive file.
This patch is to make it work.

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

llvm-svn: 325849

6 years ago[GISel]: Fix base case for m_any_of PatternMatcher.
Aditya Nandakumar [Fri, 23 Feb 2018 01:01:59 +0000 (01:01 +0000)]
[GISel]: Fix base case for m_any_of PatternMatcher.

The base case for any_of was incorrectly returning true. Also add test
case which uses m_any_of(preds...) where none of the predicates are
true.

llvm-svn: 325848

6 years agoDelete some unused #includes of CleanUp.h, NFC
Vedant Kumar [Fri, 23 Feb 2018 00:29:40 +0000 (00:29 +0000)]
Delete some unused #includes of CleanUp.h, NFC

llvm-svn: 325847

6 years agoSimplify setting dso_local. NFC.
Rafael Espindola [Fri, 23 Feb 2018 00:22:15 +0000 (00:22 +0000)]
Simplify setting dso_local. NFC.

The value of dso_local can be computed from just IR properties and
global information (object file type, command line options, etc).

With this patch we no longer pass in the Decl. It was almost unused
and making it fully unused guarantees that dso_local is consistent
with the rest of the IR.

llvm-svn: 325846

6 years ago[X86] Turn setne X, signedmax into setgt signedmax, X in LowerVSETCC to avoid an...
Craig Topper [Fri, 23 Feb 2018 00:21:39 +0000 (00:21 +0000)]
[X86] Turn setne X, signedmax into setgt signedmax, X in LowerVSETCC to avoid an invert

We won't be able to fold the constant pool load, but its still better than materialing ones and xoring for the invert if we used PCMPEQ.

This will fix another regression from D42948.

llvm-svn: 325845

6 years ago[AArch64] Refactor macro fusion (NFC)
Evandro Menezes [Fri, 23 Feb 2018 00:14:39 +0000 (00:14 +0000)]
[AArch64] Refactor macro fusion (NFC)

Move checks for each fusion case into separate functions for better
legibility and maintainability.

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

llvm-svn: 325844

6 years ago[PDB] Check the result of setLoadAddress()
Aaron Smith [Fri, 23 Feb 2018 00:02:27 +0000 (00:02 +0000)]
[PDB] Check the result of setLoadAddress()

Summary: Change setLoadAddress() to return true or false on failure.

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

llvm-svn: 325843

6 years agoFix grammar. NFC.
Rafael Espindola [Thu, 22 Feb 2018 23:59:46 +0000 (23:59 +0000)]
Fix grammar. NFC.

Thank to Eric Christopher for noticing.

llvm-svn: 325842

6 years ago[ObjC] Fix the NSConcreteData formatter and test it
Vedant Kumar [Thu, 22 Feb 2018 23:48:21 +0000 (23:48 +0000)]
[ObjC] Fix the NSConcreteData formatter and test it

The length field of an NSConcreteData lives one word past the start of
the object, not two.

llvm-svn: 325841

6 years ago[X86] Turn setne X, signedmin into setgt X, signedmin in LowerVSETCC to avoid an...
Craig Topper [Thu, 22 Feb 2018 23:46:28 +0000 (23:46 +0000)]
[X86] Turn setne X, signedmin into setgt X, signedmin in LowerVSETCC to avoid an invert

This will fix one of the regressions from D42948.

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

llvm-svn: 325840

6 years ago[AArch64] Improve macro fusion test case
Evandro Menezes [Thu, 22 Feb 2018 23:32:06 +0000 (23:32 +0000)]
[AArch64] Improve macro fusion test case

Improve a vector in the test case for the fusion of address generation and
loads or stores.  Otherwise, NFC.

llvm-svn: 325839

6 years agoFix llvm-pdbutil to handle new built-in types
Adrian McCarthy [Thu, 22 Feb 2018 23:16:56 +0000 (23:16 +0000)]
Fix llvm-pdbutil to handle new built-in types

Summary:
The built-in PDB types enum has been extended to include char16_t and char32_t.
llvm-pdbutil was hitting an llvm_unreachable because it didn't know about these
new values.  The new values are not yet in the DIA documentation, but are
listed in the cvconst.h header that comes as part of the DIA SDK.

Reviewers: asmith, zturner, rnk

Subscribers: stella.stamenova, llvm-commits, sanjoy

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

llvm-svn: 325838

6 years agoUpdate comment for whether or not we can optimize an alias - we're
Eric Christopher [Thu, 22 Feb 2018 23:12:11 +0000 (23:12 +0000)]
Update comment for whether or not we can optimize an alias - we're
checking the alias and not the aliasee. If the alias can be interposed
then we shouldn't do anything.

llvm-svn: 325837

6 years agoFix TestMoveNearest on Windows
Adrian McCarthy [Thu, 22 Feb 2018 22:47:47 +0000 (22:47 +0000)]
Fix TestMoveNearest on Windows

The header file for the DLL tried to declare inline functions and a local
function as dllexport which broke the compile and link.  Removing the bad
declarations solves the problem, and the test passes on Windows now.

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

llvm-svn: 325836

6 years agoFix TestSBData.py on Windows
Adrian McCarthy [Thu, 22 Feb 2018 22:47:14 +0000 (22:47 +0000)]
Fix TestSBData.py on Windows

Ensure that the test data is an array of bytes rather than a string that gets
encoded differently between Python 2 and Python 3.

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

llvm-svn: 325835

6 years ago[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Thu, 22 Feb 2018 22:35:17 +0000 (22:35 +0000)]
[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 325834

6 years agoFix the build of the wasm backend.
Benjamin Kramer [Thu, 22 Feb 2018 22:29:27 +0000 (22:29 +0000)]
Fix the build of the wasm backend.

toString conflicts with llvm::toString here. Yay for overly generic
function names.

llvm-svn: 325833

6 years ago[InstrTypes] add frem and fneg with FMF creators
Sanjay Patel [Thu, 22 Feb 2018 21:46:13 +0000 (21:46 +0000)]
[InstrTypes] add frem and fneg with FMF creators

The more popular opcodes were added at r325730, but we
should have everything here for symmetry. I think both
of these can be used in InstCombine already, but I'll
make those changes as separate clean-ups for InstCombine.

llvm-svn: 325832

6 years ago[DWARFv5] Turn an assert into a diagnostic. Hand-coded assembler files
Paul Robinson [Thu, 22 Feb 2018 21:03:33 +0000 (21:03 +0000)]
[DWARFv5] Turn an assert into a diagnostic. Hand-coded assembler files
should not trigger assertions.

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

llvm-svn: 325831

6 years ago[ThinLTO/gold] Perform cache pruning when cache directory specified
Teresa Johnson [Thu, 22 Feb 2018 20:57:05 +0000 (20:57 +0000)]
[ThinLTO/gold] Perform cache pruning when cache directory specified

Summary:
As pointed out in the review for D37993, for consistency with other
linkers, gold plugin should perform cache pruning whenever there is a
cache directory specified, which will use the default cache policy.

Reviewers: pcc

Subscribers: llvm-commits, inglorion

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

llvm-svn: 325830

6 years ago[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCo...
Craig Topper [Thu, 22 Feb 2018 20:51:26 +0000 (20:51 +0000)]
[TargetLowering] Rename isCondCodeLegal to isCondCodeLegalOrCustom. Add real isCondCodeLegal. Update callers to use one or the other.

isCondCodeLegal internally checked Legal or Custom which is misleading. Though no targets set any cond code action to Custom today.

So I've renamed isCondCodeLegal to isCondCodeLegalOrCustom and added a real isCondCodeLegal that only checks Legal.

I've changed legalization code to use isCondCodeLegalOrCustom and left things reachable via DAG combine as isCondCodeLegal. I've also changed some places that called getCondCodeAction and compared to Legal to just use isCondCodeLegal.

I'm looking at trying to keep SETCC all the way to isel for the AVX512 integer comparisons and I suspect I'll need to make some condition codes Custom to stop DAG combine from changing things post LegalizeOps. Prior to this only Expand stopped DAG combine, but that causes LegalizeOps to try to swap operands or invert rather than calling our Custom handler.

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

llvm-svn: 325829

6 years ago[PDB] Add missing override to silence buildbots
Aaron Smith [Thu, 22 Feb 2018 20:28:40 +0000 (20:28 +0000)]
[PDB] Add missing override to silence buildbots

llvm-svn: 325828

6 years ago[X86] Make the subus special case in LowerVSETCC self contained
Craig Topper [Thu, 22 Feb 2018 20:24:18 +0000 (20:24 +0000)]
[X86] Make the subus special case in LowerVSETCC self contained

Previously this code overrode the flags and opcode used by the later code in LowerVSETCC. This makes the code difficult to read and follow.

This patch moves all the SUBUS code into its own function and makes it responsible for creating its own SDNodes on success.

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

llvm-svn: 325827

6 years ago[PDB] Fix buildbot failure from missing include for DIAEnumLineNumbers
Aaron Smith [Thu, 22 Feb 2018 20:00:07 +0000 (20:00 +0000)]
[PDB] Fix buildbot failure from missing include for DIAEnumLineNumbers

llvm-svn: 325826

6 years agoRevert "[DebugInfo][FastISel] Fix dropping dbg.value()"
Sander de Smalen [Thu, 22 Feb 2018 19:53:59 +0000 (19:53 +0000)]
Revert "[DebugInfo][FastISel] Fix dropping dbg.value()"

This patch reverts r325440 and r325438 because it triggers an
assertion in SelectionDAGBuilder.cpp. Also having debug enabled
may unintentionally affect code-gen. The patch is reverted until
we find a better solution.

llvm-svn: 325825

6 years ago[PDB] Implement more find methods for PDB symbols
Aaron Smith [Thu, 22 Feb 2018 19:47:43 +0000 (19:47 +0000)]
[PDB] Implement more find methods for PDB symbols

Summary:
Add additional find methods on PDB raw symbols.

findChildrenByAddr()
findChildrenByVA()
findInlineFramesByAddr()
findInlineFramesByVA()
findInlineLines()
findInlineLinesByAddr()
findInlineLinesByRVA()
findInlineLinesByVA()

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

llvm-svn: 325824

6 years ago[ThinLTO] Represent relative BF using a scaled representation .
Easwaran Raman [Thu, 22 Feb 2018 19:44:08 +0000 (19:44 +0000)]
[ThinLTO] Represent relative BF using a scaled representation .

Summary:
The current integer representation of relative block frequency prevents
representing relative block frequencies below 1. This change uses a 8 of
the 29 bits to represent the decimal part by using a fixed scale of -8.

Reviewers: tejohnson, davidxl

Subscribers: mehdi_amini, inglorion, llvm-commits

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

llvm-svn: 325823

6 years ago[OpenMP] Limit reduction support for pragma 'distribute' when combined with pragma...
Carlo Bertolli [Thu, 22 Feb 2018 19:38:14 +0000 (19:38 +0000)]
[OpenMP] Limit reduction support for pragma 'distribute' when combined with pragma 'simd'

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

This is a bug fix that removes the emission of reduction support for pragma 'distribute' when found alone or in combinations without simd.
Pragma 'distribute' does not have a reduction clause, but when combined with pragma 'simd' we need to emit the support for simd's reduction clause as part of code generation for distribute. This guard is similar to the one used for reduction support earlier in the same code gen function.

llvm-svn: 325822

6 years agoUpdate lld documentation to mention PDB support.
Zachary Turner [Thu, 22 Feb 2018 19:12:57 +0000 (19:12 +0000)]
Update lld documentation to mention PDB support.

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

llvm-svn: 325821

6 years agoFix DataFlowSanitizer instrumentation pass to take parameter position changes into...
Peter Collingbourne [Thu, 22 Feb 2018 19:09:07 +0000 (19:09 +0000)]
Fix DataFlowSanitizer instrumentation pass to take parameter position changes into account for custom functions.

When DataFlowSanitizer transforms a call to a custom function, the
new call has extra parameters. The attributes on parameters must be
updated to take the new position of each parameter into account.

Patch by Sam Kerner!

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

llvm-svn: 325820

6 years ago[ThinLTO] Always create linked objects file for --thinlto-index-only=
Vitaly Buka [Thu, 22 Feb 2018 19:06:15 +0000 (19:06 +0000)]
[ThinLTO] Always create linked objects file for --thinlto-index-only=

Summary:
ThinLTO indexing may decide to skip all objects. If we don't write something to
the list build system may consider this as failure or linker can reuse a file
from the previews build.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits

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

llvm-svn: 325819

6 years ago[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on...
Vitaly Buka [Thu, 22 Feb 2018 19:06:05 +0000 (19:06 +0000)]
[gold] Extract runLTO to avoid exit(0) from function with non-trivial objects on the stack

Reviewers: tejohnson, pcc

Subscribers: inglorion, llvm-commits

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

llvm-svn: 325818

6 years ago[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.
Matt Morehouse [Thu, 22 Feb 2018 19:00:17 +0000 (19:00 +0000)]
[libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 325817

6 years ago[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separ...
Daniel Neilson [Thu, 22 Feb 2018 18:55:59 +0000 (18:55 +0000)]
[AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately

Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
AlignmentFromAssumptions pass to cease using the old getAlignment()/setAlignment API of
MemoryIntrinsic in favour of getting/setting source & dest specific alignments through
the new API. This allows us to simplify some of the code in this pass and also be more
aggressive about setting the source and destination alignments separately.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: hfinkel, bollu, reames

Reviewed By: reames

Subscribers: reames, llvm-commits

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

llvm-svn: 325816

6 years ago[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h
Simon Pilgrim [Thu, 22 Feb 2018 18:45:13 +0000 (18:45 +0000)]
[SelectionDAG] Move matchUnaryPredicate/matchBinaryPredicate into SelectionDAGNodes.h

This allows us to improve vector constant matching in more DAG code (backends, TargetLowering etc.).

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

llvm-svn: 325815

6 years ago[CUDA] Added missing functions.
Artem Belevich [Thu, 22 Feb 2018 18:40:52 +0000 (18:40 +0000)]
[CUDA] Added missing functions.

Initial commit missed sincos(float), llabs() and few atomics that we
used to pull in from device_functions.hpp, which we no longer include.

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

llvm-svn: 325814

6 years ago[clangd] Extend textDocument/didChange to specify whether diagnostics should be gener...
Eric Liu [Thu, 22 Feb 2018 18:40:39 +0000 (18:40 +0000)]
[clangd] Extend textDocument/didChange to specify whether diagnostics should be generated.

Summary:
This would allow us to disable diagnostics when didChange is called but
diagnostics are not wanted (e.g. code completion).

Reviewers: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 325813

6 years ago[OPENMP] Require valid SourceLocation in function call, NFC.
Alexey Bataev [Thu, 22 Feb 2018 18:33:31 +0000 (18:33 +0000)]
[OPENMP] Require valid SourceLocation in function call, NFC.

Removed default empty SourceLocation argument from `emitCall` function
and require valid location.

llvm-svn: 325812

6 years ago[MC] Don't crash on modulo by zero (PR35650)
Simon Pilgrim [Thu, 22 Feb 2018 18:06:48 +0000 (18:06 +0000)]
[MC] Don't crash on modulo by zero (PR35650)

Extension to D12776, handle modulo by zero in the same way we handle divide by zero.

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

llvm-svn: 325810

6 years ago[ELF] - Rewrote outdated comment. NFC.
George Rimar [Thu, 22 Feb 2018 17:52:43 +0000 (17:52 +0000)]
[ELF] - Rewrote outdated comment. NFC.

llvm-svn: 325809

6 years ago[IRBuilder] add creators for FP with FMF; NFCI
Sanjay Patel [Thu, 22 Feb 2018 17:33:20 +0000 (17:33 +0000)]
[IRBuilder] add creators for FP with FMF; NFCI

Also, add a helper for the constant folder to reduce duplication.

It seems out-of-place for and/or to be doing simplifications here?
Otherwise, I could have used the helper on those opcodes too.

llvm-svn: 325808

6 years ago[docs] Regenerate command line reference
Jonas Hahnfeld [Thu, 22 Feb 2018 17:10:28 +0000 (17:10 +0000)]
[docs] Regenerate command line reference

llvm-svn: 325807

6 years ago[docs] Improve help for OpenMP options, NFC.
Jonas Hahnfeld [Thu, 22 Feb 2018 17:06:35 +0000 (17:06 +0000)]
[docs] Improve help for OpenMP options, NFC.

 * Add HelpText for -fopenmp so that it appears in clang --help.
 * Hide -fno-openmp-simd, only list the positive option.
 * Hide -fopenmp-relocatable-target and -fopenmp-use-tls from
   clang --help and from ClangCommandLineReference.
 * Improve MetaVarName for -Xopenmp-target=<...>.

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

llvm-svn: 325806

6 years ago[docs] Fix duplicate arguments for JoinedAndSeparate
Jonas Hahnfeld [Thu, 22 Feb 2018 17:06:27 +0000 (17:06 +0000)]
[docs] Fix duplicate arguments for JoinedAndSeparate

We can't see how many arguments are in the meta var name, so just
assume that it is the right number.

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

llvm-svn: 325805

6 years ago[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441
Simon Pilgrim [Thu, 22 Feb 2018 16:29:08 +0000 (16:29 +0000)]
[X86][AVX512] Add DQ+VLX scalar int<->fp tests cases for D43441

llvm-svn: 325804

6 years ago[DEBUGINFO] Do not output labels for empty macinfo sections.
Alexey Bataev [Thu, 22 Feb 2018 16:20:30 +0000 (16:20 +0000)]
[DEBUGINFO] Do not output labels for empty macinfo sections.

Summary:
If there is no debug info for macros, do not emit labels for empty
macinfo sections.

Reviewers: probinson, echristo

Subscribers: aprantl, llvm-commits, JDevlieghere

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

llvm-svn: 325803

6 years agoFix "not all control paths return a value" MSVC warning. NFCI.
Simon Pilgrim [Thu, 22 Feb 2018 16:12:27 +0000 (16:12 +0000)]
Fix "not all control paths return a value" MSVC warning. NFCI.

llvm-svn: 325802

6 years ago[clangd] fix test use-after-free from r325774
Sam McCall [Thu, 22 Feb 2018 15:33:33 +0000 (15:33 +0000)]
[clangd] fix test use-after-free from r325774

llvm-svn: 325801

6 years agoTableGen: Add strict assertions to sanity check earlier type checking
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:12 +0000 (15:27 +0000)]
TableGen: Add strict assertions to sanity check earlier type checking

Summary:
Both of these errors should have been caught by type-checking during
parsing.

Change-Id: I891087936fd1a91d21bcda57c256e3edbe12b94d

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325800

6 years agoTableGen: Allow implicit casting between string and code
Nicolai Haehnle [Thu, 22 Feb 2018 15:27:03 +0000 (15:27 +0000)]
TableGen: Allow implicit casting between string and code

Summary:
Perhaps the distinction between the two should be removed entirely
in the long term, and the [{ ... }] syntax should just be a convenient
way of writing multi-line strings.

In the meantime, a lot of existing .td files are quite relaxed about
string vs. code, and this change allows switching on more consistent
type checks without breaking those.

Change-Id: If85e3e04469e41b58e2703b62ac0032d2711713c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325799

6 years agoTableGen: Fix type of resolved and converted lists
Nicolai Haehnle [Thu, 22 Feb 2018 15:26:45 +0000 (15:26 +0000)]
TableGen: Fix type of resolved and converted lists

Summary:
There are no new test cases, but a subsequent patch will introduce
assertions that would be triggered by existing test cases without this
fix.

Change-Id: I6a82d4b311b012aff3932978ae86f6a2dcfbf725

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 325798