platform/upstream/llvm.git
5 years agoGlobalISel: Implement moreElementsVector for G_EXTRACT source
Matt Arsenault [Tue, 19 Feb 2019 16:44:22 +0000 (16:44 +0000)]
GlobalISel: Implement moreElementsVector for G_EXTRACT source

llvm-svn: 354348

5 years ago[OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.
Michael Kruse [Tue, 19 Feb 2019 16:38:20 +0000 (16:38 +0000)]
[OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.

This patch implements the parsing and sema support for OpenMP map
clauses with potential user-defined mapper attached. User defined mapper
is a new feature in OpenMP 5.0. A map clause can have an explicit or
implicit associated mapper, which instructs the compiler to generate
extra data mapping. An example is shown below:

    struct S { int len; int *d; };
    #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
    struct S ss;
    #pragma omp target map(mapper(id) tofrom: ss) // use the mapper with name 'id' to map ss

Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D58074

llvm-svn: 354347

5 years ago[X86][AVX] Update VBROADCAST folds to always use v2i64 X86vzload
Simon Pilgrim [Tue, 19 Feb 2019 16:33:17 +0000 (16:33 +0000)]
[X86][AVX] Update VBROADCAST folds to always use v2i64 X86vzload

The VBROADCAST combines and SimplifyDemandedVectorElts improvements mean that we now more consistently use shorter (128-bit) X86vzload input operands.

Follow up to D58053

llvm-svn: 354346

5 years agoGlobalISel: Implement moreElementsVector for bit ops
Matt Arsenault [Tue, 19 Feb 2019 16:30:19 +0000 (16:30 +0000)]
GlobalISel: Implement moreElementsVector for bit ops

llvm-svn: 354345

5 years ago[yaml2obj][obj2yaml] Remove section type range markers from allowed mappings and...
James Henderson [Tue, 19 Feb 2019 16:22:21 +0000 (16:22 +0000)]
[yaml2obj][obj2yaml] Remove section type range markers from allowed mappings and support hex values

yaml2obj/obj2yaml previously supported SHT_LOOS, SHT_HIOS, and
SHT_LOPROC for section types. These are simply values that delineate a
range and don't really make sense as valid values. For example if a
section has type value 0x70000000, obj2yaml shouldn't print this value
as SHT_LOPROC. Additionally, this was missing the three other range
markers (SHT_HIPROC, SHT_LOUSER and SHT_HIUSER).

This change removes these three range markers. It also adds support for
specifying the type as an integer, to allow section types that LLVM
doesn't know about.

Reviewed by: grimar

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

llvm-svn: 354344

5 years agoCast from SDValue directly instead of superfluous getNode(). NFCI.
Simon Pilgrim [Tue, 19 Feb 2019 16:20:09 +0000 (16:20 +0000)]
Cast from SDValue directly instead of superfluous getNode(). NFCI.

llvm-svn: 354343

5 years agoGlobalISel: Verify g_insert
Matt Arsenault [Tue, 19 Feb 2019 16:10:16 +0000 (16:10 +0000)]
GlobalISel: Verify g_insert

llvm-svn: 354342

5 years ago[mips] Fix indentations in the test. NFC
Simon Atanasyan [Tue, 19 Feb 2019 16:00:07 +0000 (16:00 +0000)]
[mips] Fix indentations in the test. NFC

llvm-svn: 354341

5 years ago[X86][AVX] EltsFromConsecutiveLoads - Add BROADCAST lowering support
Simon Pilgrim [Tue, 19 Feb 2019 15:57:09 +0000 (15:57 +0000)]
[X86][AVX] EltsFromConsecutiveLoads - Add BROADCAST lowering support

This patch adds scalar/subvector BROADCAST handling to EltsFromConsecutiveLoads.

It mainly shows codegen changes to 32-bit code which failed to handle i64 loads, although 64-bit code is also using this new path to more efficiently combine to a broadcast load.

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

llvm-svn: 354340

5 years ago[ELF] - Update test case after yaml2obj format change.
George Rimar [Tue, 19 Feb 2019 15:29:25 +0000 (15:29 +0000)]
[ELF] - Update test case after yaml2obj format change.

yaml2obj was changed in r354338("[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.")

llvm-svn: 354339

5 years ago[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.
George Rimar [Tue, 19 Feb 2019 15:29:07 +0000 (15:29 +0000)]
[yaml2obj][obj2yaml] - Support SHT_GNU_versym (.gnu.version) section.

This patch adds support for parsing dumping the .gnu.version section.
Description of the section is: https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symversion.html#SYMVERTBL

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

llvm-svn: 354338

5 years ago[OpenCL] Change type of block pointer for OpenCL
Alexey Bader [Tue, 19 Feb 2019 15:19:06 +0000 (15:19 +0000)]
[OpenCL] Change type of block pointer for OpenCL

Summary:

For some reason OpenCL blocks in LLVM IR are represented as function pointers.
These pointers do not point to any real function and never get called. Actually
they point to some structure, which in turn contains pointer to the real block
invoke function.
This patch changes represntation of OpenCL blocks in LLVM IR from function
pointers to pointers to `%struct.__block_literal_generic`.
Such representation allows to avoid unnecessary bitcasts and simplifies
further processing (e.g. translation to SPIR-V ) of the module for targets
which do not support function pointers.

Patch by: Alexey Sotkin.

Reviewers: Anastasia, yaxunl, svenvh

Reviewed By: Anastasia

Subscribers: alexbatashev, cfe-commits

Tags: #clang

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

llvm-svn: 354337

5 years agoConvert the eh-frame-hdr-abs-fde.s test to use x86 as a target architecture
Simon Atanasyan [Tue, 19 Feb 2019 15:17:43 +0000 (15:17 +0000)]
Convert the eh-frame-hdr-abs-fde.s test to use x86 as a target architecture

The test checks common functionality. Let's use `x86` (generic LLD target)
as a target architecture.

llvm-svn: 354336

5 years agoRecommit r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping...
George Rimar [Tue, 19 Feb 2019 14:53:48 +0000 (14:53 +0000)]
Recommit r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."

Fix:
Replace
assert(!IO.getContext() && "The IO context is initialized already");
with
assert(IO.getContext() && "The IO context is not initialized");
(this was introduced in r354329, where I tried to quickfix the darwin BB
and seems copypasted the assert from the wrong place).

Original commit message:

The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html

Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.

We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.

Everything else changed in this patch seems to be straightforward.

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

llvm-svn: 354335

5 years ago[RISCV][NFC] Move some std::string to StringRef
Alex Bradbury [Tue, 19 Feb 2019 14:42:00 +0000 (14:42 +0000)]
[RISCV][NFC] Move some std::string to StringRef

llvm-svn: 354333

5 years agoRevert r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of...
George Rimar [Tue, 19 Feb 2019 14:38:25 +0000 (14:38 +0000)]
Revert r354328, r354329 "[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section."

Something went wrong. Bots are unhappy:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/44113/steps/test/logs/stdio

llvm-svn: 354332

5 years ago[clangd] Handle unresolved scope specifier when fixing includes.
Eric Liu [Tue, 19 Feb 2019 14:32:22 +0000 (14:32 +0000)]
[clangd] Handle unresolved scope specifier when fixing includes.

Summary:
In the following examples, "clangd" is unresolved, and the fixer will try to fix
include for `clang::clangd`; however, clang::clangd::X is usually intended. So
when handling a qualifier that is unresolved, we change the unresolved name and
scopes so that the fixer will fix "clang::clangd::X" in the following example.
```
  namespace clang {
   clangd::X
~~~~~~
  }
  // or
  clang::clangd::X
         ~~~~~~
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354330

5 years agoFix BB after r354328.
George Rimar [Tue, 19 Feb 2019 14:22:10 +0000 (14:22 +0000)]
Fix BB after r354328.

Bot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/30188/steps/build_Lld/logs/stdio

Error:
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1013:15: error: unused variable 'Object' [-Werror,-Wunused-variable]
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
              ^
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/lib/ObjectYAML/ELFYAML.cpp:1023:15: error: unused variable 'Object' [-Werror,-Wunused-variable]
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());

Fix:
change
  const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
  assert(Object && "The IO context is not initialized");
to
  assert(!IO.getContext() && "The IO context is initialized already");

llvm-svn: 354329

5 years ago[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section.
George Rimar [Tue, 19 Feb 2019 14:03:14 +0000 (14:03 +0000)]
[obj2yaml][yaml2obj] - Add support of parsing/dumping of the .gnu.version_r section.

The section is described here:
https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/symverrqmts.html

Patch just teaches obj2yaml/yaml2obj to dump and parse such sections.

We did the finalization of string tables very late,
and I had to move the logic to make it a bit earlier.
That was needed in this patch since .gnu.version_r adds strings to .dynstr.
This might also be useful for implementing other special sections.

Everything else changed in this patch seems to be straightforward.

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

llvm-svn: 354328

5 years agoRevert "minidump: Add ability to attach (breakpad) symbol files to placeholder modules"
Pavel Labath [Tue, 19 Feb 2019 13:52:31 +0000 (13:52 +0000)]
Revert "minidump: Add ability to attach (breakpad) symbol files to placeholder modules"

This reverts r354263, because it uncovered a problem in handling of the
minidumps with conflicting UUIDs. If a minidump contains two files with
the same UUID, we will not create to placeholder modules for them, but
instead reuse the first one for the second instance. This creates a
problem because these modules have their load address hardcoded in them
(and I've added an assert to verify that).

Technically this is not a problem with this patch, as the same issue
existed in the previous implementation, but it did not have the assert
which would diagnose that. Nonetheless, I am reverting this until I
figure out what's the best course of action in this situation.

llvm-svn: 354324

5 years ago[RISCV] Re-organise calling convention tests
Alex Bradbury [Tue, 19 Feb 2019 13:47:19 +0000 (13:47 +0000)]
[RISCV] Re-organise calling convention tests

Re-organise calling convention tests to prepare for ilp32f and ilp32d hard
float ABI tests. It's also clear that we need to introduce similar tests for
lp64.

llvm-svn: 354323

5 years agoFix BB after r354319 "[yaml2obj] - Do not skip zeroes blocks if there are relocations...
George Rimar [Tue, 19 Feb 2019 13:27:06 +0000 (13:27 +0000)]
Fix BB after r354319 "[yaml2obj] - Do not skip zeroes blocks if there are relocations against them."

Fix: move the test to x86 folder.
Seems it is needed, because llvm-objdump invocation used in test has -D (disasm) flag.

BB: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/23016

/local/buildbot/slaves/hexagon-build-02/clang-hexagon-elf/stage1/bin/llvm-objdump:
error: '/local/buildbot/slaves/hexagon-build-02/clang-hexagon-elf/stage1/test/tools/llvm-objdump/Output/disasm-zeroes-relocations.test.tmp':
can't find target: : error: unable to get target for 'x86_64--', see --version and --triple.
.

llvm-svn: 354322

5 years ago[yaml2obj] - Do not skip zeroes blocks if there are relocations against them.
George Rimar [Tue, 19 Feb 2019 12:38:36 +0000 (12:38 +0000)]
[yaml2obj] - Do not skip zeroes blocks if there are relocations against them.

This is for -D -reloc combination.

With this patch, we do not skip the zero bytes that have a relocation against
them when -reloc is used. If -reloc is not used, then the behavior will be the same.

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

llvm-svn: 354319

5 years ago[yaml2obj] - Do not ignore explicit addresses for .dynsym and .dynstr
George Rimar [Tue, 19 Feb 2019 12:15:04 +0000 (12:15 +0000)]
[yaml2obj] - Do not ignore explicit addresses for .dynsym and .dynstr

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

Previously if the addresses were set in YAML they were ignored for
.dynsym and .dynstr sections. The patch fixes that.

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

llvm-svn: 354318

5 years agoFix obsolete comment. NFC
Diana Picus [Tue, 19 Feb 2019 11:34:36 +0000 (11:34 +0000)]
Fix obsolete comment. NFC

Both files mentioned in the comment now include TargetOpcodes.def. Just
mention that directly.

llvm-svn: 354316

5 years ago[mips] Remove trailing whitespaces from the test case. NFC
Simon Atanasyan [Tue, 19 Feb 2019 11:15:28 +0000 (11:15 +0000)]
[mips] Remove trailing whitespaces from the test case. NFC

llvm-svn: 354315

5 years ago[NFC] API for signaling that the current loop is being deleted
Max Kazantsev [Tue, 19 Feb 2019 11:14:05 +0000 (11:14 +0000)]
[NFC] API for signaling that the current loop is being deleted

We are planning to be able to delete the current loop in LoopSimplifyCFG
in the future. Add API to notify the loop pass manager that it happened.

llvm-svn: 354314

5 years ago[NFC] Store loop header in a local to keep it available after the loop is deleted
Max Kazantsev [Tue, 19 Feb 2019 11:13:58 +0000 (11:13 +0000)]
[NFC] Store loop header in a local to keep it available after the loop is deleted

llvm-svn: 354313

5 years ago[mips] Create LA25 thunks for MIPS R6 code
Simon Atanasyan [Tue, 19 Feb 2019 11:11:12 +0000 (11:11 +0000)]
[mips] Create LA25 thunks for MIPS R6 code

MIPS R6 code uses the `R_MIPS_PC26_S2` relocation for calls which might
cross boundaries of non-PIC-to-PIC code. We need to create a LA25 thunks
for that case.

llvm-svn: 354312

5 years ago[MIPS] Handle cross-mode (regular <-> microMIPS) jumps
Simon Atanasyan [Tue, 19 Feb 2019 10:36:58 +0000 (10:36 +0000)]
[MIPS] Handle cross-mode (regular <-> microMIPS) jumps

The patch solves two tasks:

1. MIPS ABI allows to mix regular and microMIPS code and perform
cross-mode jumps. Linker needs to detect such cases and replace
jump/branch instructions by their cross-mode equivalents.

2. Other tools like dunamic linkers need to recognize cases when dynamic
table entries, e_entry field of an ELF header etc point to microMIPS
symbol. Linker should provide such information.

The first task is implemented in the `MIPS<ELFT>::relocateOne()` method.
New routine `fixupCrossModeJump` detects ISA mode change, checks and
replaces an instruction.

The main problem is how to recognize that relocation target is microMIPS
symbol. For absolute and section symbols compiler or assembler set the
less-significant bit of the symbol's value or sum of the symbol's value
and addend. And this bit signals to linker about microMIPS code. For
global symbols compiler cannot do the same trick because other tools like,
for example, disassembler wants to know an actual position of the symbol.
So compiler sets STO_MIPS_MICROMIPS flag in the `st_other` field.

In `MIPS<ELFT>::relocateOne()` method we have a symbol's value only and
cannot access any symbol's attributes. To pass type of the symbol
(regular/microMIPS) to that routine as well as other places where we
write a symbol value as-is (.dynamic section, `Elf_Ehdr::e_entry` field
etc) we set when necessary a less-significant bit in the `getSymVA`
function.

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

llvm-svn: 354311

5 years ago[ARM GlobalISel] Support G_PHI for Thumb2
Diana Picus [Tue, 19 Feb 2019 10:26:47 +0000 (10:26 +0000)]
[ARM GlobalISel] Support G_PHI for Thumb2

Same as arm mode.

llvm-svn: 354310

5 years agoFix vscode tests for python3
Pavel Labath [Tue, 19 Feb 2019 08:25:25 +0000 (08:25 +0000)]
Fix vscode tests for python3

encode/decode the data before sending it over the socket. Since (AFAICT)
the vscode protocol (unlike the gdb-remote one) is fully textual, using
the utf8 codec here is appropriate.

llvm-svn: 354308

5 years ago[gui] Simplify SourceFileWindowDelegate::WindowDelegateDraw
Pavel Labath [Tue, 19 Feb 2019 08:12:41 +0000 (08:12 +0000)]
[gui] Simplify SourceFileWindowDelegate::WindowDelegateDraw

instead of printf-ing into a buffer, and them using that buffer as a
format string, simply use the appropriate indirect format string.

This also fixes a -Wformat-truncation warning with gcc.

llvm-svn: 354307

5 years ago[Dominators] Fix and optimize edge insertion of depth-based search
Fangrui Song [Tue, 19 Feb 2019 05:16:52 +0000 (05:16 +0000)]
[Dominators] Fix and optimize edge insertion of depth-based search

Summary:
After (x,y) is inserted, depth-based search finds all affected v that satisfies:

depth(nca(x,y))+1 < depth(v) && there exists a path P from y to v where every w on P satisfies depth(v) <= depth(w)

This reduces to a widest path problem (maximizing the depth of the
minimum vertex in the path) which can be solved by a modified version of
Dijkstra with a bucket queue (named depth-based search in the paper).

The algorithm visits vertices in decreasing order of bucket number.
However, the current code misused priority_queue to extract them in
increasing order. I cannot think of a failing scenario but it surely may
process vertices more than once due to the local usage of Processed.

This patch fixes this bug and simplifies/optimizes the code a bit. Also
add more comments.

Reviewers: kuhar

Reviewed By: kuhar

Subscribers: kristina, jdoerfert, llvm-commits, NutshellySima, brzycki

Tags: #llvm

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

llvm-svn: 354306

5 years ago[X86] Remove command line strings from the ProcIntel* features.
Craig Topper [Tue, 19 Feb 2019 03:04:14 +0000 (03:04 +0000)]
[X86] Remove command line strings from the ProcIntel* features.

These should always follow the CPU string. There's no reason to control them independently.

llvm-svn: 354304

5 years ago[lldb-instr] Test that we ignore existing macros.
Jonas Devlieghere [Tue, 19 Feb 2019 01:20:49 +0000 (01:20 +0000)]
[lldb-instr] Test that we ignore existing macros.

Although the functionality was already present, it wasn't tested.

llvm-svn: 354303

5 years ago[lldb-instr] Wrap returns of struct/classes in LLDB_RECORD_RESULT
Jonas Devlieghere [Tue, 19 Feb 2019 01:04:31 +0000 (01:04 +0000)]
[lldb-instr] Wrap returns of struct/classes in LLDB_RECORD_RESULT

The instrumentation framework requires return values of custom classes
and structs to be wrapped in the LLDB_RECORD_RESULT macro.

llvm-svn: 354301

5 years agoDisable TestModuleCXX.test on Windows
Jonas Devlieghere [Tue, 19 Feb 2019 00:08:10 +0000 (00:08 +0000)]
Disable TestModuleCXX.test on Windows

Importing cxx modules doesn't seem to work on Windows:

error: a.out :: Class 'tagARRAYDESC' has a member 'tdescElem' of type
  'tagTYPEDESC' which does not have a complete definition.
error: a.out :: Class 'tagPARAMDESCEX' has a member 'varDefaultValue' of type
  'tagVARIANT' which does not have a complete definition.
llvm-svn: 354300

5 years ago[GlobalISel][AArch64] Legalize + select some llvm.ctlz.* intrinsics
Jessica Paquette [Mon, 18 Feb 2019 23:33:24 +0000 (23:33 +0000)]
[GlobalISel][AArch64] Legalize + select some llvm.ctlz.* intrinsics

Legalize/select llvm.ctlz.*

Add select-ctlz to show that we actually select them. Update arm64-clrsb.ll and
arm64-vclz.ll to show that we perform valid transformations in optimized builds,
and document where GISel can improve.

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

llvm-svn: 354299

5 years ago[CGP] form usub with overflow from sub+icmp
Sanjay Patel [Mon, 18 Feb 2019 23:33:05 +0000 (23:33 +0000)]
[CGP] form usub with overflow from sub+icmp

The motivating x86 cases for forming the intrinsic are shown in PR31754 and PR40487:
https://bugs.llvm.org/show_bug.cgi?id=31754
https://bugs.llvm.org/show_bug.cgi?id=40487
..and those are shown in the IR test file and x86 codegen file.

Matching the usubo pattern is harder than uaddo because we have 2 independent values rather than a def-use.

This adds a TLI hook that should preserve the existing behavior for uaddo formation, but disables usubo
formation by default. Only x86 overrides that setting for now although other targets will likely benefit
by forming usbuo too.

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

llvm-svn: 354298

5 years ago[lldbtest] Fix some code to be compatible between py2 and py3.
Davide Italiano [Mon, 18 Feb 2019 23:18:14 +0000 (23:18 +0000)]
[lldbtest] Fix some code to be compatible between py2 and py3.

llvm-svn: 354297

5 years ago[clang][test] Fix FileManagerTest.getFileDontOpenRealPath for Windows
Jan Korous [Mon, 18 Feb 2019 23:12:29 +0000 (23:12 +0000)]
[clang][test] Fix FileManagerTest.getFileDontOpenRealPath for Windows

llvm-svn: 354296

5 years agoAMDGPU: Use MachineInstr::mayAlias to replace areMemAccessesTriviallyDisjoint in...
Changpeng Fang [Mon, 18 Feb 2019 23:00:26 +0000 (23:00 +0000)]
AMDGPU: Use MachineInstr::mayAlias to replace areMemAccessesTriviallyDisjoint in LoadStoreOptimizer pass.

Summary:
  This is to fix a memory dependence bug in LoadStoreOptimizer.

Reviewers:
  arsenm, rampitec

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

llvm-svn: 354295

5 years ago[lldb-instr] Add constructor and move test into lit/tools
Jonas Devlieghere [Mon, 18 Feb 2019 22:59:52 +0000 (22:59 +0000)]
[lldb-instr] Add constructor and move test into lit/tools

The test had an implicit constructor for the Foo struct. Also, as the
instrumentation doesn't have to be reproducer specific, I moved the
tests into the lit/tools directory.

llvm-svn: 354294

5 years agoGlobalISel: Implement widenScalar for g_extract scalar results
Matt Arsenault [Mon, 18 Feb 2019 22:39:27 +0000 (22:39 +0000)]
GlobalISel: Implement widenScalar for g_extract scalar results

llvm-svn: 354293

5 years agoGlobalISel: Make buildExtract use DstOp/SrcOp
Matt Arsenault [Mon, 18 Feb 2019 22:39:22 +0000 (22:39 +0000)]
GlobalISel: Make buildExtract use DstOp/SrcOp

llvm-svn: 354292

5 years agoReland "[clang][FileManager] fillRealPathName even if we aren't opening the file"
Jan Korous [Mon, 18 Feb 2019 22:33:40 +0000 (22:33 +0000)]
Reland "[clang][FileManager] fillRealPathName even if we aren't opening the file"

This reverts commit e2bb3121fd4ab5b01f9ec1d2e3e9877db9c6a54c.
+ fixed test for Windows

llvm-svn: 354291

5 years ago[LSan][Darwin][NFC] Add comment explaining test failure
Julian Lettner [Mon, 18 Feb 2019 22:29:17 +0000 (22:29 +0000)]
[LSan][Darwin][NFC] Add comment explaining test failure

llvm-svn: 354290

5 years agoOne more fix while I'm looking at this - remove the
Jason Molenda [Mon, 18 Feb 2019 22:18:11 +0000 (22:18 +0000)]
One more fix while I'm looking at this - remove the
unused IsSBProcess method, and have IsFBSProcess
return false if we don't have API that we can use to
make that determination, so we'll try other API
if we can.

llvm-svn: 354289

5 years agoAh, misunderstood Jonas' feedback - fix this so we'll
Jason Molenda [Mon, 18 Feb 2019 22:13:34 +0000 (22:13 +0000)]
Ah, misunderstood Jonas' feedback - fix this so we'll
do the right thing when both API are available.  We
want to try both of them if the first one fails.

llvm-svn: 354288

5 years agoClean up an unused variable warning when building this for
Jason Molenda [Mon, 18 Feb 2019 22:10:23 +0000 (22:10 +0000)]
Clean up an unused variable warning when building this for
mac native.

llvm-svn: 354287

5 years ago[Python3] Fix TestObjCMethods.py to work with py2 and 3.
Davide Italiano [Mon, 18 Feb 2019 21:53:02 +0000 (21:53 +0000)]
[Python3] Fix TestObjCMethods.py to work with py2 and 3.

llvm-svn: 354286

5 years ago[libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM include
Petr Hosek [Mon, 18 Feb 2019 20:58:06 +0000 (20:58 +0000)]
[libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM include

This include doesn't seem to be needed for the standalone build (it's
not being used by libc++ build either), but introduces unnecessary
dependency because HandleOutOfTreeLLVM performs checks that require
a working C++ library. We shouldn't require a working C++ library to
build libc++abi or libc++ (it's what we're building after all).

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

llvm-svn: 354284

5 years ago[Reproducers] Make clang use lldb's VFS.
Jonas Devlieghere [Mon, 18 Feb 2019 20:31:18 +0000 (20:31 +0000)]
[Reproducers] Make clang use lldb's VFS.

In r353906 we hooked up clang and lldb's reproducer infrastructure to
capture files used by clang. This patch adds the necessary logic to have
clang reuse the files from lldb's reproducer during replay.

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

llvm-svn: 354283

5 years ago[Sanitizer] On Darwin `__sanitizer_print_stack_trace` only prints topmost frame
Julian Lettner [Mon, 18 Feb 2019 18:47:49 +0000 (18:47 +0000)]
[Sanitizer] On Darwin `__sanitizer_print_stack_trace` only prints topmost frame

In compiler-rt we have the notion of a `fast` and a `slow` stack
unwinder. Darwin currently only supports the fast unwinder.

From reading the code, my understanding is that
`BufferedStackTrace::Unwind` can be called with `bp=0, stack_top=0,
stack_bottom=0, request_fast_unwind=false`. If
`request_fast_unwind=true`, then we alos need to supply bp, stack_top,
and stack_bottom.

However, `BufferedStackTrace::Unwind` uses
`StackTrace::WillUseFastUnwind` which will adapt `request_fast_unwind`
if the requested unwinder is not supported. On Darwin, the result is
that we don't pass actual values for bp, stack_top, and stack_bottom,
but end up using the fast unwinder. The tests then fail because we only
print the topmost stack frame.

This patch adds a check to `WillUseFastUnwind` at the point of usage to
avoid the mismatch between `request_fast_unwind` and what `Unwind`
actually does. I am also interested in cleaning up the
`request_fast_unwind` machinery so this patch just the simplest thing
possible so I can enable the tests.

Reviewers: vitalybuka, vsk

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

llvm-svn: 354282

5 years agoGlobalISel: Fix double count of offset for irregular vector breakdowns
Matt Arsenault [Mon, 18 Feb 2019 17:01:09 +0000 (17:01 +0000)]
GlobalISel: Fix double count of offset for irregular vector breakdowns

Fixes cases with odd vectors that break into multiple requested size
pieces.

llvm-svn: 354280

5 years ago[x86] split more v8f32/v8i32 shuffles in lowering
Sanjay Patel [Mon, 18 Feb 2019 16:46:12 +0000 (16:46 +0000)]
[x86] split more v8f32/v8i32 shuffles in lowering

Similar to D57867 - this is a small patch with lots of test diffs.
With half-vector-width narrowing potential, using an extract + 128-bit vshufps
is a win because it replaces a 256-bit shuffle with a 128-bit shufle.

This seems like it should be a win even for targets with 'fast-variable-shuffle',
but we are intentionally deferring that to an independent change to make sure
that is true.

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

llvm-svn: 354279

5 years agoUn-XFAIL TestLinuxCore for windows
Pavel Labath [Mon, 18 Feb 2019 16:05:26 +0000 (16:05 +0000)]
Un-XFAIL TestLinuxCore for windows

It turns out all that was needed to get this test passing was to fix the
python3 incompatibility.

llvm-svn: 354278

5 years agoRevert "[InstCombine] reduce even more unsigned saturated add with 'not' op"
Sanjay Patel [Mon, 18 Feb 2019 16:04:22 +0000 (16:04 +0000)]
Revert "[InstCombine] reduce even more unsigned saturated add with 'not' op"

This reverts commit 079b610c29b4a428b3ae7b64dbac0378facf6632.
Bots are failing after this change on a stage 2 compile of clang.

llvm-svn: 354277

5 years ago[InstCombine] reduce even more unsigned saturated add with 'not' op
Sanjay Patel [Mon, 18 Feb 2019 15:21:39 +0000 (15:21 +0000)]
[InstCombine] reduce even more unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

  Name: uaddsat, -1 fval
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %notx, %y
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

  Name: uaddsat, -1 fval + ult
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %y, %notx
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/nTp

llvm-svn: 354276

5 years agoFix TestLinuxCore for python3
Pavel Labath [Mon, 18 Feb 2019 15:04:33 +0000 (15:04 +0000)]
Fix TestLinuxCore for python3

- dictionaries don't have iteritems()
- division returns floats

llvm-svn: 354273

5 years ago[clangd] Add tests for template specializations
Kadir Cetinkaya [Mon, 18 Feb 2019 14:23:19 +0000 (14:23 +0000)]
[clangd] Add tests for template specializations

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354272

5 years ago[MCA] Correctly update register definitions in the PRF after move elimination.
Andrea Di Biagio [Mon, 18 Feb 2019 14:15:25 +0000 (14:15 +0000)]
[MCA] Correctly update register definitions in the PRF after move elimination.

This patch fixes a bug where register writes performed by optimizable register
moves were sometimes wrongly treated like partial register updates.  Before this
patch, llvm-mca wrongly predicted a 1.50 IPC for test reg-move-elimination-6.s
(added by this patch).  With this patch, llvm-mca correctly updates the register
defintions in the PRF, and the IPC for that test is now correctly reported as 2.

llvm-svn: 354271

5 years ago[llvm-readobj] - Simplify .gnu.version_d dumping.
George Rimar [Mon, 18 Feb 2019 13:58:12 +0000 (13:58 +0000)]
[llvm-readobj] - Simplify .gnu.version_d dumping.

This is similar to D58048.

Instead of scanning the dynamic table to read the
DT_VERDEFNUM, we could take it from the sh_info field.
(https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html)

The patch does this.

llvm-svn: 354270

5 years ago[clangd] Cache include fixes for diagnostics caused by the same unresolved name or...
Eric Liu [Mon, 18 Feb 2019 13:12:10 +0000 (13:12 +0000)]
[clangd] Cache include fixes for diagnostics caused by the same unresolved name or incomplete type.

Summary:
Multiple diagnostics can be caused by the same unresolved name or incomplete type,
especially if the code is copy-pasted without #includes. The cache can avoid making
repetitive index requests, and thus reduce latency and allow more diagnostics to be
fixed (we limit the number of index requests for each parse).

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354268

5 years ago[ASTImporter] Find previous friend function template
Gabor Marton [Mon, 18 Feb 2019 13:09:27 +0000 (13:09 +0000)]
[ASTImporter] Find previous friend function template

Reviewers: a_sidorin, shafik, a.sidorin

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

Tags: #clang

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

llvm-svn: 354267

5 years ago[clang-tidy] Fix links in docs.
Alexander Kornienko [Mon, 18 Feb 2019 12:50:35 +0000 (12:50 +0000)]
[clang-tidy] Fix links in docs.

llvm-svn: 354266

5 years ago[ARM] Add pre-defined macros for ROPI and RWPI
Oliver Stannard [Mon, 18 Feb 2019 12:39:47 +0000 (12:39 +0000)]
[ARM] Add pre-defined macros for ROPI and RWPI

This adds ACLE-defined macros to test for code being compiled in the ROPI and
RWPI position-independence modes.

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

llvm-svn: 354265

5 years ago[NFC] Make Optional<T> trivially copyable when T is trivially copyable
Serge Guelton [Mon, 18 Feb 2019 12:07:12 +0000 (12:07 +0000)]
[NFC] Make Optional<T> trivially copyable when T is trivially copyable

This is a follow-up to r354246 and a reimplementation of https://reviews.llvm.org/D57097?id=186600
that should not trigger any UB thanks to the use of an union.

This may still be subject to the problem solved by std::launder, but I'm unsure how it interacts whith union.
/me plans to revert if this triggers any relevant bot failure. At least this validates in Release mode with
clang 6.0.1 and gcc 4.8.5.

llvm-svn: 354264

5 years agominidump: Add ability to attach (breakpad) symbol files to placeholder modules
Pavel Labath [Mon, 18 Feb 2019 11:55:01 +0000 (11:55 +0000)]
minidump: Add ability to attach (breakpad) symbol files to placeholder modules

This re-commits r353677, which was reverted due to test failures on the
windows bot. The issue there was that ObjectFilePECOFF vended its base
address through the incorrect interface. SymbolFilePDB depended on that,
which lead to assertion failures when SymbolFilePDB was attempting to
use the placeholder object files as a base. This has been fixed in
r354258

It also fixes one small problem in the original patch. The issue was that the
Module class would attempt to overwrite the object file we created in
CreateModuleFromObjectFile if the file corresponding to the placeholder object
file happened to exist (but we have already disqualified it due to UUID
mismatch. The fix is simple -- we set the m_did_load_objfile flag to properly
record the fact that we have already created an object file for the module.

The original commit message was:

The reason this wasn't working was that ProcessMinidump was creating odd
object-file-less modules, and SymbolFileBreakpad required the module to
have an associated object file because it needed to get its base
address.

This fixes that by introducing a PlaceholderObjectFile to serve as a
dummy object file. The general idea for this is taken from D55142, but
I've reworked it a bit to avoid the need for the PlaceholderModule
class. Now that we have an object file, our modules are sufficiently
similar to regular modules that we can use the regular Module class
almost out of the box -- the only thing I needed to tweak was the
Module::CreateModuleFromObjectFile functon to set the module's FileSpec
in addition to it's architecture. This wasn't needed for ObjectFileJIT
(the other user of CreateModuleFromObjectFile), but it shouldn't hurt it
either, and the change seems like a straightforward extension of this
function.

Reviewers: clayborg, lemo, amccarth

Subscribers: lldb-commits

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

llvm-svn: 354263

5 years ago[clang][Index] Fix usage of IndexImplicitInstantiation
Kadir Cetinkaya [Mon, 18 Feb 2019 11:30:43 +0000 (11:30 +0000)]
[clang][Index] Fix usage of IndexImplicitInstantiation

Summary:
Indexing context was skipping explicit template instantiations as well.
This patch makes sure it only skips implicit ones.

Subscribers: arphaman, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354262

5 years ago[MCA] Slightly refactor method writeStartEvent in WriteState and ReadState. NFCI
Andrea Di Biagio [Mon, 18 Feb 2019 11:27:11 +0000 (11:27 +0000)]
[MCA] Slightly refactor method writeStartEvent in WriteState and ReadState. NFCI

This is another change in preparation for PR37494.
No functional change intended.

llvm-svn: 354261

5 years ago[ASTImporter] Unify redecl chain tests as type parameterized tests
Gabor Marton [Mon, 18 Feb 2019 11:09:56 +0000 (11:09 +0000)]
[ASTImporter] Unify redecl chain tests as type parameterized tests

Summary:
This patch unifies all those tests which check the correctness of the
redecl chains. Previously we had several structurally very similar test
cases for each language construct (class, function, variable, function
template, ...).

We still use value-parameterized tests for the different AST
compatibility switches (-fdelayed-template-parsing, -fms-compatibility).
Gtest makes it possible to have either value-parameterized or
type-parameterized fixtures. However, we cannot have both value- and
type-parameterized test fixtures. So we use a value-parameterized test
fixture in the gtest sense. We intend to mimic gtest's type-parameters
via the type template parameter. We manually instantiate the different
tests with the each types.

After this patch I am planning to put the "generic redecl chain" related
tests into their own separate test file (in another patch).

Reviewers: a_sidorin, shafik, a.sidorin

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

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

llvm-svn: 354259

5 years agoPECOFF: Implement GetBaseAddress
Pavel Labath [Mon, 18 Feb 2019 11:06:57 +0000 (11:06 +0000)]
PECOFF: Implement GetBaseAddress

COFF files are modelled in lldb as having one big container section
spanning the entire module image, with the actual sections being
subsections of that. In this model, the base address is simply the
address of the first byte of that section.

This also removes the hack where ObjectFilePECOFF was using the
m_file_offset field to communicate this information. Using file offset
for this purpose is completely wrong, as that is supposed to indicate
where is this ObjectFile located in the file on disk. This field is only
meaningful for fat binaries, and should normally be 0.

Both PDB plugins have been updated to use GetBaseAddress instead of
GetFileOffset.

llvm-svn: 354258

5 years agoReturn better error message from GDBRemoteCommunication::ConnectLocally
Pavel Labath [Mon, 18 Feb 2019 10:36:23 +0000 (10:36 +0000)]
Return better error message from GDBRemoteCommunication::ConnectLocally

llvm-svn: 354256

5 years agoSet cmake policy CMP0075 to NEW
Pavel Labath [Mon, 18 Feb 2019 10:09:29 +0000 (10:09 +0000)]
Set cmake policy CMP0075 to NEW

Summary:
The policy is about cmake_include_files ignoring
CMAKE_REQUIRED_LIBRARIES in the OLD behavior. Llvm already sets this
policy to NEW, but that is overridden by our cmake_minimum_required
command.

This makes our cmake policy setup consistent with the llvm build files
and avoids a warning when using newer versions of cmake.

Reviewers: sgraenitz, xiaobai

Subscribers: mgorny, lldb-commits

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

llvm-svn: 354251

5 years ago[llvm-exegesis] [NFC] Fixing typo.
Guillaume Chatelet [Mon, 18 Feb 2019 10:08:20 +0000 (10:08 +0000)]
[llvm-exegesis] [NFC] Fixing typo.

Reviewers: courbet, gchatelet

Reviewed By: courbet, gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 354250

5 years agoRecommit [NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Mon, 18 Feb 2019 08:46:32 +0000 (08:46 +0000)]
Recommit [NFC] Better encapsulation of llvm::Optional Storage

Second attempt, trying to navigate out of the UB zone using
union for storage instead of raw bytes.

I'm prepared to revert that commit as soon as validation breaks,
which is likely to happen.

llvm-svn: 354246

5 years agoRevert r354244 "[DAGCombiner] Eliminate dead stores to stack."
Clement Courbet [Mon, 18 Feb 2019 08:24:29 +0000 (08:24 +0000)]
Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."

Breaks some bots.

llvm-svn: 354245

5 years ago[DAGCombiner] Eliminate dead stores to stack.
Clement Courbet [Mon, 18 Feb 2019 07:59:01 +0000 (07:59 +0000)]
[DAGCombiner] Eliminate dead stores to stack.

Summary:
A store to an object whose lifetime is about to end can be removed.

See PR40550 for motivation.

Reviewers: niravd

Subscribers: llvm-commits

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

llvm-svn: 354244

5 years ago[MC] Make SubtargetFeatureKV only store one FeatureBitset and use an 'unsigned' to...
Craig Topper [Mon, 18 Feb 2019 06:46:17 +0000 (06:46 +0000)]
[MC] Make SubtargetFeatureKV only store one FeatureBitset and use an 'unsigned' to hold the value.

This class is used for two difference tablegen generated tables. For one of the tables the Value FeatureBitset only has one bit set. For the other usage the Implies field was unused.

This patch changes the Value field to just be an unsigned. For the usage that put a real vector in bitset, we now use the previously unused Implies field and leave the Value field unused instead.

This is good for a 16K reduction in the size of llc on my local build with all targets enabled.

llvm-svn: 354243

5 years agogn build: Merge r354156
Nico Weber [Mon, 18 Feb 2019 01:36:52 +0000 (01:36 +0000)]
gn build: Merge r354156

llvm-svn: 354242

5 years agolld-link: Mention comdat selection work in the 9.0.0 wip release notes
Nico Weber [Mon, 18 Feb 2019 01:32:16 +0000 (01:32 +0000)]
lld-link: Mention comdat selection work in the 9.0.0 wip release notes

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

llvm-svn: 354241

5 years agoRevert [NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 23:01:41 +0000 (23:01 +0000)]
Revert [NFC] Better encapsulation of llvm::Optional Storage

llvm-svn: 354240

5 years ago[NFC] Better encapsulation of llvm::Optional Storage, part II
Serge Guelton [Sun, 17 Feb 2019 22:54:23 +0000 (22:54 +0000)]
[NFC] Better encapsulation of llvm::Optional Storage, part II

Fix for better Windows support.

llvm-svn: 354239

5 years ago[NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 22:41:14 +0000 (22:41 +0000)]
[NFC] Better encapsulation of llvm::Optional Storage

Second attempt, trying to navigate out of the UB zone using
union for storage instead of raw bytes.

I'm prepared to revert that commit as soon as validation breaks,
which is likely to happen.

llvm-svn: 354238

5 years ago[LLVM-C] Add bindings to create enumerators
Robert Widmann [Sun, 17 Feb 2019 21:25:47 +0000 (21:25 +0000)]
[LLVM-C] Add bindings to create enumerators

Summary: The C API don't have the bindings to create enumerators, needed to create an enumeration.

Reviewers: whitequark, CodaFi, harlanhaskins, deadalnix

Reviewed By: whitequark, CodaFi, harlanhaskins

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 354237

5 years ago[InstCombine] add even more tests for unsigned saturated add; NFC
Sanjay Patel [Sun, 17 Feb 2019 20:01:59 +0000 (20:01 +0000)]
[InstCombine] add even more tests for unsigned saturated add; NFC

The pattern-matching from rL354221 / rL354224 doesn't cover
these, so we're up to 8 different commuted possibilities.

There may still be 1 more variant of this pattern.

llvm-svn: 354236

5 years ago[analyzer] Make valist.Uninitialized depend on ValistBase
Kristof Umann [Sun, 17 Feb 2019 19:51:42 +0000 (19:51 +0000)]
[analyzer] Make valist.Uninitialized depend on ValistBase

Accidentally left this dependency out, resulting in an assert failure if
only valist.Uninitialized is enabled from the valist package.

llvm-svn: 354235

5 years ago[X86] In FP_TO_INTHelper, when moving data from SSE register to X87 register file...
Craig Topper [Sun, 17 Feb 2019 19:23:49 +0000 (19:23 +0000)]
[X86] In FP_TO_INTHelper, when moving data from SSE register to X87 register file via the stack, use the same stack slot we use for the integer conversion.

No need for a separate stack slot. The lifetimes don't overlap.

Also fix the MachinePointerInfo for the final load after the integer conversion to indicate it came from the stack slot.

llvm-svn: 354234

5 years ago[NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitor
Bruno Ricci [Sun, 17 Feb 2019 19:18:38 +0000 (19:18 +0000)]
[NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitor

All cases in the switch are covered. NFC.

llvm-svn: 354233

5 years agoRecommit "[AST] Factor out the logic of the various Expr::Ignore*"
Bruno Ricci [Sun, 17 Feb 2019 18:50:51 +0000 (18:50 +0000)]
Recommit "[AST] Factor out the logic of the various Expr::Ignore*"

(Originally commited in r354215 and reverted in r354216 because of a
 missed failing clang-tidy test (fix in r354228))

Now that the implementation of all of the Expr::Ignore* is in Expr.cpp
we can try to remove some duplication. Do this by separating the logic
of the Expr::Ignore* from the iterative loop.

This is NFC, except for one change: IgnoreParenImpCasts now skips,
among other things, everything that IgnoreImpCasts skips. This means
FullExpr are now skipped by IgnoreParenImpCasts. This was likely an
oversight when FullExpr was added to the nodes skipped by IgnoreImpCasts.

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

Reviewed By: aaron.ballman (with comments from void and rnk)

llvm-svn: 354232

5 years ago[compiler-rt] Fix broken sanitizer bots (hopefully)
Jonas Hahnfeld [Sun, 17 Feb 2019 18:47:33 +0000 (18:47 +0000)]
[compiler-rt] Fix broken sanitizer bots (hopefully)

According to the logs and local debugging there were two issues:
1) tsan tests listed libc++.a before the source file. That's usually
   ok for shared libraries, but the linker will not add symbols from
   a static library unless needed at that time. As a result the tests
   that rely upon symbols from the library (and not only include the
   headers) had undefined references.
   To solve this I'm adding a new substitution %link_libcxx_tsan which
   expands to libc++.a if available.
2) The target Fuzzer-x86_64-Test linked in SANITIZER_TEST_CXX_LIBRARIES
   which defaults to -lstdc++. This resulted in error messages like
     hidden symbol '_ZdlPv' is not defined locally
     hidden symbol '_Znwm' is not defined locally
   when using GNU gold (ld.bfd and lld are fine). Removing the linkage
   is fine because we build a custom libc++ for that purpose.

llvm-svn: 354231

5 years ago[TEST] Remove 2>&1 from tests
Max Kazantsev [Sun, 17 Feb 2019 18:22:00 +0000 (18:22 +0000)]
[TEST] Remove 2>&1 from tests

Avoid confusing CHECKS with debug dumps of sets that can be printed differently.

llvm-svn: 354229

5 years ago[clang-tidy][NFCI] DanglingHandleCheck: Remove a superflous IgnoreParenImpCasts
Bruno Ricci [Sun, 17 Feb 2019 18:21:54 +0000 (18:21 +0000)]
[clang-tidy][NFCI] DanglingHandleCheck: Remove a superflous IgnoreParenImpCasts

ExprWithCleanups is currently not skipped by IgnoreParenImpCasts, but is skipped
by IgnoreImpCasts. In view of fixing this inconsistency in D57267, remove the
IgnoreParenImpCasts between the ReturnStmt and the ExprWithCleanups which
is not needed since ExprWithCleanups is always created as a direct child of
ReturnStmt (by inspection of each ReturnStmt::Create in Sema/SemaStmt.cpp).

NFC intended.

llvm-svn: 354228

5 years ago[NFC] Teach getInnermostLoopFor walk up the loop trees
Max Kazantsev [Sun, 17 Feb 2019 18:21:51 +0000 (18:21 +0000)]
[NFC] Teach getInnermostLoopFor walk up the loop trees

This should be NFC in current use case of this method, but it will
help to use it for solving more compex tasks in follow-up patches.

llvm-svn: 354227

5 years ago[SelectionDAG] Extract [US]MULO expansion into TL method; NFC
Nikita Popov [Sun, 17 Feb 2019 17:40:47 +0000 (17:40 +0000)]
[SelectionDAG] Extract [US]MULO expansion into TL method; NFC

In preparation for supporting vector expansion.

Add an isPostTypeLegalization flag to makeLibCall(), because this
expansion relies on the legalized form using MERGE_VALUES. Drop
the corresponding variant of ExpandLibCall, which is no longer used.

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

llvm-svn: 354226

5 years agoRemove unused extern declaration as removed by D32167
Jan Kratochvil [Sun, 17 Feb 2019 17:12:37 +0000 (17:12 +0000)]
Remove unused extern declaration as removed by D32167

llvm-svn: 354225

5 years ago[InstCombine] reduce more unsigned saturated add with 'not' op
Sanjay Patel [Sun, 17 Feb 2019 16:48:50 +0000 (16:48 +0000)]
[InstCombine] reduce more unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

  Name: not op
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %notx, %y
  %r = select i1 %c, i32 -1, i32 %a
  =>
  %a = add i32 %x, %y
  %c2 = icmp ult i32 %a, %y
  %r = select i1 %c2, i32 -1, i32 %a

  Name: not op ugt
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %y, %notx
  %r = select i1 %c, i32 -1, i32 %a
  =>
  %a = add i32 %x, %y
  %c2 = icmp ult i32 %a, %y
  %r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/niom

(The matching here is still incomplete.)

llvm-svn: 354224

5 years ago[InstCombine] add more tests for unsigned saturated add; NFC
Sanjay Patel [Sun, 17 Feb 2019 16:44:11 +0000 (16:44 +0000)]
[InstCombine] add more tests for unsigned saturated add; NFC

Extend the pattern-matching from rL354219 / rL354221.

llvm-svn: 354223