platform/upstream/llvm.git
5 years ago[Target] Replace Plugin headers with non-plugin headers
Alex Langford [Thu, 11 Jul 2019 23:45:35 +0000 (23:45 +0000)]
[Target] Replace Plugin headers with non-plugin headers

llvm-svn: 365843

5 years agoAMDGPU: s_waitcnt field should be treated as unsigned
Matt Arsenault [Thu, 11 Jul 2019 23:42:57 +0000 (23:42 +0000)]
AMDGPU: s_waitcnt field should be treated as unsigned

Also make it an ImmLeaf, so it should work with global isel as well,
which was part of the point of moving it in the first place.

llvm-svn: 365842

5 years agoUse clang driver for libfuzzer tests on Windows
Reid Kleckner [Thu, 11 Jul 2019 23:20:04 +0000 (23:20 +0000)]
Use clang driver for libfuzzer tests on Windows

Summary:
There's no real reason to use clang-cl on Windows, the clang driver
works just as well. This fixes a test which uses the -O0 flag, which was
recently removed from clang-cl to match MSVC, which lacks this flag.

While I'm here, remove the explicit -std=c++11 flag. Previously, this
flag was necessary when the default C++ standard was C++98. Now that the
default is C++14, this is no longer necessary. It's problematic on
Windows, because the Visual C++ standard library relies on C++14
features, and attempting to compile it with C++11 results in errors.
Rather than adding logic to conditionally set the standard to C++11 only
on non-Win, this flag can be removed.

See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and
https://reviews.llvm.org/D64506.

Reviewers: morehouse, thakis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 365841

5 years agoFix memory leak in set and map.
Eric Fiselier [Thu, 11 Jul 2019 23:13:38 +0000 (23:13 +0000)]
Fix memory leak in set and map.

When assigning an initializer list into set/map, libc++ would
leak memory if the initializer list contained equivalent keys
because we failed to check if the insertion was successful.

llvm-svn: 365840

5 years ago[sancov] Ignore PC samples with value 0
Petr Hosek [Thu, 11 Jul 2019 22:59:23 +0000 (22:59 +0000)]
[sancov] Ignore PC samples with value 0

The sancov runtime for the (Fuchsia) Zircon kernel delivers results
in the standard format, but as the full array of possible samples
with 0 in uncovered slots. That runtime delivers "live" data and
has no final "export" pass to compactify out the uncovered slots,
and it seems silly to require another offline tool just for that.

Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D63695

llvm-svn: 365839

5 years ago[NewPM] Port Sancov
Leonard Chan [Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)]
[NewPM] Port Sancov

This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.

Changes:

- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
  functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
  functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.

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

llvm-svn: 365838

5 years ago[AMDGPU] Fixed asan error with agpr spilling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 22:30:11 +0000 (22:30 +0000)]
[AMDGPU] Fixed asan error with agpr spilling

Instruction was used after it was erased.

llvm-svn: 365837

5 years agoFix build errors LLVM tests are disabled.
Diego Novillo [Thu, 11 Jul 2019 22:08:35 +0000 (22:08 +0000)]
Fix build errors LLVM tests are disabled.

Original patch from alanbaker@google.com

Fixes the error:
CMake Error in <...>/llvm/cmake/modules/CMakeLists.txt:

export called with target "LLVMTestingSupport" which requires target
"gtest" that is not in the export set.

This occurs when LLVM is embedded in a larger project, but is configured not to
include tests. If testing is disabled gtest isn't available and LLVM fails to
configure.

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

llvm-svn: 365836

5 years agoCodeGen: Suppress c++ warnings in test
Vitaly Buka [Thu, 11 Jul 2019 21:59:09 +0000 (21:59 +0000)]
CodeGen: Suppress c++ warnings in test

llvm-svn: 365835

5 years ago[mips] Simplify test case. NFC
Simon Atanasyan [Thu, 11 Jul 2019 21:55:56 +0000 (21:55 +0000)]
[mips] Simplify test case. NFC

Before rL295040 the linker just crashed when a GOT relocation (R_MIPS_GOT16)
comes from a merge section. To ensure that this bug still fixed it's enough
to check that the linker does not crash and create GOT entries.

llvm-svn: 365834

5 years ago[AMDGPU] gfx908 agpr spilling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:54:13 +0000 (21:54 +0000)]
[AMDGPU] gfx908 agpr spilling

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

llvm-svn: 365833

5 years agoFix a Python3 compatibility error
Azharuddin Mohammed [Thu, 11 Jul 2019 21:45:48 +0000 (21:45 +0000)]
Fix a Python3 compatibility error

  File "clang/test/lit.cfg.py", line 186, in <module>
    config.available_features.add('macos-sdk-' + macOSSDKVersion)
TypeError: must be str, not bytes

llvm-svn: 365832

5 years agoRename libclang_shared to libclang-cpp
Sylvestre Ledru [Thu, 11 Jul 2019 21:42:55 +0000 (21:42 +0000)]
Rename libclang_shared to libclang-cpp

Summary: Fix bug 42475

Reviewers: beanz, tstellar

Reviewed By: beanz

Subscribers: kimgr, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 365831

5 years ago[Attributor] Deduce "nosync" function attribute.
Stefan Stipanovic [Thu, 11 Jul 2019 21:37:40 +0000 (21:37 +0000)]
[Attributor] Deduce "nosync" function attribute.

Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.

Reviewers: jdoerfert, jfb, nhaehnle, arsenm

Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits

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

llvm-svn: 365830

5 years ago[AMDGPU] gfx908 hazard recognizer
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:30:34 +0000 (21:30 +0000)]
[AMDGPU] gfx908 hazard recognizer

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

llvm-svn: 365829

5 years ago[InstCombine][NFCI] Add more test coverage to onehot_merge.ll
Huihui Zhang [Thu, 11 Jul 2019 21:28:25 +0000 (21:28 +0000)]
[InstCombine][NFCI] Add more test coverage to onehot_merge.ll

Prep work for upcoming patch D64275.

llvm-svn: 365828

5 years ago[analyzer] exploded-graph-rewriter: Fix filenames in program point.
Artem Dergachev [Thu, 11 Jul 2019 21:27:42 +0000 (21:27 +0000)]
[analyzer] exploded-graph-rewriter: Fix filenames in program point.

Fix a typo in JSON field name.

llvm-svn: 365827

5 years ago[AMDGPU] gfx908 scheduling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:25:00 +0000 (21:25 +0000)]
[AMDGPU] gfx908 scheduling

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

llvm-svn: 365826

5 years ago[clang-shlib] Fix clang-shlib for PRIVATE dependencies
Shoaib Meenai [Thu, 11 Jul 2019 21:20:38 +0000 (21:20 +0000)]
[clang-shlib] Fix clang-shlib for PRIVATE dependencies

Any static library with a PRIVATE dependency ends up with a
$<LINK_ONLY:...> generator expression in its INTERFACE_LINK_LIBRARIES,
which won't be evaluated by the $<TARGET_PROPERTY:...>, so we end up
with an unevaluated generator expression in the generated build file and
Ninja chokes on the dollar sign. Just use the static library directly
for its dependencies instead of trying to propagate dependencies
manually.

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

llvm-svn: 365825

5 years ago[AMDGPU] gfx908 mfma support
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:19:33 +0000 (21:19 +0000)]
[AMDGPU] gfx908 mfma support

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

llvm-svn: 365824

5 years ago[COFF] Share the tail in delayimport symbol thunks
Martin Storsjo [Thu, 11 Jul 2019 21:19:11 +0000 (21:19 +0000)]
[COFF] Share the tail in delayimport symbol thunks

E.g. for x86_64, previously each symbol's thunk was 87 bytes. Now
there's a 12 byte thunk per symbol, plus a shared 83 byte tail
function.

This is similar to what both MS link.exe and GNU tools do for
delay imports.

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

llvm-svn: 365823

5 years agoCodeGen, NFC: Test for auto-init for 32bit pointers
Vitaly Buka [Thu, 11 Jul 2019 20:51:59 +0000 (20:51 +0000)]
CodeGen, NFC: Test for auto-init for 32bit pointers

llvm-svn: 365822

5 years ago[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.
Alexey Bataev [Thu, 11 Jul 2019 20:35:31 +0000 (20:35 +0000)]
[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.

Fixed the processing of the unsupported VLAs in the reduction clauses.
Used targetDiag if the diagnostics can be delayed and emit it
immediately if the target does not support VLAs and we're parsing target
directive with the reduction clauses.

llvm-svn: 365821

5 years agoOpen native file handles to avoid converting from FDs, NFC
Reid Kleckner [Thu, 11 Jul 2019 20:29:32 +0000 (20:29 +0000)]
Open native file handles to avoid converting from FDs, NFC

Follow up to r365588.

llvm-svn: 365820

5 years agoAdd convenience methods to convert LLDB to LLVM data structures.
Jonas Devlieghere [Thu, 11 Jul 2019 20:26:53 +0000 (20:26 +0000)]
Add convenience methods to convert LLDB to LLVM data structures.

This patch adds two convenience methods named GetAsLLVM to the LLDB
counterparts of the DWARF DataExtractor and the DWARF context. The
DWARFContext, once created, is cached for future usage.

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

llvm-svn: 365819

5 years ago[UpdateTestChecks] Emit warning when invalid test paths
David Bolvansky [Thu, 11 Jul 2019 20:14:22 +0000 (20:14 +0000)]
[UpdateTestChecks] Emit warning when invalid test paths

Summary:
Recently I ran into the following issue:

./update_test_checks.py /path/not-existing-file.ll

The script was silent and I was suprised why the real test file hadn't been updated.

Solution:
Emit warning if we detect this problem.

Reviewers: lebedev.ri, spatel, jdoerfert, nikic

Reviewed By: lebedev.ri, spatel, jdoerfert, nikic

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 365818

5 years ago[libomptarget-nvptx] Remove dead functions
Jonas Hahnfeld [Thu, 11 Jul 2019 20:12:51 +0000 (20:12 +0000)]
[libomptarget-nvptx] Remove dead functions

These entry points are never called by Clang trunk nor clang-ykt. If
XL doesn't use them either, they can finally go away.

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

llvm-svn: 365817

5 years ago[scudo][standalone] NFC corrections
Kostya Kortchinsky [Thu, 11 Jul 2019 19:55:53 +0000 (19:55 +0000)]
[scudo][standalone] NFC corrections

Summary:
A few corrections:
- rename `TransferBatch::MaxCached` to `getMaxCached` to conform with
  the style guide;
- move `getBlockBegin` from `Chunk::` to `Allocator::`: I believe it
  was a fallacy to have this be a `Chunk` method, as chunks'
  relationship to backend blocks are up to the frontend allocator. It
  makes more sense now, particularly with regard to the offset. Update
  the associated chunk test as the method isn't available there
  anymore;
- add a forgotten `\n` to a log string;
- for `releaseToOs`, instead of starting at `1`, start at `0` and
  `continue` on `BatchClassId`: in the end it's identical but doesn't
  assume a particular class id for batches;
- change a `CHECK` to a `reportOutOfMemory`: it's a clearer message

Reviewers: hctim, morehouse, eugenis, vitalybuka

Reviewed By: hctim

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 365816

5 years ago[NFC] Revisited tests for D64285
David Bolvansky [Thu, 11 Jul 2019 19:39:20 +0000 (19:39 +0000)]
[NFC] Revisited tests for D64285

llvm-svn: 365815

5 years agoRevert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"
Vedant Kumar [Thu, 11 Jul 2019 19:28:07 +0000 (19:28 +0000)]
Revert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"

This reverts commit 1af41074445229fea66b99710a850e5f42ecfa95.

llvm-svn: 365814

5 years ago[lldb] Make TestDeletedExecutable more reliable
Raphael Isemann [Thu, 11 Jul 2019 19:27:33 +0000 (19:27 +0000)]
[lldb] Make TestDeletedExecutable more reliable

Summary:
It seems that calling Popen can return to the caller before the started process has read all the needed information
from its executable. This means that in case we delete the executable while the process is still starting up,
this test will create a zombie process which in turn leads to a failing test. On my macOS system this happens quite frequently.

This patch fixes this by letting the test synchronize with the inferior after it has started up.

Reviewers: davide

Reviewed By: davide

Subscribers: labath, friss, lldb-commits

Tags: #lldb

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

llvm-svn: 365813

5 years ago[lldb] Don't use __FUNCTION__ as a file name
Raphael Isemann [Thu, 11 Jul 2019 19:26:55 +0000 (19:26 +0000)]
[lldb] Don't use __FUNCTION__ as a file name

Summary:
I saw while debugging that we call this file `ParseInternal`, which is not a very good name for our
fake expression file and also adds this unnecessary link between the way we name this function
and the other source location names we get from the expression parser. This patch is renaming
it to `<lldb-expr>` which is closer to the way Clang names its buffers, it doesn't depend on the
function name (which changes when I refactor this code) and it's easier to grep for.

Reviewers: davide

Reviewed By: davide

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 365812

5 years ago[NVPTX] Remove now unused atomic.load.add.f32 intrinsics
Benjamin Kramer [Thu, 11 Jul 2019 19:21:59 +0000 (19:21 +0000)]
[NVPTX] Remove now unused atomic.load.add.f32 intrinsics

llvm-svn: 365811

5 years ago[PowerPC][NFC] Update testcase to avoid dead code
Jinsong Ji [Thu, 11 Jul 2019 19:16:33 +0000 (19:16 +0000)]
[PowerPC][NFC] Update testcase to avoid dead code

The original testcase might be optimized out due to dead code,
update the testcase to avoid it.

llvm-svn: 365810

5 years ago[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC
Vedant Kumar [Thu, 11 Jul 2019 19:11:46 +0000 (19:11 +0000)]
[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC

Replace a `llvm::Function *` parameter with a bool, which seems harder
to set to the wrong value by accident.

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

llvm-svn: 365809

5 years ago[Driver] -noprofilelib flag
Petr Hosek [Thu, 11 Jul 2019 19:06:38 +0000 (19:06 +0000)]
[Driver] -noprofilelib flag

This flag is analoguous to other flags like -nostdlib or -nolibc
and could be used to disable linking of profile runtime library.
This is useful in certain environments like kernel, where profile
instrumentation is still desirable, but we cannot use the standard
runtime library.

llvm-svn: 365808

5 years ago[lld-link] implement -thinlto-{prefix,object-suffix}-replace
Bob Haarman [Thu, 11 Jul 2019 18:48:58 +0000 (18:48 +0000)]
[lld-link] implement -thinlto-{prefix,object-suffix}-replace

Summary:
Adds the following two options to lld-link:

-thinlto-prefix-replace: allows replacing a prefix in paths generated
for ThinLTO. This can be used to ensure index files and native object
files are stored in unique directories, allowing multiple distributed
ThinLTO links to proceed concurrently.

-thinlto-object-suffix-replace: allows replacing a suffix in object
file paths involved in ThinLTO. This allows minimized index files to
be used for the thin link while storing the paths to the full bitcode
files for subsequent steps (code generation and final linking).

Reviewers: ruiu, tejohnson, pcc, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 365807

5 years ago[TSan] Move DECLARE_REAL macro outside of namespace
Julian Lettner [Thu, 11 Jul 2019 18:26:33 +0000 (18:26 +0000)]
[TSan] Move DECLARE_REAL macro outside of namespace

This should fix the "undefined reference to
tsan::interception::real_setjmp" linker errors.

llvm-svn: 365806

5 years ago[profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARC
Rainer Orth [Thu, 11 Jul 2019 18:26:24 +0000 (18:26 +0000)]
[profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARC

While working on https://reviews.llvm.org/D40900 (which effectively is about enabling compiler-rt on sparc these days), I came across two failing profile testcases:

  Profile-sparc :: instrprof-merge-match.test
  Profile-sparc :: instrprof-merge.c
  Profile-sparcv9 :: instrprof-merge-match.test
  Profile-sparcv9 :: instrprof-merge.c

All of them crashed with a SIGBUS in __llvm_profile_merge_from_buffer:

  Thread 2 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1 (LWP 1)]
  0x00012368 in __llvm_profile_merge_from_buffer (
      ProfileData=0x2384c <main.Buffer> "\377lprofR\201", ProfileSize=360)
      at /vol/llvm/src/llvm/local/projects/compiler-rt/lib/profile/InstrProfilingMerge.c:95
  95        SrcDataEnd = SrcDataStart + Header->DataSize;

where Header is insufficiently aligned for a strict-alignment target like SPARC.

Fixed by forcing the alignment to uint64_t, the members of struct __llvm_profile_header,
in the callers.

Tested on sparcv9-sun-solaris2.11.

https://reviews.llvm.org/D64498

llvm-svn: 365805

5 years ago[clangd][NFC] Decrease template depth limit in RecursiveHierarchyUnbounded test
Jan Korous [Thu, 11 Jul 2019 18:21:21 +0000 (18:21 +0000)]
[clangd][NFC] Decrease template depth limit in RecursiveHierarchyUnbounded test

...to minimize the chance of stack overflow before reaching the limit.

llvm-svn: 365804

5 years ago[X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC
Craig Topper [Thu, 11 Jul 2019 18:19:27 +0000 (18:19 +0000)]
[X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC

llvm-svn: 365803

5 years ago[WebAssembly] Assembler: support negative float constants.
Wouter van Oortmerssen [Thu, 11 Jul 2019 18:18:07 +0000 (18:18 +0000)]
[WebAssembly] Assembler: support negative float constants.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 365802

5 years agoExplicitly define __STDC_FORMAT_MACROS for PRIu64
Mitch Phillips [Thu, 11 Jul 2019 18:07:03 +0000 (18:07 +0000)]
Explicitly define __STDC_FORMAT_MACROS for PRIu64

Summary:
Builds are failing on RHEL machines because of PRIu64.

lvm/projects/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp:420:50: error: expected ')'

`snprintf(ThreadBuffer, kThreadBufferLen, "%" PRIu64, ThreadID);`
inttypes.h in RHEL uses PRIu64 macros only when __STDC_FORMAT_MACROS is defined.

Author: DTharun

Reviewers: hctim

Reviewed By: hctim

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

llvm-svn: 365801

5 years ago[lld-link] implement -thinlto-index-only
Bob Haarman [Thu, 11 Jul 2019 18:03:14 +0000 (18:03 +0000)]
[lld-link] implement -thinlto-index-only

Summary:
This implements -thinlto-index-only, -thinlto-index-only:,
and -thinlto-emit-imports-files options in lld-link. They are
analogous to their counterparts in ld.lld: -thinlto-index-only
causes us to perform ThinLTO's thin link and write index files,
but not perform code generation. -thinlto-index-only: does the
same, but also writes a text file listing the native object
files expected to be generated. -thinlto-emit-imports-files
creates a text file next to each index file, listing the files
to import from.

Reviewers: ruiu, tejohnson, pcc, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 365800

5 years ago[HIP] Add GPU arch gfx1010, gfx1011, and gfx1012
Yaxun Liu [Thu, 11 Jul 2019 17:50:09 +0000 (17:50 +0000)]
[HIP] Add GPU arch gfx1010, gfx1011, and gfx1012

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

llvm-svn: 365799

5 years ago[CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw fadd
Benjamin Kramer [Thu, 11 Jul 2019 17:44:11 +0000 (17:44 +0000)]
[CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw fadd

llvm-svn: 365798

5 years ago[Docs] Add standardized header links to analyzer doc
Nathan Huckleberry [Thu, 11 Jul 2019 17:12:05 +0000 (17:12 +0000)]
[Docs] Add standardized header links to analyzer doc

Summary:
Header links should have some standard form so clang tidy
docs can easily reference them. The form is as follows.

Start with the analyzer full name including packages.
Replace all periods with dashes and lowercase everything.

Ex: core.CallAndMessage -> core-callandmessage

Reviewers: JonasToth, aaron.ballman, NoQ, Szelethus

Reviewed By: aaron.ballman, Szelethus

Subscribers: nickdesaulniers, lebedev.ri, baloghadamsoftware, mgrang, a.sidorin, Szelethus, jfb, donat.nagy, dkrupp, cfe-commits

Tags: #clang

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

llvm-svn: 365797

5 years ago[NVPTX] Use atomicrmw fadd instead of intrinsics
Benjamin Kramer [Thu, 11 Jul 2019 17:11:25 +0000 (17:11 +0000)]
[NVPTX] Use atomicrmw fadd instead of intrinsics

AutoUpgrade the old intrinsics to atomicrmw fadd.

llvm-svn: 365796

5 years agogn build: Merge r365792
Nico Weber [Thu, 11 Jul 2019 17:09:35 +0000 (17:09 +0000)]
gn build: Merge r365792

llvm-svn: 365795

5 years ago[clangd] Avoid template in Task constructor, hopefully fix MSVC build
Sam McCall [Thu, 11 Jul 2019 16:26:53 +0000 (16:26 +0000)]
[clangd] Avoid template in Task constructor, hopefully fix MSVC build

llvm-svn: 365794

5 years ago[clangd] Consume llvm::Error in test after r365792
Sam McCall [Thu, 11 Jul 2019 16:22:50 +0000 (16:22 +0000)]
[clangd] Consume llvm::Error in test after r365792

llvm-svn: 365793

5 years ago[clangd] Implementation of auto type expansion.
Sam McCall [Thu, 11 Jul 2019 16:04:18 +0000 (16:04 +0000)]
[clangd] Implementation of auto type expansion.

Add a tweak for clangd to replace an auto keyword to the deduced type.

This way a user can declare something with auto and then have the
IDE/clangd replace auto with whatever type clangd thinks it is. In case
of long/complext types this makes is reduces writing effort for the
user.

The functionality is similar to the hover over the auto keyword.

Example (from the header):

```
/// Before:
///    auto x = Something();
///    ^^^^
/// After:
///    MyClass x = Something();
///    ^^^^^^^
```

Patch by kuhnel! (Christian Kühnel)
Differential Revision: https://reviews.llvm.org/D62855

llvm-svn: 365792

5 years ago[X86] Merge negated ISD::SUB nodes into X86ISD::SUB equivalent (PR40483)
Sanjay Patel [Thu, 11 Jul 2019 15:56:33 +0000 (15:56 +0000)]
[X86] Merge negated ISD::SUB nodes into X86ISD::SUB equivalent (PR40483)

Follow up to D58597, where it was noted that the commuted ISD::SUB variant
was having problems with lack of combines.

See also D63958 where we untangled setcc/sub pairs.

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

llvm-svn: 365791

5 years ago[scudo][standalone] Merge Spin & Blocking mutex into a Hybrid one
Kostya Kortchinsky [Thu, 11 Jul 2019 15:32:26 +0000 (15:32 +0000)]
[scudo][standalone] Merge Spin & Blocking mutex into a Hybrid one

Summary:
We ran into a problem on Fuchsia where yielding threads would never
be deboosted, ultimately resulting in several threads spinning on the
same TSD, and no possibility for another thread to be scheduled,
dead-locking the process.

While this was fixed in Zircon, this lead to discussions about if
spinning without a break condition was a good decision, and settled on
a new hybrid model that would spin for a while then block.

Currently we are using a number of iterations for spinning that is
mostly arbitrary (based on sanitizer_common values), but this can
be tuned in the future.

Since we are touching `common.h`, we also use this change as a vehicle
for an Android optimization (the page size is fixed in Bionic, so use
a fixed value too).

Reviewers: morehouse, hctim, eugenis, dvyukov, vitalybuka

Reviewed By: hctim

Subscribers: srhines, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 365790

5 years agoFix a few 'no newline at end of file' warnings that Xcode emits
Nico Weber [Thu, 11 Jul 2019 15:26:45 +0000 (15:26 +0000)]
Fix a few 'no newline at end of file' warnings that Xcode emits

(Xcode even has a snazzy "Fix" button, but clicking that inserts two
newlines. So close!)

llvm-svn: 365789

5 years ago[libc++] Implement deduction guides for <unordered_set>
Louis Dionne [Thu, 11 Jul 2019 15:16:39 +0000 (15:16 +0000)]
[libc++] Implement deduction guides for <unordered_set>

Thanks to Arthur O'Dwyer for the patch.
Differential Revision: https://reviews.llvm.org/D58617

llvm-svn: 365788

5 years agogn build: Merge r365773
Nico Weber [Thu, 11 Jul 2019 15:01:50 +0000 (15:01 +0000)]
gn build: Merge r365773

llvm-svn: 365787

5 years ago[OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.
Alexey Bataev [Thu, 11 Jul 2019 14:54:17 +0000 (14:54 +0000)]
[OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.

Summary:
Some OpenMP clauses rely on the values of the variables. If the variable
is not initialized and used in OpenMP clauses that depend on the
variables values, it should be reported that the uninitialized variable
is used in the OpenMP clause expression.
This patch adds initial processing for uninitialized variables in OpenMP
constructs. Currently, it checks for use of the uninitialized variables
in the structured blocks.

Reviewers: NoQ, Szelethus, dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet

Subscribers: rnkovacs, guansong, jfb, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 365786

5 years ago[DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support
Simon Pilgrim [Thu, 11 Jul 2019 14:45:03 +0000 (14:45 +0000)]
[DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support

We already split extract_subvector(binop(insert_subvector(v,x),insert_subvector(w,y))) -> binop(x,y).

This patch adds support for extract_subvector(binop(concat_vectors(),concat_vectors())) cases as well.

In particular this means we don't have to wait for X86 lowering to convert concat_vectors to insert_subvector chains, which helps avoid some cases where demandedelts/combine calls occur too late to split large vector ops.

The fast-isel-store.ll load folding regression is annoying but I don't think is that critical.

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

llvm-svn: 365785

5 years agoRegUsageInfoCollector: Skip calling conventions I missed before
Matt Arsenault [Thu, 11 Jul 2019 14:41:40 +0000 (14:41 +0000)]
RegUsageInfoCollector: Skip calling conventions I missed before

llvm-svn: 365784

5 years agoAMDGPU/GlobalISel: Move kernel argument handling to separate function
Matt Arsenault [Thu, 11 Jul 2019 14:18:25 +0000 (14:18 +0000)]
AMDGPU/GlobalISel: Move kernel argument handling to separate function

llvm-svn: 365782

5 years agoFix missing C++ mode comment
Matt Arsenault [Thu, 11 Jul 2019 14:18:22 +0000 (14:18 +0000)]
Fix missing C++ mode comment

llvm-svn: 365781

5 years agoGlobalISel: Use Register
Matt Arsenault [Thu, 11 Jul 2019 14:18:19 +0000 (14:18 +0000)]
GlobalISel: Use Register

llvm-svn: 365780

5 years agoRevert r365775 - "[Object/ELF] - Improve error reporting for notes."
George Rimar [Thu, 11 Jul 2019 14:03:27 +0000 (14:03 +0000)]
Revert r365775 - "[Object/ELF] - Improve error reporting for notes."

It broke BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15419

llvm-svn: 365779

5 years ago[clangd] Remove an extra ";", NFC
Haojian Wu [Thu, 11 Jul 2019 13:58:56 +0000 (13:58 +0000)]
[clangd] Remove an extra ";", NFC

llvm-svn: 365778

5 years agoAdded mapping for pointers captured in Lambdas in OpenMP target regions,
Alexey Bataev [Thu, 11 Jul 2019 13:54:26 +0000 (13:54 +0000)]
Added mapping for pointers captured in Lambdas in OpenMP target regions,
by David Truby.

Summary:
This adds a zero length array section mapping for each pointer captured by a lambda that is used in a target region, as per section 2.19.7.1 of the OpenMP 5 specification.

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 365777

5 years ago[clangd][QueryDriver] Use language from underlying database if possible
Kadir Cetinkaya [Thu, 11 Jul 2019 13:47:46 +0000 (13:47 +0000)]
[clangd][QueryDriver] Use language from underlying database if possible

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 365776

5 years ago[Object/ELF] - Improve error reporting for notes.
George Rimar [Thu, 11 Jul 2019 13:47:44 +0000 (13:47 +0000)]
[Object/ELF] - Improve error reporting for notes.

This patch improves the error messages reported for
note sections and phdrs and also makes a cleanup for
existent test case.

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

llvm-svn: 365775

5 years ago[InstCombine] don't move FP negation out of a constant expression
Sanjay Patel [Thu, 11 Jul 2019 13:44:29 +0000 (13:44 +0000)]
[InstCombine] don't move FP negation out of a constant expression

-(X * ConstExpr) becomes X * (-ConstExpr), so don't reverse that
and infinite loop.

llvm-svn: 365774

5 years ago[clangd] Add priorities to background index queue, extract to separate class
Sam McCall [Thu, 11 Jul 2019 13:34:38 +0000 (13:34 +0000)]
[clangd] Add priorities to background index queue, extract to separate class

Reviewers: kadircet

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 365773

5 years ago[yaml2obj/elf-override-shsize.yaml] - An attemp to fix ppc64 bot.
George Rimar [Thu, 11 Jul 2019 13:26:36 +0000 (13:26 +0000)]
[yaml2obj/elf-override-shsize.yaml] - An attemp to fix ppc64 bot.

Failture:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/35670/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Aelf-override-shsize.yaml

Solution:
Change `od` tool invocation to print single bytes.

llvm-svn: 365772

5 years ago[WebAssembly] Import __stack_pointer when building -pie binaries
Sam Clegg [Thu, 11 Jul 2019 13:13:25 +0000 (13:13 +0000)]
[WebAssembly] Import __stack_pointer when building -pie binaries

The -pie binary doesn't know that layout ahead of time so needs to
import the stack pointer from the embedder, just like we do already
for shared libraries.

This change is needed in order to address:
https://github.com/emscripten-core/emscripten/issues/8915

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

llvm-svn: 365771

5 years agoOpaquePtr: switch to GlobalValue::getValueType in a few places. NFC.
Tim Northover [Thu, 11 Jul 2019 13:13:02 +0000 (13:13 +0000)]
OpaquePtr: switch to GlobalValue::getValueType in a few places. NFC.

llvm-svn: 365770

5 years agoOpaquePtr: use byval accessor instead of inspecting pointer type. NFC.
Tim Northover [Thu, 11 Jul 2019 13:12:38 +0000 (13:12 +0000)]
OpaquePtr: use byval accessor instead of inspecting pointer type. NFC.

The accessor can deal with both "byval(ty)" and "ty* byval" forms
seamlessly.

llvm-svn: 365769

5 years agoOpaquePtr: use load instruction directly for type. NFC.
Tim Northover [Thu, 11 Jul 2019 13:12:08 +0000 (13:12 +0000)]
OpaquePtr: use load instruction directly for type. NFC.

llvm-svn: 365768

5 years agoInstructionSimplify: Simplify InstructionSimplify. NFC.
Tim Northover [Thu, 11 Jul 2019 13:11:44 +0000 (13:11 +0000)]
InstructionSimplify: Simplify InstructionSimplify. NFC.

The interface predates CallBase, so both it and implementation were
significantly more complicated than they needed to be. There was even
some redundancy that could be eliminated.

Should also help with OpaquePointers by not trying to derive a
function's type from it's PointerType.

llvm-svn: 365767

5 years ago[yaml2obj] - Allow overriding the sh_size field.
George Rimar [Thu, 11 Jul 2019 12:59:29 +0000 (12:59 +0000)]
[yaml2obj] - Allow overriding the sh_size field.

There is no way to set broken sh_size field currently
for sections. It can be usefull for writing the
test cases.

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

llvm-svn: 365766

5 years ago[NFC] Updated tests for D64285
David Bolvansky [Thu, 11 Jul 2019 12:51:33 +0000 (12:51 +0000)]
[NFC] Updated tests for D64285

llvm-svn: 365765

5 years ago[clangd] Remove the extra ";", NFC
Haojian Wu [Thu, 11 Jul 2019 12:31:18 +0000 (12:31 +0000)]
[clangd] Remove the extra ";", NFC

llvm-svn: 365764

5 years ago[clangd] Fix an assertion crash in "ExtractVariable" tweak
Haojian Wu [Thu, 11 Jul 2019 12:29:01 +0000 (12:29 +0000)]
[clangd] Fix an assertion crash in "ExtractVariable" tweak

Summary:
GetTypePtr requires that the type should not be null, otherwise we hit
an assertion, we should use getTypePtrOrNull instead.

Reviewers: sammccall, SureYeaah

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

Tags: #clang

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

llvm-svn: 365763

5 years ago[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a...
George Rimar [Thu, 11 Jul 2019 12:26:48 +0000 (12:26 +0000)]
[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a broken dynamic section.

It does not make sence to stop dumping the object if the broken
dynamic section was found. In this patch I changed the behavior from
"report an error" to "report a warning". This matches GNU.

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

llvm-svn: 365762

5 years ago[LLDB] Fix FreeBSD build.
David Carlier [Thu, 11 Jul 2019 12:21:04 +0000 (12:21 +0000)]
[LLDB] Fix FreeBSD build.

To align with the LaunchThread change.

Reviewers: MaskRay, mgorny

Reviewed By: MaskRay

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

llvm-svn: 365761

5 years ago[ELF] Handle non-glob patterns before glob patterns in version scripts & fix a corner...
Fangrui Song [Thu, 11 Jul 2019 11:16:51 +0000 (11:16 +0000)]
[ELF] Handle non-glob patterns before glob patterns in version scripts & fix a corner case of --dynamic-list

This fixes PR38549, which is silently accepted by ld.bfd.
This seems correct because it makes sense to let non-glob patterns take
precedence over glob patterns.

lld issues an error because
`assignWildcardVersion(ver, VER_NDX_LOCAL);` is processed before `assignExactVersion(ver, v.id, v.name);`.

Move all assignWildcardVersion() calls after assignExactVersion() calls
to fix this.

Also, move handleDynamicList() to the bottom. computeBinding() called by
includeInDynsym() has this cryptic rule:

    if (versionId == VER_NDX_LOCAL && isDefined() && !isPreemptible)
      return STB_LOCAL;

Before the change:

* foo's version is set to VER_NDX_LOCAL due to `local: *`
* handleDynamicList() is called
  - foo.computeBinding() is STB_LOCAL
  - foo.includeInDynsym() is false
  - foo.isPreemptible is not set (wrong)
* foo's version is set to V1

After the change:

* foo's version is set to VER_NDX_LOCAL due to `local: *`
* foo's version is set to V1
* handleDynamicList() is called
  - foo.computeBinding() is STB_GLOBAL
  - foo.includeInDynsym() is true
  - foo.isPreemptible is set (correct)

Reviewed By: ruiu

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

llvm-svn: 365760

5 years ago[ELF] Warn rather than error when duplicate version assignments occur
Fangrui Song [Thu, 11 Jul 2019 11:16:44 +0000 (11:16 +0000)]
[ELF] Warn rather than error when duplicate version assignments occur

In lvm2, libdevmapper.so is linked with a version script with duplicate
version assignments:

    DM_1_02_138 { global: ... dm_bitset_parse_list; ... };
    DM_1_02_129 { global: ... dm_bitset_parse_list; ... };

ld.bfd silently accepts this while gold issues a warning. We currently
error, thus inhibit producing the executable. Change the error to
warning to allow this case, and improve the message.

There are some cases where ld.bfd error
`anonymous version tag cannot be combined with other version tags`
but we just warn. It is probably OK for now.

Reviewed By: grimar, ruiu

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

llvm-svn: 365759

5 years ago[InstCombine] Reorder recently added/improved pow transformations
David Bolvansky [Thu, 11 Jul 2019 10:55:04 +0000 (10:55 +0000)]
[InstCombine] Reorder recently added/improved pow transformations

Changed cases are now faster with exp2.

llvm-svn: 365758

5 years agoRevert [BitcodeReader] Validate OpNum, before accessing Record array.
Florian Hahn [Thu, 11 Jul 2019 10:53:40 +0000 (10:53 +0000)]
Revert [BitcodeReader] Validate OpNum, before accessing Record array.

This reverts r365750 (git commit 8b222ecf2769ee133691f208f6166ce118c4a164)

llvm-dis runs out of memory while opening invalid-fcmp-opnum.bc on
llvm-hexagon-elf, probably because the bitcode file contains other
suspicious values.

http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/21949

llvm-svn: 365757

5 years ago[clangd] Fix windows buildbots
Kadir Cetinkaya [Thu, 11 Jul 2019 10:41:58 +0000 (10:41 +0000)]
[clangd] Fix windows buildbots

llvm-svn: 365756

5 years ago[X86] Regenerate intrinsics tests. NFCI.
Simon Pilgrim [Thu, 11 Jul 2019 10:40:23 +0000 (10:40 +0000)]
[X86] Regenerate intrinsics tests. NFCI.

llvm-svn: 365755

5 years ago[AMDGPU] Regenerate idot tests. NFCI.
Simon Pilgrim [Thu, 11 Jul 2019 10:37:58 +0000 (10:37 +0000)]
[AMDGPU] Regenerate idot tests. NFCI.

Reduces diff in D63281.

llvm-svn: 365754

5 years ago[llvm-objcopy] Don't change permissions of non-regular output files
Fangrui Song [Thu, 11 Jul 2019 10:17:59 +0000 (10:17 +0000)]
[llvm-objcopy] Don't change permissions of non-regular output files

There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`.
Worse, root can even change the mode bits of /dev/null.

Fix it by checking if the output file is special.

A new overload of llvm::sys::fs::setPermissions with FD as the parameter
is added. Users should provide `perm & ~umask` as the parameter if they
intend to respect umask.

The existing overload of llvm::sys::fs::setPermissions may be deleted if
we can find an implementation of fchmod() on Windows. fchmod() is
usually better than chmod() because it saves syscalls and can avoid race
condition.

Reviewed By: jakehehrlich, jhenderson

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

llvm-svn: 365753

5 years ago[X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled
Fangrui Song [Thu, 11 Jul 2019 10:10:09 +0000 (10:10 +0000)]
[X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled

Summary:
As of binutils 2.32, ld has a bogus TLS relaxation error when the GD/LD
code sequence using R_X86_64_GOTPCREL (instead of R_X86_64_GOTPCRELX) is
attempted to be relaxed to IE/LE (binutils PR24784). gold and lld are good.

In gcc/config/i386/i386.md, there is a configure-time check of as/ld
support and the GOT relaxation will not be used if as/ld doesn't support
it:

    if (flag_plt || !HAVE_AS_IX86_TLS_GET_ADDR_GOT)
      return "call\t%P2";
    return "call\t{*%p2@GOT(%1)|[DWORD PTR %p2@GOT[%1]]}";

In clang, -DENABLE_X86_RELAX_RELOCATIONS=OFF is the default. The ld.bfd
bogus error can be reproduced with:

    thread_local int a;
    int main() { return a; }

clang -fno-plt -fpic a.cc -fuse-ld=bfd

GOTPCRELX gained relative good support in 2016, which is considered
relatively new.  It is even difficult to conditionally default to
-DENABLE_X86_RELAX_RELOCATIONS=ON due to cross compilation reasons. So
work around the ld.bfd bug by only using GOT when GOTPCRELX is enabled.

Reviewers: dalias, hjl.tools, nikic, rnk

Reviewed By: nikic

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 365752

5 years ago[clangd] Add a missing "return nullptr;" to the SelectionTree::commonAncestor.
Haojian Wu [Thu, 11 Jul 2019 10:06:24 +0000 (10:06 +0000)]
[clangd] Add a missing "return nullptr;" to the SelectionTree::commonAncestor.

This would fix some mysterious crashes on codeAction in clangd.

llvm-svn: 365751

5 years ago[BitcodeReader] Validate OpNum, before accessing Record array.
Florian Hahn [Thu, 11 Jul 2019 09:57:00 +0000 (09:57 +0000)]
[BitcodeReader] Validate OpNum, before accessing Record array.

Currently invalid bitcode files can cause a crash, when OpNum exceeds
the number of elements in Record, like in the attached bitcode file.

The test case was generated by clusterfuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15698

Reviewers: t.p.northover, thegameg, jfb

Reviewed By: jfb

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

llvm-svn: 365750

5 years ago[ARM][LowOverheadLoops] Correct offset checking
Sam Parker [Thu, 11 Jul 2019 09:56:15 +0000 (09:56 +0000)]
[ARM][LowOverheadLoops] Correct offset checking

This patch addresses a couple of problems:
1) The maximum supported offset of LE is -4094.
2) The offset of WLS also needs to be checked, this uses a
   maximum positive offset of 4094.

The use of BasicBlockUtils has been changed because the block offsets
weren't being initialised, but the isBBInRange checks both positive
and negative offsets.

ARMISelLowering has been tweaked because the test case presented
another pattern that we weren't supporting.

llvm-svn: 365749

5 years ago[clangd] Reland rL365634
Kadir Cetinkaya [Thu, 11 Jul 2019 09:54:31 +0000 (09:54 +0000)]
[clangd] Reland rL365634

This was reverted in rL365678, the failure was due to YAML parsing of
compile_commands.json.

Converting backslashes to forward slashes to fix the issue in unittest.

llvm-svn: 365748

5 years ago[ARM] Remove nonexistent unsigned forms of MVE VQDMLAH.
Simon Tatham [Thu, 11 Jul 2019 09:52:15 +0000 (09:52 +0000)]
[ARM] Remove nonexistent unsigned forms of MVE VQDMLAH.

The VQDMLAH.U8, VQDMLAH.U16 and VQDMLAH.U32 instructions don't
actually exist: the Armv8.1-M architecture spec only lists signed
forms of that instruction. The unsigned ones were added in error: they
existed in an early draft of the spec, but they were removed before
the public version, and we missed that particular spec change.

Also affects the variant forms VQDMLASH, VQRDMLAH and VQRDMLASH.

Reviewers: miyuki

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

Tags: #llvm

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

llvm-svn: 365747

5 years ago[NFC][PowerPC] Added test to track current behaviour of TailDup
Kai Luo [Thu, 11 Jul 2019 09:43:03 +0000 (09:43 +0000)]
[NFC][PowerPC] Added test to track current behaviour of TailDup

llvm-svn: 365746

5 years ago[clangd] Added highlightings for namespace specifiers.
Johan Vikstrom [Thu, 11 Jul 2019 09:29:16 +0000 (09:29 +0000)]
[clangd] Added highlightings for namespace specifiers.

Summary: Added highlightings for namespace specifiers.

Reviewers: hokein, sammccall, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 365745

5 years ago[MIPS GlobalISel] Skip copies in addUseDef and addDefUses
Petar Avramovic [Thu, 11 Jul 2019 09:28:34 +0000 (09:28 +0000)]
[MIPS GlobalISel] Skip copies in addUseDef and addDefUses

Skip copies between virtual registers during search for UseDefs
and DefUses.
Since each operand has one def search for UseDefs is straightforward.
But since operand can have many uses, we have to check all uses of
each copy we traverse during search for DefUses.

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

llvm-svn: 365744

5 years ago[MIPS GlobalISel] RegBankSelect for chains of ambiguous instructions
Petar Avramovic [Thu, 11 Jul 2019 09:22:49 +0000 (09:22 +0000)]
[MIPS GlobalISel] RegBankSelect for chains of ambiguous instructions

When one of the uses/defs of ambiguous instruction is also ambiguous
visit it recursively and search its uses/defs for instruction with
only one mapping available.
When all instruction in a chain are ambiguous arbitrary mapping can
be selected. For s64 operands in ambiguous chain fprb is selected since
it results in less instructions then having to narrow scalar s64 to s32.
For s32 both gprb and fprb result in same number of instructions and
gprb is selected like a general purpose option.

At the moment we always avoid cross register bank copies.
TODO: Implement a model for costs calculations of different mappings
on same instruction and cross bank copies. Allow cross bank copies
when appropriate according to cost model.

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

llvm-svn: 365743