platform/upstream/llvm.git
5 years agoInstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics
Tim Renouf [Fri, 22 Mar 2019 15:53:50 +0000 (15:53 +0000)]
InstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics

This helps to avoid the situation where RA spots that only 3 of the
v4f32 result of a load are used, and immediately reallocates the 4th
register for something else, requiring a stall waiting for the load.

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

Change-Id: I947661edfd5715f62361a02b100f14aeeada29aa
llvm-svn: 356768

5 years agogn build: Merge r356753
Nico Weber [Fri, 22 Mar 2019 15:50:24 +0000 (15:50 +0000)]
gn build: Merge r356753

llvm-svn: 356767

5 years agogn build: Merge r356652 (and follow-up r56655)
Nico Weber [Fri, 22 Mar 2019 15:48:11 +0000 (15:48 +0000)]
gn build: Merge r356652 (and follow-up r56655)

llvm-svn: 356766

5 years agogn build: Merge r356729
Nico Weber [Fri, 22 Mar 2019 15:43:06 +0000 (15:43 +0000)]
gn build: Merge r356729

llvm-svn: 356765

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Fri, 22 Mar 2019 15:42:13 +0000 (15:42 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

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

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 356764

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:59 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

llvm-svn: 356763

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:55 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

llvm-svn: 356762

5 years ago[x86] add 'nounwind' to tests to reduce noise; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:51 +0000 (15:33 +0000)]
[x86] add 'nounwind' to tests to reduce noise; NFC

llvm-svn: 356761

5 years ago[x86] auto-generate complete checks for test; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:47 +0000 (15:33 +0000)]
[x86] auto-generate complete checks for test; NFC

llvm-svn: 356760

5 years ago[OPENMP]Add missing comment, NFC.
Alexey Bataev [Fri, 22 Mar 2019 15:32:02 +0000 (15:32 +0000)]
[OPENMP]Add missing comment, NFC.

llvm-svn: 356759

5 years ago[OPENMP]Allow no allocator clause in target regions with requires
Alexey Bataev [Fri, 22 Mar 2019 15:25:12 +0000 (15:25 +0000)]
[OPENMP]Allow no allocator clause in target regions with requires
dynamic_allocators.

According to the OpenMP 5.0, 2.11.3 allocate Directive, Restrictions,
allocate directives that appear in a target region must specify an
allocator clause unless a requires directive with the dynamic_allocators
clause is present in the same compilation unit. Patch adds a check for a
presence of the requires directive with the dynamic_allocators clause.

llvm-svn: 356758

5 years ago[AMDGPU] Use three- and five-dword result type in image ops
Tim Renouf [Fri, 22 Mar 2019 15:21:11 +0000 (15:21 +0000)]
[AMDGPU] Use three- and five-dword result type in image ops

Some image ops return three or five dwords.  Previously, we modeled that
with a 4 or 8 dword register class.  The register allocator could
cleverly spot that some subregs were dead and allocate something else
there, but that caused the de-optimization that waitcnt insertion would
think that the result was used immediately.

This commit allows such an image op to have a result with a three or
five dword result, avoiding the above de-optimization.

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

Change-Id: I3651211bbd7ed22721ee7b9fefd7bcc60a809d8b
llvm-svn: 356757

5 years ago[clang-tidy] Fix a compiler warning.
Alexander Kornienko [Fri, 22 Mar 2019 15:07:18 +0000 (15:07 +0000)]
[clang-tidy] Fix a compiler warning.

Rename the Preprocessor field to fix the

  declaration of ‘std::unique_ptr<clang::Preprocessor> clang::tooling::ExpandModularHeadersPPCallbacks::Preprocessor’ changes the meaning of ‘Preprocessor’ from ‘class clang::Preprocessor’ [-fpermissive]

warning.

llvm-svn: 356756

5 years ago[AMDGPU] Implemented dwordx3 variants of buffer/tbuffer load/store intrinsics
Tim Renouf [Fri, 22 Mar 2019 14:58:02 +0000 (14:58 +0000)]
[AMDGPU] Implemented dwordx3 variants of buffer/tbuffer load/store intrinsics

Now we have vec3 MVTs, this commit implements dwordx3 variants of the
buffer intrinsics.

On gfx6, a dwordx3 buffer load intrinsic is implemented as a dwordx4
instruction, and a dwordx3 buffer store intrinsic is not supported.
We need to support the dwordx3 load intrinsic because it is generated by
subtarget-unaware code in InstCombine.

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

Change-Id: I016729d8557b98a52f529638ae97c340a5922a4e
llvm-svn: 356755

5 years ago[SLPVectorizer] Add test related to SLP Throttling support, NFCI.
Dinar Temirbulatov [Fri, 22 Mar 2019 14:50:53 +0000 (14:50 +0000)]
[SLPVectorizer] Add test related to SLP Throttling support, NFCI.

llvm-svn: 356754

5 years ago[ObjectYAML] Add basic minidump generation support
Pavel Labath [Fri, 22 Mar 2019 14:47:26 +0000 (14:47 +0000)]
[ObjectYAML] Add basic minidump generation support

Summary:
This patch adds the ability to read a yaml form of a minidump file and
write it out as binary. Apart from the minidump header and the stream
directory, only three basic stream kinds are supported:
- Text: This kind is used for streams which contain textual data. This
  is typically the contents of a /proc file on linux (e.g.
  /proc/PID/maps). In this case, we just put the raw stream contents
  into the yaml.
- SystemInfo: This stream contains various bits of information about the
  host system in binary form. We expose the data in a structured form.
- Raw: This kind is used as a fallback when we don't have any special
  knowledge about the stream. In this case, we just print the stream
  contents in hex.

For this code to be really useful, more stream kinds will need to be
added (particularly for things like lists of memory regions and loaded
modules). However, these can be added incrementally.

Reviewers: jhenderson, zturner, clayborg, aprantl

Subscribers: mgorny, lemo, llvm-commits, lldb-commits

Tags: #llvm

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

llvm-svn: 356753

5 years ago[OPENMP]Emit error message for allocate directive without allocator
Alexey Bataev [Fri, 22 Mar 2019 14:41:39 +0000 (14:41 +0000)]
[OPENMP]Emit error message for allocate directive without allocator
clause in target region.

According to the OpenMP 5.0, 2.11.3 allocate Directive, Restrictions,
allocate directives that appear in a target region must specify an
allocator clause unless a requires directive with the dynamic_allocators
clause is present in the same compilation unit.

llvm-svn: 356752

5 years agoExtend r356573 (minidump UUID handling) to cover elf build-ids too
Pavel Labath [Fri, 22 Mar 2019 14:03:59 +0000 (14:03 +0000)]
Extend r356573 (minidump UUID handling) to cover elf build-ids too

Breakpad (but not crashpad) will insert an empty (all-zero) build-id
record for modules which do not have a build-id. This tells lldb to
treat such records as empty/invalid uuids.

llvm-svn: 356751

5 years ago[clang-tidy] Expand modular headers for PPCallbacks
Alexander Kornienko [Fri, 22 Mar 2019 13:42:48 +0000 (13:42 +0000)]
[clang-tidy] Expand modular headers for PPCallbacks

Summary:
Add a way to expand modular headers for PPCallbacks. Checks can opt-in for this
expansion by overriding the new registerPPCallbacks virtual method and
registering their PPCallbacks in the preprocessor created for this specific
purpose.

Use module expansion in the readability-identifier-naming check

Reviewers: gribozavr, usaxena95, sammccall

Reviewed By: gribozavr

Subscribers: nemanjai, mgorny, xazax.hun, kbarton, jdoerfert, cfe-commits

Tags: #clang, #clang-tools-extra

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

llvm-svn: 356750

5 years ago[AST] OMPStructuredBlockTest: avoid using multiline string literals in macros
Roman Lebedev [Fri, 22 Mar 2019 13:40:36 +0000 (13:40 +0000)]
[AST] OMPStructuredBlockTest: avoid using multiline string literals in macros

That is what i have been doing elsewhere in these tests, maybe that's it?

Maybe this helps with failing builds:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17921
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-global-isel/builds/10248

llvm-svn: 356749

5 years ago[llvm-exegesis] Fix compilation before c++17.
Clement Courbet [Fri, 22 Mar 2019 13:37:39 +0000 (13:37 +0000)]
[llvm-exegesis] Fix compilation before c++17.

ClusteringTest.cpp:25:23: error: constexpr variable cannot have non-literal type 'const llvm::exegesis::(anonymous namespace)::(lambda at /home/buildslave/ps4-buildslave4/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/unittests/tools/llvm-exegesis/ClusteringTest.cpp:25:35)'
static constexpr auto HasPoints = [](const std::vector<int> &Indices) {

llvm-svn: 356748

5 years ago[llvm-exegesis] Add clustering test.
Clement Courbet [Fri, 22 Mar 2019 13:13:12 +0000 (13:13 +0000)]
[llvm-exegesis] Add clustering test.

Summary: To show that dbscan is insensitive to the order of the points.

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 356747

5 years ago[llvm-objcopy]Add coverage for --split-dwo and --output-format
James Henderson [Fri, 22 Mar 2019 12:45:27 +0000 (12:45 +0000)]
[llvm-objcopy]Add coverage for --split-dwo and --output-format

Also fix up a couple of minor issues in the test being updated, where
FileCheck could match on incorrect output and fix the test case order to
match the struct order.

Reviewed by: grimar

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

llvm-svn: 356746

5 years agoRevert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection...
George Rimar [Fri, 22 Mar 2019 12:14:04 +0000 (12:14 +0000)]
Revert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class."

Seems this broke ubsan bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760

llvm-svn: 356745

5 years ago[RISCV] Add basic RV32E definitions and MC layer support
Alex Bradbury [Fri, 22 Mar 2019 11:21:40 +0000 (11:21 +0000)]
[RISCV] Add basic RV32E definitions and MC layer support

The RISC-V ISA defines RV32E as an alternative "base" instruction set
encoding, that differs from RV32I by having only 16 rather than 32 registers.
This patch adds basic definitions for RV32E as well as MC layer support
(assembling, disassembling) and tests. The only supported ABI on RV32E is
ILP32E.

Add a new RISCVFeatures::validate() helper to RISCVUtils which can be called
from codegen or MC layer libraries to validate the combination of TargetTriple
and FeatureBitSet. Other targets have similar checks (e.g. erroring if SPE is
enabled on PPC64 or oddspreg + o32 ABI on Mips), but they either duplicate the
checks (Mips), or fail to check for both codegen and MC codepaths (PPC).

Codegen for the ILP32E ABI support and RV32E codegen are left for a future
patch/patches.

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

llvm-svn: 356744

5 years ago[Tooling] Avoid working-dir races in AllTUsToolExecutor
Ilya Biryukov [Fri, 22 Mar 2019 11:01:13 +0000 (11:01 +0000)]
[Tooling] Avoid working-dir races in AllTUsToolExecutor

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356743

5 years ago[ARM] Add Cortex-M35P Support
Luke Cheeseman [Fri, 22 Mar 2019 10:58:15 +0000 (10:58 +0000)]
[ARM] Add Cortex-M35P Support

- Add clang frontend testing for Cortex-M35P

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

llvm-svn: 356742

5 years ago[RISCV] Optimize emission of SELECT sequences
Alex Bradbury [Fri, 22 Mar 2019 10:45:03 +0000 (10:45 +0000)]
[RISCV] Optimize emission of SELECT sequences

This patch optimizes the emission of a sequence of SELECTs with the same
condition, avoiding the insertion of unnecessary control flow. Such a sequence
often occurs when a SELECT of values wider than XLEN is legalized into two
SELECTs with legal types. We have identified several use cases where the
SELECTs could be interleaved with other instructions. Therefore, we extend the
sequence to include non-SELECT instructions if we are able to detect that the
non-SELECT instructions do not impact the optimization.

This patch supersedes https://reviews.llvm.org/D59096, which attempted to
address this issue by introducing a new SelectionDAG node. Hat tip to Eli
Friedman for his feedback on how to best handle this issue.

Differential Revision: https://reviews.llvm.org/D59355
Patch by Luís Marques.

llvm-svn: 356741

5 years ago[RISCV] Allow conversion of CC logic to bitwise logic
Alex Bradbury [Fri, 22 Mar 2019 10:39:22 +0000 (10:39 +0000)]
[RISCV] Allow conversion of CC logic to bitwise logic

Indicates in the TargetLowering interface that conversions from CC logic to
bitwise logic are allowed. Adds tests that show the benefit when optimization
opportunities are detected. Also adds tests that show that when the optimization
is not applied correct code is generated (but opportunities for other
optimizations remain).

Differential Revision: https://reviews.llvm.org/D59596
Patch by Luís Marques.

llvm-svn: 356740

5 years ago[llvm-objcopy] - Fix a st_name of the first symbol table entry.
George Rimar [Fri, 22 Mar 2019 10:28:56 +0000 (10:28 +0000)]
[llvm-objcopy] - Fix a st_name of the first symbol table entry.

Spec says about the first symbol table entry that index 0 both designates the first entry in the table
and serves as the undefined symbol index. It should have zero value.
Hence the first symbol table entry has no name. And so has to have a st_name == 0.
(http://refspecs.linuxbase.org/elf/gabi4+/ch4.symtab.html)

Currently, we do not emit zero value for the first symbol table entry.
That happens because we add empty strings to the string builder, which
for each such case adds a zero byte:
(https://github.com/llvm-mirror/llvm/blob/master/lib/MC/StringTableBuilder.cpp#L185)
After the string optimization performed it might return non zero indexes for the
empty string requested.

The patch fixes this issue for the case above and other sections with no names.

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

llvm-svn: 356739

5 years ago[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.
George Rimar [Fri, 22 Mar 2019 10:24:37 +0000 (10:24 +0000)]
[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.

Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.

The patch does that.

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

llvm-svn: 356738

5 years ago[llvm-objcopy]Add support for *-freebsd output formats
James Henderson [Fri, 22 Mar 2019 10:21:09 +0000 (10:21 +0000)]
[llvm-objcopy]Add support for *-freebsd output formats

GNU objcopy can support output formats like elf32-i386-freebsd and
elf64-x86-64-freebsd. The only difference from their regular non-freebsd
counterparts that I have observed is that the freebsd versions set the
OS/ABI field to ELFOSABI_FREEBSD. This patch sets the OS/ABI field
according based on the format whenever --output-format is specified.

Reviewed by: rupprecht, grimar

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

llvm-svn: 356737

5 years ago[RISCV][NFC] Add test case to MC/RISCV/linker-relaxation.s showing incorrect relocati...
Alex Bradbury [Fri, 22 Mar 2019 10:20:21 +0000 (10:20 +0000)]
[RISCV][NFC] Add test case to MC/RISCV/linker-relaxation.s showing incorrect relocations being emitted

A follow-up patch will fix this case.

llvm-svn: 356736

5 years ago[AMDGPU] Added v5i32 and v5f32 register classes
Tim Renouf [Fri, 22 Mar 2019 10:11:21 +0000 (10:11 +0000)]
[AMDGPU] Added v5i32 and v5f32 register classes

They are not used by anything yet, but a subsequent commit will start
using them for image ops that return 5 dwords.

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

Change-Id: I63e1904081e39a6d66e4eb96d51df25ad399d271
llvm-svn: 356735

5 years ago[RISCV][NFC] Expand test/MC/RISCV/linker-relaxation.s tests
Alex Bradbury [Fri, 22 Mar 2019 06:05:52 +0000 (06:05 +0000)]
[RISCV][NFC] Expand test/MC/RISCV/linker-relaxation.s tests

Add more complete CHECK lines for the relocations generated when relaxation is
enabled, and add cases where a locally defined symbol is referenced.

Two instances of pcrel_lo(defined_symbol) are commented out, as they will
produce an error. A follow-up patch will fix this.

llvm-svn: 356734

5 years ago[X86] Add 32-bit command lines with and without SSE2 to atomic-non-integer.ll. NFC
Craig Topper [Fri, 22 Mar 2019 04:28:40 +0000 (04:28 +0000)]
[X86] Add 32-bit command lines with and without SSE2 to atomic-non-integer.ll. NFC

llvm-svn: 356733

5 years ago[BPF] fix flaky btf unit test static-var-derived-type.ll
Yonghong Song [Fri, 22 Mar 2019 02:54:47 +0000 (02:54 +0000)]
[BPF] fix flaky btf unit test static-var-derived-type.ll

The DataSecEentries is defined as an unordered_map since
order does not really matter.
  std::unordered_map<std::string, std::unique_ptr<BTFKindDataSec>>
      DataSecEntries;
This seems causing the test static-var-derived-type.ll flaky
as two sections ".bss" and ".readonly" have undeterministic
ordering when performing map iterating, which decides the
output assembly code sequence of BTF_KIND_DATASEC entries.

Fix the test to have only one data section to remove
flakiness.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356731

5 years ago[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries
Fangrui Song [Fri, 22 Mar 2019 02:43:17 +0000 (02:43 +0000)]
[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries

Summary: This is the lld-side change of D57939

Reviewers: echristo, dblaikie, ruiu, espindola

Reviewed By: echristo, ruiu

Subscribers: jdoerfert, emaste, arichardson, llvm-commits

Tags: #llvm

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

llvm-svn: 356730

5 years ago[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries
Fangrui Song [Fri, 22 Mar 2019 02:43:11 +0000 (02:43 +0000)]
[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries

Summary:
getRelocatedValue may compute incorrect value for SHT_RELA-typed relocation entries.

// DWARFDataExtractor.cpp
uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
...
  // This formula is correct for REL, but may be incorrect for RELA if the value
  // stored in the location (getUnsigned(Off, Size)) is not zero.
  return getUnsigned(Off, Size) + Rel->Value;

In this patch, we

* refactor these visit* functions to include a new parameter `uint64_t A`.
  Since these visit* functions are no longer used as visitors, rename them to resolve*.
  + REL: A is used as the addend. A is the value stored in the location where the
    relocation applies: getUnsigned(Off, Size)
  + RELA: The addend encoded in RelocationRef is used, e.g. getELFAddend(R)
* and add another set of supports* functions to check if a given relocation type is handled.
  DWARFObjInMemory uses them to fail early.

Reviewers: echristo, dblaikie

Reviewed By: echristo

Subscribers: mgorny, aprantl, aheejin, fedor.sergeev, llvm-commits

Tags: #llvm

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

llvm-svn: 356729

5 years ago[NFC][TSan][libdispatch] Don't use ignore_noninstrumented_modules on Linux
Julian Lettner [Fri, 22 Mar 2019 01:43:43 +0000 (01:43 +0000)]
[NFC][TSan][libdispatch] Don't use ignore_noninstrumented_modules on Linux

llvm-svn: 356728

5 years ago[BPF] handle derived type properly for computing type id
Yonghong Song [Fri, 22 Mar 2019 01:30:50 +0000 (01:30 +0000)]
[BPF] handle derived type properly for computing type id

Currently, the type id for a derived type is computed incorrectly.
For example,
  type #1: int
  type #2: ptr to #1

For a global variable "int *a", type #1 will be attributed to variable "a".
This is due to a bug which assigns the type id of the basetype of
that derived type as the derived type's type id. This happens
to "const", "volatile", "restrict", "typedef" and "pointer" types.

This patch fixed this bug, fixed existing test cases and added
a new one focusing on pointers plus other derived types.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 356727

5 years agoFix a vector test to not use a local type as a template parameter. This causes a...
Marshall Clow [Fri, 22 Mar 2019 00:49:41 +0000 (00:49 +0000)]
Fix a vector test to not use a local type as a template parameter. This causes a warning on C++03. NFC

llvm-svn: 356726

5 years ago[Reproducers] Fix log statements
Jonas Devlieghere [Thu, 21 Mar 2019 23:58:51 +0000 (23:58 +0000)]
[Reproducers] Fix log statements

This isn't python where you can omit the index inside `{}`.

llvm-svn: 356725

5 years agoThis test assumes that -rtlib defaults to libgcc. But that isn't true in the face...
Sterling Augustine [Thu, 21 Mar 2019 23:30:50 +0000 (23:30 +0000)]
This test assumes that -rtlib defaults to libgcc. But that isn't true in the face of -DCLANG_DEFAULT_RTLIB=compiler-rt.

Subscribers: dberris, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356724

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Thu, 21 Mar 2019 23:09:56 +0000 (23:09 +0000)]
[X86] Autogenerate complete checks. NFC

llvm-svn: 356723

5 years ago[AArch64] Split the neon.addp intrinsic into integer and fp variants.
Amara Emerson [Thu, 21 Mar 2019 22:31:37 +0000 (22:31 +0000)]
[AArch64] Split the neon.addp intrinsic into integer and fp variants.

This is the result of discussions on the list about how to deal with intrinsics
which require codegen to disambiguate them via only the integer/fp overloads.
It causes problems for GlobalISel as some of that information is lost during
translation, while with other operations like IR instructions the information is
encoded into the instruction opcode.

This patch changes clang to emit the new faddp intrinsic if the vector operands
to the builtin have FP element types. LLVM IR AutoUpgrade has been taught to
upgrade existing calls to aarch64.neon.addp with fp vector arguments, and
we remove the workarounds introduced for GlobalISel in r355865.

This is a more permanent solution to PR40968.

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

llvm-svn: 356722

5 years ago[X86] Use LoadInst->getType() instead of LoadInst->getPointerOperandType()->getElemen...
Craig Topper [Thu, 21 Mar 2019 21:37:18 +0000 (21:37 +0000)]
[X86] Use LoadInst->getType() instead of LoadInst->getPointerOperandType()->getElementType(). NFCI

For the future day when the pointer's don't have element types, we shoudl just use the type of the load result instead.

llvm-svn: 356721

5 years ago[InstSimplify] Add tests for signed icmp of and/or; NFC
Nikita Popov [Thu, 21 Mar 2019 21:13:08 +0000 (21:13 +0000)]
[InstSimplify] Add tests for signed icmp of and/or; NFC

Even if a signed predicate is used, the ranges computed for and/or
are unsigned, resulting in missed simplifications.

llvm-svn: 356720

5 years ago[libc++] Remove too-stringent XFAILs for file_clock tests
Louis Dionne [Thu, 21 Mar 2019 21:07:33 +0000 (21:07 +0000)]
[libc++] Remove too-stringent XFAILs for file_clock tests

Those tests actually pass because we don't use anything that's marked
as unavailable.

llvm-svn: 356719

5 years ago[Object] Fix reading objects created with -fembed-bitcode-marker
Steven Wu [Thu, 21 Mar 2019 21:01:31 +0000 (21:01 +0000)]
[Object] Fix reading objects created with -fembed-bitcode-marker

Currently, this fails with many tools, e.g.

$ clang -fembed-bitcode-marker -c -o test.o test.c
$ nm test.o
nm: test.o The file was not recognized as a valid object file

-fembed-bitcode-marker creates a LLVM,bitcode section consisting of a single
byte. When reading the object file, IRObjectFile::findBitcodeInObject succeeds,
causing SymbolicFile::createSymbolicFile to try to read the "bitcode" rather
than using the outer Mach-O data - when then fails.

Fix this by making findBitcodeInObject return an error if the section size <= 1.

Patched by: Nicholas Allegra

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

llvm-svn: 356718

5 years agoMips: Fix typo in assert message
Matt Arsenault [Thu, 21 Mar 2019 20:56:06 +0000 (20:56 +0000)]
Mips: Fix typo in assert message

llvm-svn: 356717

5 years agoMips: Don't create copy of nothing
Matt Arsenault [Thu, 21 Mar 2019 20:56:05 +0000 (20:56 +0000)]
Mips: Don't create copy of nothing

This was creating a copy of the register the pseudo itself was
def'ing, leaving a copy of an undefined register. I'm not sure how
the verifier is not catching this, but this avoids asserting in a
future change to RegAllocFast

llvm-svn: 356716

5 years ago[OPENMP]Fix a warning about unused variable, NFC.
Alexey Bataev [Thu, 21 Mar 2019 20:52:04 +0000 (20:52 +0000)]
[OPENMP]Fix a warning about unused variable, NFC.

llvm-svn: 356715

5 years agoGlobalISel: Fix RegBankSelect for REG_SEQUENCE
Matt Arsenault [Thu, 21 Mar 2019 20:45:36 +0000 (20:45 +0000)]
GlobalISel: Fix RegBankSelect for REG_SEQUENCE

The AArch64 test was broken since the result register already had a
set register class, so this test was a no-op. The mapping verify call
would fail because the result size is not the same as the inputs like
in a copy or phi.

The AMDGPU testcases are half broken and introduce illegal VGPR->SGPR
copies which need much more work to handle correctly (same for phis),
but add them as a baseline.

llvm-svn: 356713

5 years agoImprove the diagnostic for #include_next occurring in a file not found
Richard Smith [Thu, 21 Mar 2019 20:42:13 +0000 (20:42 +0000)]
Improve the diagnostic for #include_next occurring in a file not found
in the include path.

Instead of making the incorrect claim that the included file has an
absolute path, describe the actual problem: the including file was found
either by absolute path, or relative to such a file, or relative to the
primary source file.

llvm-svn: 356712

5 years agoMakefile.rules: Normalize use of trailing slashes in path variables.
Adrian Prantl [Thu, 21 Mar 2019 20:36:23 +0000 (20:36 +0000)]
Makefile.rules: Normalize use of trailing slashes in path variables.

llvm-svn: 356711

5 years ago[OPENMP] Simplify codegen for allocate directive on local variables.
Alexey Bataev [Thu, 21 Mar 2019 20:36:16 +0000 (20:36 +0000)]
[OPENMP] Simplify codegen for allocate directive on local variables.

Simplified codegen for the allocate directive for local variables,
initial implementation of the codegen for NVPTX target.

llvm-svn: 356710

5 years ago[X86] Correct the value of MaxAtomicInlineWidth for pre-586 cpus
Craig Topper [Thu, 21 Mar 2019 20:36:08 +0000 (20:36 +0000)]
[X86] Correct the value of MaxAtomicInlineWidth for pre-586 cpus

Use the new cx8 feature flag that was added to the backend to represent support for cmpxchg8b. Use this flag to set the MaxAtomicInlineWidth.

This also assumes all the cmpxchg instructions are enabled for CK_Generic which is what cc1 defaults to when nothing is specified.

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

llvm-svn: 356709

5 years agoDon't add a tail keyword to calls to ObjC runtime functions if the calls
Akira Hatanaka [Thu, 21 Mar 2019 20:16:09 +0000 (20:16 +0000)]
Don't add a tail keyword to calls to ObjC runtime functions if the calls
are annotated with notail.

r356705 annotated calls to objc_retainAutoreleasedReturnValue with
notail on x86-64. This commit teaches ARC optimizer to check the notail
marker on the call before turning it into a tail call.

rdar://problem/38675807

llvm-svn: 356707

5 years ago[Driver] Pass -malign-double from the driver to the cc1 command line
Craig Topper [Thu, 21 Mar 2019 20:07:24 +0000 (20:07 +0000)]
[Driver] Pass -malign-double from the driver to the cc1 command line

-malign-double is currently only implemented in the -cc1 interface. But its declared in Options.td so it is a driver option too. But you try to use it with the driver you'll get a message about the option being unused.

This patch teaches the driver to pass the option through to cc1 so it won't be unused. The Options.td says the option is x86 only but I didn't see any x86 specific code in its impementation in cc1 so not sure if the documentation is wrong or if I should only pass this option through the driver on x86 targets.

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

llvm-svn: 356706

5 years ago[CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue
Akira Hatanaka [Thu, 21 Mar 2019 19:59:49 +0000 (19:59 +0000)]
[CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue
with notail on x86-64.

On x86-64, the epilogue code inserted before the tail jump blocks the
autoreleased return optimization.

rdar://problem/38675807

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

llvm-svn: 356705

5 years agoRefactor handling of #include directives to cleanly separate the
Richard Smith [Thu, 21 Mar 2019 19:44:17 +0000 (19:44 +0000)]
Refactor handling of #include directives to cleanly separate the
"skipped header because it should be imported as a module" cases from
the "skipped header because of some other reason" cases.

llvm-svn: 356704

5 years ago[lldb] Add missing EINTR handling
Michal Gorny [Thu, 21 Mar 2019 19:35:55 +0000 (19:35 +0000)]
[lldb] Add missing EINTR handling

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

llvm-svn: 356703

5 years ago[OPENMP]Codegen support for allocate directive on global variables.
Alexey Bataev [Thu, 21 Mar 2019 19:35:27 +0000 (19:35 +0000)]
[OPENMP]Codegen support for allocate directive on global variables.

For the global variables the allocate directive must specify only the
predefined allocator. This allocator must be translated into the correct
form of the address space for the targets that support different address
spaces.

llvm-svn: 356702

5 years agoEnable `asan/TestCases/Posix/start-deactivated.cc` test for iOS.
Dan Liew [Thu, 21 Mar 2019 19:20:44 +0000 (19:20 +0000)]
Enable `asan/TestCases/Posix/start-deactivated.cc` test for iOS.

Summary:
To make this test pass it was necesary to change `iossim_run.py` to
propagate the `ASAN_ACTIVATION_OPTIONS` environment variable into the
testing environment.

rdar://problem/49114807

Reviewers: kubamracek, yln, serge-sans-paille

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 356701

5 years ago[clang][OpenMP] Fix another test when using libgomp.
Jordan Rupprecht [Thu, 21 Mar 2019 19:13:22 +0000 (19:13 +0000)]
[clang][OpenMP] Fix another test when using libgomp.

Similarly to r356614, -fopenmp=libomp needs to be used for some omp-related AST matching.

llvm-svn: 356700

5 years ago[OPENMP]Simplify the check for the predefined allocators, NFC.
Alexey Bataev [Thu, 21 Mar 2019 19:05:07 +0000 (19:05 +0000)]
[OPENMP]Simplify the check for the predefined allocators, NFC.

Previously implemented check required the reevaluation of the already
evaluated predefined allocator kind for the global variables. Patch
simplifies this evaluation and removes extra code.

llvm-svn: 356699

5 years ago[AArch64] Update for Exynos
Evandro Menezes [Thu, 21 Mar 2019 18:54:58 +0000 (18:54 +0000)]
[AArch64] Update for Exynos

Fix the feature set for Exynos M4 by removing support for `+fp16fml` and fix test case.

llvm-svn: 356698

5 years ago[llvm-objdump] Support arg grouping for -j and -M (e.g. llvm-objdump -sj.foo -dMreg...
Jordan Rupprecht [Thu, 21 Mar 2019 18:45:44 +0000 (18:45 +0000)]
[llvm-objdump] Support arg grouping for -j and -M (e.g. llvm-objdump -sj.foo -dMreg-names-raw)

Summary:
r354375 added support for most objdump groupings, but didn't add support for -j|--sections, because that wasn't possible.
r354870 added --disassembler options, but grouping still wasn't available.
r355185 supported values for grouped options.

This just puts the three of them together. This supports -j in modes like `-s -j .foo`, `-sj .foo`, `-sj=.foo`, or `-sj.foo`, and similar for `-M`.

Reviewers: ormris, jhenderson, ikudrin

Reviewed By: jhenderson, ikudrin

Subscribers: javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 356697

5 years ago[X86] canonicalizeBitSelect - don't attempt to canonicalize mask registers
Simon Pilgrim [Thu, 21 Mar 2019 18:32:38 +0000 (18:32 +0000)]
[X86] canonicalizeBitSelect - don't attempt to canonicalize mask registers

We don't use X86ISD::ANDNP for mask registers.

Test case from @craig.topper (Craig Topper)

llvm-svn: 356696

5 years agoPython 2/3 compatibility: from __future__ import print_function
Serge Guelton [Thu, 21 Mar 2019 18:27:40 +0000 (18:27 +0000)]
Python 2/3 compatibility: from __future__ import print_function

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

llvm-svn: 356695

5 years agoFix lld wasm tests after r356610
Reid Kleckner [Thu, 21 Mar 2019 18:24:05 +0000 (18:24 +0000)]
Fix lld wasm tests after r356610

Apparently stdout is not opened in binary mode, so the executable gets
corrupted when piping to obj2yaml.

llvm-svn: 356694

5 years ago[NFC][libc++] Reindent #ifdefs
Louis Dionne [Thu, 21 Mar 2019 18:19:21 +0000 (18:19 +0000)]
[NFC][libc++] Reindent #ifdefs

I don't understand why we don't always do that. We do it for normal `if`s
in the code, but not for preprocessor `if`s? It's a lot more readable when
indented properly.

llvm-svn: 356693

5 years ago[llvm-pdbutil] Add -type-ref-stats to help find unused type info
Reid Kleckner [Thu, 21 Mar 2019 18:02:34 +0000 (18:02 +0000)]
[llvm-pdbutil] Add -type-ref-stats to help find unused type info

Summary:
This considers module symbol streams and the global symbol stream to be
roots. Most types that this considers "unreferenced" are referenced by
LF_UDT_MOD_SRC_LINE id records, which VC seems to always include.
Essentially, they are types that the user can only find in the debugger
if they call them by name, they cannot be found by traversing a symbol.

In practice, around 80% of type information in a PDB is referenced by a
symbol. That seems like a reasonable number.

I don't really plan to do anything with this tool. It mostly just exists
for informational purposes, and to confirm that we probably don't need
to implement type reference tracking in LLD. We can continue to merge
all types as we do today without wasting space.

Reviewers: zturner, aganea

Subscribers: mgorny, hiraditya, arphaman, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356692

5 years ago[x86] add tests with movmsk potential (PR39665); NFC
Sanjay Patel [Thu, 21 Mar 2019 17:57:56 +0000 (17:57 +0000)]
[x86] add tests with movmsk potential (PR39665); NFC

llvm-svn: 356691

5 years ago[InstCombine] Don't transform ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2) if eithe...
Craig Topper [Thu, 21 Mar 2019 17:50:49 +0000 (17:50 +0000)]
[InstCombine] Don't transform ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2) if either zext or OP has another use.

If they have other users we'll just end up increasing the instruction count.

We might be able to weaken this to only one of them having a single use if we can prove that the and will be removed.

Fixes PR41164.

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

llvm-svn: 356690

5 years ago[X86] Add __popcntd and __popcntq to ia32intrin.h to match gcc and icc. Remove popcnt...
Craig Topper [Thu, 21 Mar 2019 17:43:53 +0000 (17:43 +0000)]
[X86] Add __popcntd and __popcntq to ia32intrin.h to match gcc and icc. Remove popcnt feature flag from _popcnt32/_popcnt64 and move to ia32intrin.h to match gcc

gcc and icc both implement popcntd and popcntq which we did not. gcc doesn't seem to require a feature flag for the _popcnt32/_popcnt64 spelling and will use a libcall if its not supported.

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

llvm-svn: 356689

5 years ago[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instruction...
Craig Topper [Thu, 21 Mar 2019 17:38:58 +0000 (17:38 +0000)]
[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instructions under optsize.

Under optsize we try to avoid folding immediates into instructions under optsize. But if the immediate is 16-bits or 32 bits, but can be encoded as an 8-bit immediate we don't save enough from disabling the folding unless the immediate has enough uses to make up for the size of the move which is either 3 bytes or 5 bytes since there are no sign extended 8-bit moves. We would also save something if the immediate was a live out of the basic block and thus a move was unavoidable, but that would require a more advanced heuristic than just counting uses.

Note we only avoid folding multiple use immediates into the patterns that use X86ISD::ADD/SUB/XOR/OR/AND/CMP/ADC/SBB nodes and not the more common ISD::ADD/SUB/XOR/OR/AND nodes.

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

llvm-svn: 356688

5 years ago[ScalarizeMaskedMemIntrin] Add support for scalarizing expandload and compressstore...
Craig Topper [Thu, 21 Mar 2019 17:38:52 +0000 (17:38 +0000)]
[ScalarizeMaskedMemIntrin] Add support for scalarizing expandload and compressstore intrinsics.

This adds support for scalarizing these intrinsics as well the X86TargetTransformInfo support to avoid scalarizing them in the cases X86 can handle.

I've omitted handling special cases for constant masks for this first pass. Though CodeGenPrepare can constant fold the branch conditions and remove some of the control flow anyway.

Fixes PR40994 and is covers most of PR3666. Might want to implement constant masks to close that.

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

llvm-svn: 356687

5 years ago[X86] Use the CPUKind enum from PROC_ALIAS to directly get the CPUKind in fillValidCP...
Craig Topper [Thu, 21 Mar 2019 17:33:20 +0000 (17:33 +0000)]
[X86] Use the CPUKind enum from PROC_ALIAS to directly get the CPUKind in fillValidCPUList.

We were using getCPUKind which translates the string to the enum also using PROC_ALIAS. This just cuts out the string compares.

llvm-svn: 356686

5 years ago[ValueTracking] Use ConstantRange based overflow check for signed sub
Nikita Popov [Thu, 21 Mar 2019 17:23:51 +0000 (17:23 +0000)]
[ValueTracking] Use ConstantRange based overflow check for signed sub

This is D59450, but for signed sub. This case is not NFC, because
the overflow logic in ConstantRange is more powerful than the existing
check. This resolves the TODO in the function.

I've added two tests to show that this indeed catches more cases than
the previous logic, but the main correctness test coverage here is in
the existing ConstantRange unit tests.

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

llvm-svn: 356685

5 years ago[ELF][ARM] Revert Redesign of .ARM.exidx handling to use a SyntheticSection
Peter Smith [Thu, 21 Mar 2019 17:17:54 +0000 (17:17 +0000)]
[ELF][ARM] Revert Redesign of .ARM.exidx handling to use a SyntheticSection

There is a reproducible buildbot failure (segfault) on the 2 stage
clang-cmake-armv8-lld bot. Reverting while I investigate.

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

llvm-svn: 356684

5 years agoAdd more rotate tests, including ORs of rotates
Krzysztof Parzyszek [Thu, 21 Mar 2019 17:14:22 +0000 (17:14 +0000)]
Add more rotate tests, including ORs of rotates

This is a part of https://reviews.llvm.org/D47735.

llvm-svn: 356683

5 years agoMove the rest of the sections over to DWARFContext.
Zachary Turner [Thu, 21 Mar 2019 16:34:58 +0000 (16:34 +0000)]
Move the rest of the sections over to DWARFContext.

This is mostly mechanical, and just moves the remaining non-DWO
related sections over to DWARFContext.

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

llvm-svn: 356682

5 years ago[libc++] Re-document how to use <filesystem> with various versions of libc++
Louis Dionne [Thu, 21 Mar 2019 16:21:09 +0000 (16:21 +0000)]
[libc++] Re-document how to use <filesystem> with various versions of libc++

This documentation was removed when we added <filesystem> to the dylib
in r356518, but it really should have been updated to reflect the new
state of things. Keeping documentation around doesn't hurt and users
will have an easier time migrating.

llvm-svn: 356681

5 years agoAdd relational benchmark against a string constant.
Samuel Benzaquen [Thu, 21 Mar 2019 16:06:15 +0000 (16:06 +0000)]
Add relational benchmark against a string constant.

Summary:
Add relational benchmark against a string constant.
These can potentially trigger inlining of the operations. We want to
benchmark that.

Reviewers: EricWF

Subscribers: christof, jdoerfert, libcxx-commits

Tags: #libc

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

llvm-svn: 356680

5 years ago[AST] OMPStructuredBlockTest: two matchers were promoted into ASTMatchers.h
Roman Lebedev [Thu, 21 Mar 2019 15:50:54 +0000 (15:50 +0000)]
[AST] OMPStructuredBlockTest: two matchers were promoted into ASTMatchers.h

llvm-svn: 356679

5 years ago[libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't support bad_an...
Louis Dionne [Thu, 21 Mar 2019 15:37:11 +0000 (15:37 +0000)]
[libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't support bad_any_cast

With the latest compiler fix to availability, some availability failures
that didn't trigger before now trigger.

llvm-svn: 356678

5 years ago[ASTMatcher] Add clang-query disclaimer to two more matchers that take enum
Roman Lebedev [Thu, 21 Mar 2019 15:33:43 +0000 (15:33 +0000)]
[ASTMatcher] Add clang-query disclaimer to two more matchers that take enum

As we have figured out in
https://reviews.llvm.org/D57112
and
https://bugs.llvm.org/show_bug.cgi?id=41176

this kind-of works, but needs special care.

llvm-svn: 356677

5 years ago[ASTMatchers][OpenMP] OpenMP Structured-block-related matchers
Roman Lebedev [Thu, 21 Mar 2019 15:33:35 +0000 (15:33 +0000)]
[ASTMatchers][OpenMP] OpenMP Structured-block-related matchers

Summary: Exposes to the  for ASTMatchers the interface/modelling
of OpenMP structured-block.

Reviewers: gribozavr, aaron.ballman, JonasToth, george.karpenkov

Reviewed By: gribozavr, aaron.ballman

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang, #openmp

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

llvm-svn: 356676

5 years ago[ASTTypeTraits][ASTMatchers][OpenMP] OMPClause handling
Roman Lebedev [Thu, 21 Mar 2019 15:33:24 +0000 (15:33 +0000)]
[ASTTypeTraits][ASTMatchers][OpenMP] OMPClause handling

Summary:
`OMPClause` is the base class, it is not descendant from **any**
other class, therefore for it to work with e.g.
`VariadicDynCastAllOfMatcher<>`, it needs to be handled here.

Reviewers: sbenza, bkramer, pcc, klimek, hokein, gribozavr, aaron.ballman, george.karpenkov

Reviewed By: gribozavr, aaron.ballman

Subscribers: guansong, jdoerfert, alexfh, ABataev, cfe-commits

Tags: #openmp, #clang

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

llvm-svn: 356675

5 years ago[ASTMatchers][OpenMP] Add base ompExecutableDirective() matcher.
Roman Lebedev [Thu, 21 Mar 2019 15:33:10 +0000 (15:33 +0000)]
[ASTMatchers][OpenMP] Add base ompExecutableDirective() matcher.

Summary:
A simple matcher for `OMPExecutableDirective` Stmt type.
Split off from D57113.

Reviewers: gribozavr, aaron.ballman, JonasToth, george.karpenkov

Reviewed By: gribozavr, aaron.ballman

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356674

5 years agoWorkaround items/iteritems difference between Python2 and Python3
Serge Guelton [Thu, 21 Mar 2019 14:47:40 +0000 (14:47 +0000)]
Workaround items/iteritems difference between Python2 and Python3

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

llvm-svn: 356673

5 years agoWorkaround Python's map difference between Python2/3
Serge Guelton [Thu, 21 Mar 2019 14:44:58 +0000 (14:44 +0000)]
Workaround Python's map difference between Python2/3

When the output of map is not used, using a list comprehension or an explicit
call to list looks awkward.

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

llvm-svn: 356672

5 years agoPortable int/long conversion across Python 2 / Python 3
Serge Guelton [Thu, 21 Mar 2019 14:41:34 +0000 (14:41 +0000)]
Portable int/long conversion across Python 2 / Python 3

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

llvm-svn: 356671

5 years agoPortable exception value access across Python 2 / Python 3
Serge Guelton [Thu, 21 Mar 2019 14:39:55 +0000 (14:39 +0000)]
Portable exception value access across Python 2 / Python 3

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

llvm-svn: 356670

5 years agoFixup opt-remarks.ll gold plugin test. NFC
David Green [Thu, 21 Mar 2019 14:35:06 +0000 (14:35 +0000)]
Fixup opt-remarks.ll gold plugin test. NFC

Now that rL356594 has added a TailCallElim pass to LTO, the call gets marked as
tail.

llvm-svn: 356669

5 years ago[DAGCombiner] Use getTokenFactor in a few more cases.
Florian Hahn [Thu, 21 Mar 2019 14:32:09 +0000 (14:32 +0000)]
[DAGCombiner] Use getTokenFactor in a few more cases.

SDNodes can only have 64k operands and for some inputs (e.g. large
number of stores), we can reach this limit when creating TokenFactor
nodes. This patch is a follow up to D56740 and updates a few more places
that potentially can create TokenFactors with too many operands.

Reviewers: efriedma, craig.topper, aemerson, RKSimon

Reviewed By: RKSimon

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

llvm-svn: 356668

5 years ago[DAGCombine] SimplifySelectCC - call FoldSetCC with the setcc result type
Simon Pilgrim [Thu, 21 Mar 2019 14:07:18 +0000 (14:07 +0000)]
[DAGCombine] SimplifySelectCC - call FoldSetCC with the setcc result type

We were calling FoldSetCC with the compare operand type instead of the result type.

Found by OSS-Fuzz #13838 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13838)

llvm-svn: 356667

5 years ago[ELF][ARM] Redesign of .ARM.exidx handling to use a SyntheticSection
Peter Smith [Thu, 21 Mar 2019 14:06:40 +0000 (14:06 +0000)]
[ELF][ARM] Redesign of .ARM.exidx handling to use a SyntheticSection

Instead of creating extra Synthetic .ARM.exidx sections to account for
gaps in the table, create a single .ARM.exidx SyntheticSection that can
derive the contents of the gaps from a sorted list of the executable
InputSections. This has the benefit of moving the ARM specific code for
SyntheticSections in SHF_LINK_ORDER processing and the table merging code
into the ARM specific SyntheticSection. This also makes it easier to create
EXIDX_CANTUNWIND table entries for executable InputSections that don't
have an associated .ARM.exidx section.

Fixes pr40277

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

llvm-svn: 356666