platform/upstream/llvm.git
5 years ago[ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling...
Fangrui Song [Fri, 1 Mar 2019 05:27:01 +0000 (05:27 +0000)]
[ConstantHoisting] Call cleanup() in ConstantHoistingPass::runImpl to avoid dangling elements in ConstIntInfoVec for new PM

Summary:
ConstIntInfoVec contains elements extracted from the previous function.
In new PM, releaseMemory() is not called and the dangling elements can
cause segfault in findConstantInsertionPoint.

Rename releaseMemory() to cleanup() to deliver the idea that it is
mandatory and call cleanup() in ConstantHoistingPass::runImpl to fix
this.

Reviewers: ormris, zzheng, dmgreen, wmi

Reviewed By: ormris, wmi

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 355174

5 years ago[ELF] Explain some options in ld.lld.1
Fangrui Song [Fri, 1 Mar 2019 04:49:42 +0000 (04:49 +0000)]
[ELF] Explain some options in ld.lld.1

Reviewers: ruiu, grimar

Reviewed By: ruiu

Subscribers: srhines, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355173

5 years ago[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API
Julian Lettner [Fri, 1 Mar 2019 04:03:38 +0000 (04:03 +0000)]
[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API

Retrying without replacing call sites in sanitizer_common (which might
not have a symbol definition).

Add new Unwind API. This is the final envisioned API with the correct
abstraction level. It hides/slow fast unwinder selection from the caller
and doesn't take any arguments that would leak that abstraction (i.e.,
arguments like stack_top/stack_bottom).

GetStackTrace will become an implementation detail (private method) of
the BufferedStackTrace class.

Reviewers: vitalybuka

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

> llvm-svn: 355168

llvm-svn: 355172

5 years agoRevert "[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API"
Julian Lettner [Fri, 1 Mar 2019 03:35:05 +0000 (03:35 +0000)]
Revert "[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API"

This reverts commit 6112f37e758ebf2405955e091a745f5003c1f562.

llvm-svn: 355171

5 years agoUpdate com.apple.diagnosticd.diagnostic entitlement
Jason Molenda [Fri, 1 Mar 2019 03:34:51 +0000 (03:34 +0000)]
Update com.apple.diagnosticd.diagnostic entitlement
name to the newer com.apple.private.logging.diagnostic.

<rdar://problem/47183116>

llvm-svn: 355170

5 years agoIncrease timeout in Symbols::DownloadObjectAndSymbolFile
Jason Molenda [Fri, 1 Mar 2019 03:24:59 +0000 (03:24 +0000)]
Increase timeout in Symbols::DownloadObjectAndSymbolFile
from 30 seconds to 120 seconds.  We've seen cases where
this symbol lookup can exceed 30 seconds for people
working remotely.

<rdar://problem/48460476>

llvm-svn: 355169

5 years ago[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API
Julian Lettner [Fri, 1 Mar 2019 03:08:34 +0000 (03:08 +0000)]
[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API

Add new Unwind API. This is the final envisioned API with the correct
abstraction level. It hides/slow fast unwinder selection from the caller
and doesn't take any arguments that would leak that abstraction (i.e.,
arguments like stack_top/stack_bottom).

GetStackTrace will become an implementation detail (private method) of
the BufferedStackTrace class.

Reviewers: vitalybuka

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

llvm-svn: 355168

5 years ago[Subtarget] Remove static global constructor call from the tablegened subtarget featu...
Craig Topper [Fri, 1 Mar 2019 02:19:26 +0000 (02:19 +0000)]
[Subtarget] Remove static global constructor call from the tablegened subtarget feature tables

Subtarget features are stored in a std::bitset that has been subclassed. There is a special constructor to allow the tablegen files to provide a list of bits to initialize the std::bitset to. This constructor isn't constexpr and std::bitset doesn't support many constexpr operations either. This results in a static global constructor being used to initialize the feature bitsets in these files at startup.

To fix this I've introduced a new FeatureBitArray class that holds three 64-bit values representing the initial bit values and taught tablegen to emit hex constants for them based on the feature enum values. This makes the tablegen files less readable than they were before. I can add the list of features back as a comment if we think that's important.

I've added a method to convert from this class into the std::bitset subclass we had before. I considered making the new FeatureBitArray class just implement the std::bitset interface we need instead, but thought I'd see how others felts about that first.

I've simplified the interfaces to SetImpliedBits and ClearImpliedBits a little minimize the number of times we need to convert to the bitset.

This removes about 27K from my local release+asserts build of llc.

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

llvm-svn: 355167

5 years ago[CodeGen] Fix calling llvm.var.annotation outside of a basic block.
Volodymyr Sapsai [Fri, 1 Mar 2019 02:15:39 +0000 (02:15 +0000)]
[CodeGen] Fix calling llvm.var.annotation outside of a basic block.

When we have an annotated local variable after a function returns, we
generate IR that fails verification with the error

> Instruction referencing instruction not embedded in a basic block!

And it means that bitcast referencing alloca doesn't have a parent basic
block.

Fix by checking if we are at an unreachable point and skip emitting
annotations. This approach is similar to the way we emit variable
initializer and debug info.

rdar://problem/46200420

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: aprantl, jkorous, dexonsmith, cfe-commits

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

llvm-svn: 355166

5 years ago[hwasan] Disable vfork code when building w/o interceptors.
Evgeniy Stepanov [Fri, 1 Mar 2019 02:06:58 +0000 (02:06 +0000)]
[hwasan] Disable vfork code when building w/o interceptors.

Don't define vfork when OMPILER_RT_HWASAN_WITH_INTERCEPTORS=OFF.

llvm-svn: 355165

5 years ago[sanitizer] Build everything whereever possible with -z text.
Evgeniy Stepanov [Fri, 1 Mar 2019 01:45:01 +0000 (01:45 +0000)]
[sanitizer] Build everything whereever possible with -z text.

Reviewers: pcc, phosek

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 355164

5 years ago[WebAssembly] Lower SIMD shifts since they are fixed in V8
Thomas Lively [Fri, 1 Mar 2019 01:38:54 +0000 (01:38 +0000)]
[WebAssembly] Lower SIMD shifts since they are fixed in V8

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, hiraditya, aheejin, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 355163

5 years ago[libc++] Fix forgotten fclose() in unit test
Louis Dionne [Fri, 1 Mar 2019 01:32:44 +0000 (01:32 +0000)]
[libc++] Fix forgotten fclose() in unit test

Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58732

llvm-svn: 355162

5 years ago[pstl] Fix missing parallel policy guards
Louis Dionne [Fri, 1 Mar 2019 01:26:35 +0000 (01:26 +0000)]
[pstl] Fix missing parallel policy guards

Thanks to @jerryct for the patch.
Differential Revision: https://reviews.llvm.org/D57638

llvm-svn: 355161

5 years ago[libc++] Increase portability of xalloc test
Louis Dionne [Fri, 1 Mar 2019 00:51:54 +0000 (00:51 +0000)]
[libc++] Increase portability of xalloc test

Do not assume that xalloc() starts at 0, which is not specified by the
Standard.

Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58299

llvm-svn: 355160

5 years agoAMDGPU/GlobalISel: Implement select for G_INSERT
Tom Stellard [Fri, 1 Mar 2019 00:50:26 +0000 (00:50 +0000)]
AMDGPU/GlobalISel: Implement select for G_INSERT

Re-commit r344310.

Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 355159

5 years ago[clang-format][TableGen] Don't add spaces around items in square braces.
Jordan Rupprecht [Fri, 1 Mar 2019 00:12:18 +0000 (00:12 +0000)]
[clang-format][TableGen] Don't add spaces around items in square braces.

Summary:
clang-formatting wants to add spaces around items in square braces, e.g. [1, 2] -> [ 1, 2 ]. Based on a quick check [1], it seems like most cases are using the [1, 2] format, so make that the consistent one.

[1] in llvm `.td` files, the regex `\[[^ ]` (bracket followed by not-a-space) shows up ~400 times, but `\[\s[^ ]` (bracket followed by one space and one not-a-space) shows up ~40 times => ~90% uses this format.

Reviewers: djasper, krasimir, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 355158

5 years ago[WebAssembly] Fix crash when @llvm.global_dtors is external
Thomas Lively [Fri, 1 Mar 2019 00:12:13 +0000 (00:12 +0000)]
[WebAssembly] Fix crash when @llvm.global_dtors is external

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 355157

5 years agoAMDGPU/GlobalISel: Implement select for G_EXTRACT
Tom Stellard [Thu, 28 Feb 2019 23:37:48 +0000 (23:37 +0000)]
AMDGPU/GlobalISel: Implement select for G_EXTRACT

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 355156

5 years agoSymbols.cpp in unittest moved too.
Jason Molenda [Thu, 28 Feb 2019 23:37:28 +0000 (23:37 +0000)]
Symbols.cpp in unittest moved too.

llvm-svn: 355155

5 years ago[PPC] Secure PLT only has meaning for PIC
Joerg Sonnenberger [Thu, 28 Feb 2019 23:33:09 +0000 (23:33 +0000)]
[PPC] Secure PLT only has meaning for PIC

llvm-svn: 355154

5 years agoELF: Write .eh_frame_hdr explicitly after writing .eh_frame.
Peter Collingbourne [Thu, 28 Feb 2019 23:11:35 +0000 (23:11 +0000)]
ELF: Write .eh_frame_hdr explicitly after writing .eh_frame.

This lets us remove the special case from Writer::writeSections(), and also
fixes a bug where .eh_frame_hdr isn't necessarily written in the correct
order if a linker script moves .eh_frame and .eh_frame_hdr into the same
output section.

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

llvm-svn: 355153

5 years ago[sancov] Instrument reachable blocks that end in unreachable
Reid Kleckner [Thu, 28 Feb 2019 22:54:30 +0000 (22:54 +0000)]
[sancov] Instrument reachable blocks that end in unreachable

Summary:
These sorts of blocks often contain calls to noreturn functions, like
longjmp, throw, or trap. If they don't end the program, they are
"interesting" from the perspective of sanitizer coverage, so we should
instrument them. This was discussed in https://reviews.llvm.org/D57982.

Reviewers: kcc, vitalybuka

Subscribers: llvm-commits, craig.topper, efriedma, morehouse, hiraditya

Tags: #llvm

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

llvm-svn: 355152

5 years agollvm-readobj: Try the DWARF CFI dumper on all machines.
Peter Collingbourne [Thu, 28 Feb 2019 22:42:55 +0000 (22:42 +0000)]
llvm-readobj: Try the DWARF CFI dumper on all machines.

There's no reason to limit the DWARF CFI dumper to EM_386 and EM_X86_64;
ELF files could contain DWARF CFI on almost any platform (even 32-bit ARM;
NetBSD uses DWARF CFI on that platform). So start using the DWARF CFI dumper
unconditionally so that we can dump .eh_frame sections on the remaining ELF
platforms as well as in NetBSD binaries.

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

llvm-svn: 355151

5 years agoUpdate testcase since llvm-dwarfdump got more accurate in r355148.
Adrian Prantl [Thu, 28 Feb 2019 22:26:00 +0000 (22:26 +0000)]
Update testcase since llvm-dwarfdump got more accurate in r355148.

llvm-svn: 355150

5 years ago[CMake] Make liblldb depend on clang-headers
Alex Langford [Thu, 28 Feb 2019 22:24:18 +0000 (22:24 +0000)]
[CMake] Make liblldb depend on clang-headers

Summary:
The clang headers are useful when dealing with clang modules. There is also a
way to get to the clang headers from the SB API so it would be nice if they were
also available when we just build lldb.

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

llvm-svn: 355149

5 years agodsymutil support for DW_OP_convert
Adrian Prantl [Thu, 28 Feb 2019 22:12:32 +0000 (22:12 +0000)]
dsymutil support for DW_OP_convert

Add support for cloning DWARF expressions that contain base type DIE
references in dsymutil.

<rdar://problem/48167812>

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

llvm-svn: 355148

5 years agogn build: Merge r355133.
Peter Collingbourne [Thu, 28 Feb 2019 22:12:09 +0000 (22:12 +0000)]
gn build: Merge r355133.

llvm-svn: 355147

5 years agogn build: Merge r355035
Nico Weber [Thu, 28 Feb 2019 22:08:18 +0000 (22:08 +0000)]
gn build: Merge r355035

llvm-svn: 355146

5 years agogn build: Merge r355024
Nico Weber [Thu, 28 Feb 2019 22:07:37 +0000 (22:07 +0000)]
gn build: Merge r355024

llvm-svn: 355145

5 years agocfi: Rename source file from cc to cpp
Nico Weber [Thu, 28 Feb 2019 22:03:41 +0000 (22:03 +0000)]
cfi: Rename source file from cc to cpp

See discussion on https://reviews.llvm.org/D58620 for the review.

llvm-svn: 355144

5 years ago[CMake][LibFuzzer] Match symbol visibility setting between LibFuzzer object files...
Dan Liew [Thu, 28 Feb 2019 21:57:58 +0000 (21:57 +0000)]
[CMake][LibFuzzer] Match symbol visibility setting between LibFuzzer object files and unit tests.

Summary:
This fixes inconsistent symbol visibility. This shows up as a linker
warning if r336238 (43f633564e338a6dde83d49a48e5bfcbfdce292c) is
reverted.

```
ld: warning: direct access in function 'fuzzer::CleanseCrashInput(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, fuzzer::FuzzingOptions const&)' from file '/Volumes/data/dev/llvm/upstream/master/builds/projects/compiler-rt/lib/fuzzer/tests/libRTFuzzerTest.x86_64.a(FuzzerDriver.cpp.o)' to global weak symbol 'fuzzer::Command::ignoreRemainingArgs()::kIgnoreRemaining' from file 'FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o' means the weak symbol cannot be overridden
 at runtime. This was likely caused by different translation units being compiled with different visibility settings.
```

r336238 just hid the issue rather than fixing the real issue. On macOS
and other platforms we usually compile with `-fvisibility=hidden` but
the unit tests were compiled without this flag.

Reviewers: george.karpenkov, kubamracek, kcc, yln

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 355143

5 years ago[CMake][libunwind] Define add_target_flags which is missing
Petr Hosek [Thu, 28 Feb 2019 21:38:59 +0000 (21:38 +0000)]
[CMake][libunwind] Define add_target_flags which is missing

It's use was introduced in r353084 but its definition is missing.

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

llvm-svn: 355142

5 years ago[COFF] Add address-taken import thunks to the fid table
Reid Kleckner [Thu, 28 Feb 2019 21:05:41 +0000 (21:05 +0000)]
[COFF] Add address-taken import thunks to the fid table

Summary: Fixes PR39799

Reviewers: dmajor, hans

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355141

5 years ago[OpenMP][OMPT] Distinguish different barrier kinds
Jonathan Peyton [Thu, 28 Feb 2019 20:55:39 +0000 (20:55 +0000)]
[OpenMP][OMPT] Distinguish different barrier kinds

This change makes the runtime decide the intended use of each barrier
invocation, for the OMPT synchronization tool callbacks.  The OpenMP 5.0
specification defines four possible barrier kinds -- implicit, explicit,
implementation, and just normal barrier.

Patch by Hansang Bae

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

llvm-svn: 355140

5 years agoTrying to fix bot breakage due to symbols not defined for WINDOWS!
Manman Ren [Thu, 28 Feb 2019 20:48:19 +0000 (20:48 +0000)]
Trying to fix bot breakage due to symbols not defined for WINDOWS!

Follow up to r355133

llvm-svn: 355139

5 years ago[OpenMP 5.0] Deprecate nest-var and associated features
Jonathan Peyton [Thu, 28 Feb 2019 20:47:21 +0000 (20:47 +0000)]
[OpenMP 5.0] Deprecate nest-var and associated features

Nest-var, OMP_NESTED, omp_set_nested()., and omp_get_nested() have been
deprecated in the 5.0 spec. Initial nesting info is now derived from
OMP_MAX_ACTIVE_LEVELS, OMP_NUM_THREADS, and OMP_PROC_BIND.

This patch deprecates the internal ICV that corresponds to nest-var, and
replaces it with the max-active-levels-var ICV to determine nesting. The
change still allows for use of OMP_NESTED (according to 5.0 changes),
omp_get_nested, and omp_set_nested, which have had deprecation messages
added to them. The change allows certain settings of OMP_NUM_THREADS,
OMP_PROC_BIND, and OMP_MAX_ACTIVE_LEVELS to turn on nesting, but
OMP_NESTED=0 will still force nesting to be off.

The runtime now prints informative messages about deprecation of
OMP_NESTED, omp_set_nested(), and omp_get_nested(), when those
environment variables or routines are used. It also prints deprecated
message in output for KMP_SETTINGS and OMP_DISPLAY_ENV for OMP_NESTED.
This patch also fixes OMP_DISPLAY_ENV output for OMP_TARGET_OFFLOAD.

Patch by Terry Wilmarth

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

llvm-svn: 355138

5 years ago[hwasan] Fix vfork handling with large stack limit.
Evgeniy Stepanov [Thu, 28 Feb 2019 20:43:24 +0000 (20:43 +0000)]
[hwasan] Fix vfork handling with large stack limit.

Remove the maximum stack cleanup size check. With ulimit -s unlimited
main thread stack can be very large, but we don't really have a choice
other than cleaning all of it. It should be reasonably fast - hwasan
cleans large shadow ranges with a single madvise call.

This change fixes check-hwasan after ulimit -s unlimited.

llvm-svn: 355137

5 years ago[AArch64] [Windows] Don't skip constructing UnwindHelp.
Eli Friedman [Thu, 28 Feb 2019 20:38:45 +0000 (20:38 +0000)]
[AArch64] [Windows] Don't skip constructing UnwindHelp.

In certain cases, the first non-frame-setup instruction in a function is
a branch.  For example, it could be a cbz on an argument.  Make sure we
correctly allocate the UnwindHelp, and find an appropriate register to
use to initialize it.

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

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

llvm-svn: 355136

5 years ago[AArch64] [Windows] Fix llvm-readobj -unwind output with many epilogs.
Eli Friedman [Thu, 28 Feb 2019 20:33:22 +0000 (20:33 +0000)]
[AArch64] [Windows] Fix llvm-readobj -unwind output with many epilogs.

The number of epilog scopes may not fit into a uint8_t.

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

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

llvm-svn: 355135

5 years ago[AArch64] Improve FP16 vector convert from short instructions.
Abderrazek Zaafrani [Thu, 28 Feb 2019 20:21:46 +0000 (20:21 +0000)]
[AArch64] Improve FP16 vector convert from short instructions.
https://reviews.llvm.org/D58563

llvm-svn: 355134

5 years agoAdd a module pass for order file instrumentation
Manman Ren [Thu, 28 Feb 2019 20:13:38 +0000 (20:13 +0000)]
Add a module pass for order file instrumentation

The basic idea of the pass is to use a circular buffer to log the execution ordering of the functions. We only log the function when it is first executed. We use a 8-byte hash to log the function symbol name.

In this pass, we add three global variables:
(1) an order file buffer: a circular buffer at its own llvm section.
(2) a bitmap for each module: one byte for each function to say if the function is already executed.
(3) a global index to the order file buffer.

At the function prologue, if the function has not been executed (by checking the bitmap), log the function hash, then atomically increase the index.

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

llvm-svn: 355133

5 years ago[clang-tidy] add OverrideMacro to modernize-use-override check
Paul Hoad [Thu, 28 Feb 2019 20:00:48 +0000 (20:00 +0000)]
[clang-tidy] add OverrideMacro to modernize-use-override check

Summary:
The usefulness of **modernize-use-override** can be reduced if you have to live in an environment where you support multiple compilers, some of which sadly are not yet fully C++11 compliant

some codebases have to use override as a macro OVERRIDE e.g.

```
// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
```

This allows code to be compiled with C++11 compliant compilers and get warnings and errors that clang, MSVC,gcc can give, while still allowing other legacy pre C++11 compilers to compile the code. This can be an important step towards modernizing C++ code whilst living in a legacy codebase.

When it comes to clang tidy, the use of the **modernize-use-override** is one of the most useful checks, but the messages reported are inaccurate for that codebase if the standard approach is to use the macros OVERRIDE and/or FINAL.

When combined with fix-its that introduce the C++11 override keyword, they become fatal, resulting in the modernize-use-override check being turned off to prevent the introduction of such errors.

This revision, allows the possibility for the replacement **override **to be a macro instead, Allowing the clang-tidy check to be run on  both pre and post C++11 code, and allowing fix-its to be applied.

Reviewers: alexfh, JonasToth, hokein, Eugene.Zelenko, aaron.ballman

Reviewed By: alexfh, JonasToth

Subscribers: lewmpk, malcolm.parsons, jdoerfert, xazax.hun, cfe-commits, llvm-commits

Tags: #clang-tools-extra

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

llvm-svn: 355132

5 years ago[PGO] Context sensitive PGO (part 2)
Rong Xu [Thu, 28 Feb 2019 19:55:07 +0000 (19:55 +0000)]
[PGO] Context sensitive PGO (part 2)

Part 2 of CSPGO changes (mostly related to ProfileSummary).
Note that I use a default parameter in setProfileSummary() and getSummary().
This is to break the dependency in clang. I will make the parameter explicit
after changing clang in a separated patch.

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

llvm-svn: 355131

5 years ago[x86] scalarize extract element 0 of FP math
Sanjay Patel [Thu, 28 Feb 2019 19:47:04 +0000 (19:47 +0000)]
[x86] scalarize extract element 0 of FP math

This is another step towards ensuring that we produce the optimal code for reductions,
but there are other potential benefits as seen in the tests diffs:

  1. Memory loads may get scalarized resulting in more efficient code.
  2. Memory stores may get scalarized resulting in more efficient code.
  3. Complex ops like fdiv/sqrt get scalarized which may be faster instructions depending on uarch.
  4. Even simple ops like addss/subss/mulss/roundss may result in faster operation/less frequency throttling when scalarized depending on uarch.

The TODO comment suggests 1 or more follow-ups for opcodes that can currently result in regressions.

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

llvm-svn: 355130

5 years agoRevert "Revert "[sanitizers] Restore internal_readlink for x32""
H.J. Lu [Thu, 28 Feb 2019 19:34:01 +0000 (19:34 +0000)]
Revert "Revert "[sanitizers] Restore internal_readlink for x32""

This reverts revision 354601 and disables ReadBinaryNameCached check on
Windows since Windows has no working ReadBinaryName.

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

llvm-svn: 355129

5 years ago[Sanitizer] lit test config: Respect existing parallelism_group
Julian Lettner [Thu, 28 Feb 2019 19:26:53 +0000 (19:26 +0000)]
[Sanitizer] lit test config: Respect existing parallelism_group

llvm-svn: 355128

5 years agobpf: disassembler support for XADD under sub-register mode
Jiong Wang [Thu, 28 Feb 2019 19:22:34 +0000 (19:22 +0000)]
bpf: disassembler support for XADD under sub-register mode

Like the other load/store instructions, "w" register is preferred when
disassembling BPF_STX | BPF_W | BPF_XADD.

v1 -> v2:
 - Updated testcase insn-unit.s (Yonghong)

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 355127

5 years agobpf: enable sub-register code-gen for XADD
Jiong Wang [Thu, 28 Feb 2019 19:21:28 +0000 (19:21 +0000)]
bpf: enable sub-register code-gen for XADD

Support sub-register code-gen for XADD is like supporting any other Load
and Store patterns.

No new instruction is introduced.

  lock *(u32 *)(r1 + 0) += w2

has exactly the same underlying insn as:

  lock *(u32 *)(r1 + 0) += r2

BPF_W width modifier has guaranteed they behave the same at runtime. This
patch merely teaches BPF back-end that BPF_W width modifier could work
GPR32 register class and that's all needed for sub-register code-gen
support for XADD.

test/CodeGen/BPF/xadd.ll updated to include sub-register code-gen tests.

A new testcase test/CodeGen/BPF/xadd_legal.ll is added to make sure the
legal case could pass on all code-gen modes. It could also test dead Def
check on GPR32. If there is no proper handling like what has been done
inside BPFMIChecking.cpp:hasLivingDefs, then this testcase will fail.

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 355126

5 years ago[sanitizer] Fix vfork interceptor on i386 w/ dynamic runtime.
Evgeniy Stepanov [Thu, 28 Feb 2019 19:21:25 +0000 (19:21 +0000)]
[sanitizer] Fix vfork interceptor on i386 w/ dynamic runtime.

PLT calls on i386 expect GOT base address in %ebx.
This call does not need to go through PLT strictly speaking, but I'd
rather avoid future surprises and implement the most general case.

llvm-svn: 355125

5 years agobpf: improve dead Defs check for XADD
Jiong Wang [Thu, 28 Feb 2019 19:20:26 +0000 (19:20 +0000)]
bpf: improve dead Defs check for XADD

BPF XADD semantics require all Defs of XADD are dead, meaning any result of
XADD insn is not used.

However, BPF backend hasn't enabled sub-register liveness track, so when
the source and destination operands of XADD are GPR32, there is no
sub-register dead info. If we rely on the generic
MachineInstr::allDefsAreDead, then we will raise false alarm on GPR32 Def.
This was fine as there was no sub-register code-gen support for XADD which
will be added by the next patch.

To support GPR32 Def, ideally we could just enable sub-registr liveness
track on BPF backend, then allDefsAreDead could work on GPR32 Def. This
requires implementing TargetSubtargetInfo::enableSubRegLiveness on BPF.

However, sub-register liveness tracking module inside LLVM is actually
designed for the situation where one register could be split into more
than one sub-registers for which case each sub-register could have their
own liveness and kill one of them doesn't kill others. So, tracking
liveness for each make sense.

For BPF, each 64-bit register could only have one 32-bit sub-register. This
is exactly the case which LLVM think brings no benefits for doing
sub-register tracking, because the live range of sub-register must always
equal to its parent register, therefore liveness tracking is disabled even
the back-end has implemented enableSubRegLiveness. The detailed information
is at r232695:

  Author: Matthias Braun <matze@braunis.de>
  Date:   Thu Mar 19 00:21:58 2015 +0000
  Do not track subregister liveness when it brings no benefits

Hence, for BPF, we enhance MachineInstr::allDefsAreDead. Given the solo
sub-register always has the same liveness as its parent register, LLVM is
already attaching a implicit 64-bit register Def whenever the there is
a sub-register Def. The liveness of the implicit 64-bit Def is available.
For example, for "lock *(u32 *)(r0 + 4) += w9", the MachineOperand info
could be:

  $w9 = XADDW32 killed $r0, 4, $w9(tied-def 0),
                       implicit killed $r9, implicit-def dead $r9

Even though w9 is not marked as Dead, the parent register r9 is marked as
Dead correctly, and it is safe to use such information or our purpose.

v1 -> v2:
 - Simplified code logic inside hasLiveDefs. (Yonghong)

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 355124

5 years ago[clang-format][NFC] Allow getLLVMStyle() to take a language
Jordan Rupprecht [Thu, 28 Feb 2019 19:16:45 +0000 (19:16 +0000)]
[clang-format][NFC] Allow getLLVMStyle() to take a language

Summary:
getLLVMStyle() sets the default style, but doesn't take the language as a parameter, so can't set default parameters when they differ from C++. This change adds LanguageKind as an input to getLLVMStyle so that we can start doing that.

See D55964 as a motivation for this, where we want Tablegen to be formatted differently than C++.

Reviewers: djasper, krasimir, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: jdoerfert, MyDeveloperDay, kristina, cfe-commits, arphaman

Tags: #clang

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

llvm-svn: 355123

5 years agoAdd Support for Creating and Deleting Unicode Files and Directories in Lit
Serge Guelton [Thu, 28 Feb 2019 19:16:17 +0000 (19:16 +0000)]
Add Support for Creating and Deleting Unicode Files and Directories in Lit

This enables lit to work with unicode file names via mkdir, rm, and redirection.
Lit still uses utf-8 internally, but converts to utf-16 on Windows, or just utf-8
bytes on everything else.

Committed on behalf of Jason Mittertreiner
Differential Revision: https://reviews.llvm.org/D56754

llvm-svn: 355122

5 years agoImprove process launch comments for Windows
Adrian McCarthy [Thu, 28 Feb 2019 19:14:02 +0000 (19:14 +0000)]
Improve process launch comments for Windows

The existing comment about over-allocating the command line was incorrect.  The
contents of the command line may be changed, but it's not necessary to over
allocate.  The changes will be limited to the existing contents of the string
(e.g., by replacing spaces with L'\0' to tokenize the command line).

Also added a comment explaining a possible cause of failure to save the next
programmer some time when they try to debug a 64-bit process from a 32-bit
LLDB.

llvm-svn: 355121

5 years ago[OpenMP] Make use of sched_yield optional in runtime
Jonathan Peyton [Thu, 28 Feb 2019 19:11:29 +0000 (19:11 +0000)]
[OpenMP] Make use of sched_yield optional in runtime

This patch cleans up the yielding code and makes it optional. An
environment variable, KMP_USE_YIELD, was added. Yielding is still
on by default (KMP_USE_YIELD=1), but can be turned off completely
(KMP_USE_YIELD=0), or turned on only when oversubscription is detected
(KMP_USE_YIELD=2). Note that oversubscription cannot always be detected
by the runtime (for example, when the runtime is initialized and the
process forks, oversubscription cannot be detected currently over
multiple instances of the runtime).

Because yielding can be controlled by user now, the library mode
settings (from KMP_LIBRARY) for throughput and turnaround have been
adjusted by altering blocktime, unless that was also explicitly set.

In the original code, there were a number of places where a double yield
might have been done under oversubscription. This version checks
oversubscription and if that's not going to yield, then it does
the spin check.

Patch by Terry Wilmarth

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

llvm-svn: 355120

5 years ago[PGO] Update InstrProfData.inc to sync with llvm
Rong Xu [Thu, 28 Feb 2019 19:06:02 +0000 (19:06 +0000)]
[PGO] Update InstrProfData.inc to sync with llvm

llvm-svn: 355119

5 years ago[InstCombine] fold adds of constants separated by sext/zext
Sanjay Patel [Thu, 28 Feb 2019 19:05:26 +0000 (19:05 +0000)]
[InstCombine] fold adds of constants separated by sext/zext

This is part of a transform that may be done in the backend:
D13757
...but it should always be beneficial to fold this sooner in IR
for all targets.

https://rise4fun.com/Alive/vaiW

  Name: sext add nsw
  %add = add nsw i8 %i, C0
  %ext = sext i8 %add to i32
  %r = add i32 %ext, C1
  =>
  %s = sext i8 %i to i32
  %r = add i32 %s, sext(C0)+C1

  Name: zext add nuw
  %add = add nuw i8 %i, C0
  %ext = zext i8 %add to i16
  %r = add i16 %ext, C1
  =>
  %s = zext i8 %i to i16
  %r = add i16 %s, zext(C0)+C1

llvm-svn: 355118

5 years ago[X86] Add test case that was supposed to go with r355116.
Craig Topper [Thu, 28 Feb 2019 18:50:16 +0000 (18:50 +0000)]
[X86] Add test case that was supposed to go with r355116.

llvm-svn: 355117

5 years ago[X86] Don't peek through bitcasts before checking ISD::isBuildVectorOfConstantSDNodes...
Craig Topper [Thu, 28 Feb 2019 18:49:29 +0000 (18:49 +0000)]
[X86] Don't peek through bitcasts before checking ISD::isBuildVectorOfConstantSDNodes in combineTruncatedArithmetic

We don't have any combines that can look through a bitcast to truncate a build vector of constants. So the truncate will stick around and give us something like this pattern (binop (trunc X), (trunc (bitcast (build_vector)))) which has two truncates in it. Which will be reversed by hoistLogicOpWithSameOpcodeHands in the generic DAG combiner. Thus causing an infinite loop.

Even if we had a combine for (truncate (bitcast (build_vector))), I think it would need to be implemented in getNode otherwise DAG combiner visit ordering would probably still visit the binop first and reverse it. Or combineTruncatedArithmetic would need to do its own constant folding.

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

llvm-svn: 355116

5 years agoRevert "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1."
Amara Emerson [Thu, 28 Feb 2019 18:47:29 +0000 (18:47 +0000)]
Revert "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1."

Seems to break some neon intrinsics tests.

llvm-svn: 355115

5 years ago[dsymutil] Use rfind for paths with parentheses
Jonas Devlieghere [Thu, 28 Feb 2019 18:46:04 +0000 (18:46 +0000)]
[dsymutil] Use rfind for paths with parentheses

Dsymutil gets library member information is through the ambiguous
/path/to/archive.a(member.o). The current logic we use would get
confused by additional parentheses. Using rfind mitigates this issue.

llvm-svn: 355114

5 years ago[NFC][Sanitizer] Weak linkage is not available on Windows
Julian Lettner [Thu, 28 Feb 2019 18:42:14 +0000 (18:42 +0000)]
[NFC][Sanitizer] Weak linkage is not available on Windows

The concept of weak linkage is not available on Windows. The available
workarounds in LLVM/sanitizer runtimes have their own problems. Define a
separte symbol ubsan_GetStackTrace to work around the issue now. At lest
this way it is painfully obvious that we still have to do more cleanup.

Follow-up to revision: https://reviews.llvm.org/D58651

llvm-svn: 355113

5 years ago[WebAssembly] Remove uses of ThreadModel
Thomas Lively [Thu, 28 Feb 2019 18:39:08 +0000 (18:39 +0000)]
[WebAssembly] Remove uses of ThreadModel

Summary:
In the clang UI, replaces -mthread-model posix with -matomics as the
source of truth on threading. In the backend, replaces
-thread-model=posix with the atomics target feature, which is now
collected on the WebAssemblyTargetMachine along with all other used
features. These collected features will also be used to emit the
target features section in the future.

The default configuration for the backend is thread-model=posix and no
atomics, which was previously an invalid configuration. This change
makes the default valid because the thread model is ignored.

A side effect of this change is that objects are never emitted with
passive segments. It will instead be up to the linker to decide
whether sections should be active or passive based on whether atomics
are used in the final link.

Reviewers: aheejin, sbc100, dschuff

Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, steven_wu, dexonsmith, rupprecht, jfb, jdoerfert, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 355112

5 years ago[Tests] Strengthen LICM test corpus to show alignment striping. (part 2)
Philip Reames [Thu, 28 Feb 2019 18:17:51 +0000 (18:17 +0000)]
[Tests] Strengthen LICM test corpus to show alignment striping. (part 2)

This should have been part of r355110, but my brain isn't quite awake yet, despite the coffee.  Per the original submit comment... Doing scalar promotion w/o being able to prove the alignment of the hoisted load or sunk store is a bug.  Update tests to actually show the alignment so that impact of the patch which fixes this can be seen.

llvm-svn: 355111

5 years ago[Tests] Strengthen LICM test corpus to show alignment striping
Philip Reames [Thu, 28 Feb 2019 18:08:04 +0000 (18:08 +0000)]
[Tests] Strengthen LICM test corpus to show alignment striping

Doing scalar promotion w/o being able to prove the alignment of the hoisted load or sunk store is a bug.  Update tests to actually show the alignment so that impact of the patch which fixes this can be seen.

llvm-svn: 355110

5 years ago[ValueTracking] More accurate unsigned sub overflow detection
Nikita Popov [Thu, 28 Feb 2019 18:04:20 +0000 (18:04 +0000)]
[ValueTracking] More accurate unsigned sub overflow detection

Second part of D58593.

Compute precise overflow conditions based on all known bits, rather
than just the sign bits. Unsigned a - b overflows iff a < b, and we
can determine whether this always/never happens based on the minimal
and maximal values achievable for a and b subject to the known bits
constraint.

llvm-svn: 355109

5 years ago[clang-tidy] fix documentation link in list of clang-tidy checks
Jonas Toth [Thu, 28 Feb 2019 17:53:51 +0000 (17:53 +0000)]
[clang-tidy] fix documentation link in list of clang-tidy checks

llvm-svn: 355108

5 years agollvm-config: Include -stdlib= in --cxxflags
Tom Stellard [Thu, 28 Feb 2019 17:31:59 +0000 (17:31 +0000)]
llvm-config: Include -stdlib= in --cxxflags

Summary:
This was removed in r349068, but it is needed when llvm is compiled
using the non-default c++ standard library on a platform.

Reviewers: sylvestre.ledru, infinity0, mgorny, cuviper

Reviewed By: sylvestre.ledru

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355107

5 years agoPartial revert of r353952: [HIP] Handle compile -m options and propagate into LLC
Yaxun Liu [Thu, 28 Feb 2019 17:08:26 +0000 (17:08 +0000)]
Partial revert of r353952: [HIP] Handle compile -m options and propagate into LLC

Remove comments and tests about passing -mcode-object-v3 to driver since it does
not work. Other -m options are OK.

Also put back -mattr=-code-object-v3 since HIP is still not ready for code object
v3.

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

llvm-svn: 355106

5 years agoMake MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates
Chijun Sima [Thu, 28 Feb 2019 16:47:18 +0000 (16:47 +0000)]
Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates

Summary:
It is mentioned in the document of DTU that "It is illegal to submit any update that has already been submitted, i.e., you are supposed not to insert an existent edge or delete a nonexistent edge." It is dangerous to violet this rule because DomTree and PostDomTree occasionally crash on this scenario.

This patch fixes `MergeBlockIntoPredecessor`, making it conformant to this precondition.

Reviewers: kuhar, brzycki, chandlerc

Reviewed By: brzycki

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 355105

5 years ago[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1.
Amara Emerson [Thu, 28 Feb 2019 16:43:11 +0000 (16:43 +0000)]
[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1.

This extends the existing support for shufflevector to handle cases like
<2 x float>, which we can implement by concating the vectors and using a TBL1.

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

llvm-svn: 355104

5 years ago[cmake] Move LLDB_DISABLE_LIBEDIT handling code into a central place
Pavel Labath [Thu, 28 Feb 2019 16:04:54 +0000 (16:04 +0000)]
[cmake] Move LLDB_DISABLE_LIBEDIT handling code into a central place

This was previously scattered between the main CMakeLists.txt file and
LLDBGenerateConfig.cmake and LLDBConfig.cmake. This caused the some of
the code to be executed in incorrect order. Specifically, the check for
el_winsertstr was done before libedit_LIBRARIES was computed, and so it
always failed on the first run.

Moving it the two checks to a central place makes sure this doesn't
happen again and improves the overall readability.

llvm-svn: 355103

5 years ago[clang-tidy] redirection in list of checks adjusted
Jonas Toth [Thu, 28 Feb 2019 15:56:40 +0000 (15:56 +0000)]
[clang-tidy] redirection in list of checks adjusted

llvm-svn: 355102

5 years ago[Target][ARM] Add a usage for SrcSz to unbreak build-bots without assertions
Kadir Cetinkaya [Thu, 28 Feb 2019 15:55:11 +0000 (15:55 +0000)]
[Target][ARM] Add a usage for SrcSz to unbreak build-bots without assertions

llvm-svn: 355101

5 years ago[clang-tidy] include cppcoreguidelines-explicit-virtual-functions in list of checks...
Jonas Toth [Thu, 28 Feb 2019 15:47:10 +0000 (15:47 +0000)]
[clang-tidy] include cppcoreguidelines-explicit-virtual-functions in list of checks and fix redirection

llvm-svn: 355100

5 years agoAdd support for computing "zext of value" in KnownBits. NFCI
Bjorn Pettersson [Thu, 28 Feb 2019 15:45:29 +0000 (15:45 +0000)]
Add support for computing "zext of value" in KnownBits. NFCI

Summary:
The description of KnownBits::zext() and
KnownBits::zextOrTrunc() has confusingly been telling
that the operation is equivalent to zero extending the
value we're tracking. That has not been true, instead
the user has been forced to explicitly set the extended
bits as known zero afterwards.

This patch adds a second argument to KnownBits::zext()
and KnownBits::zextOrTrunc() to control if the extended
bits should be considered as known zero or as unknown.

Reviewers: craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: javed.absar, hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355099

5 years ago[clang-tidy] documentation fixing the actual correct file
Jonas Toth [Thu, 28 Feb 2019 15:39:47 +0000 (15:39 +0000)]
[clang-tidy] documentation fixing the actual correct file

llvm-svn: 355098

5 years ago[clang-tidy] tryfix documenation continued
Jonas Toth [Thu, 28 Feb 2019 15:28:36 +0000 (15:28 +0000)]
[clang-tidy] tryfix documenation continued

llvm-svn: 355097

5 years ago[CTU] Do not allow different CPP dialects in CTU
Gabor Marton [Thu, 28 Feb 2019 15:24:59 +0000 (15:24 +0000)]
[CTU] Do not allow different CPP dialects in CTU

Summary:
If CPP dialects are different then return with error.

Consider this STL code:
  template<typename _Alloc>
    struct __alloc_traits
  #if __cplusplus >= 201103L
    : std::allocator_traits<_Alloc>
  #endif
    { // ...
    };
This class template would create ODR errors during merging the two units,
since in one translation unit the class template has a base class, however
in the other unit it has none.

Reviewers: xazax.hun, a_sidorin, r.stahl

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

Tags: #clang

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

llvm-svn: 355096

5 years ago[clang-tidy] another issue in documentation, double empty line seemed to confuse...
Jonas Toth [Thu, 28 Feb 2019 15:18:54 +0000 (15:18 +0000)]
[clang-tidy] another issue in documentation, double empty line seemed to confuse code-block

llvm-svn: 355095

5 years ago[clang-tidy] attempt to fix documentation build-error
Jonas Toth [Thu, 28 Feb 2019 15:01:17 +0000 (15:01 +0000)]
[clang-tidy] attempt to fix documentation build-error

llvm-svn: 355094

5 years ago[clang-tidy] added cppcoreguidelines-explicit-virtual-functions
Jonas Toth [Thu, 28 Feb 2019 14:55:12 +0000 (14:55 +0000)]
[clang-tidy] added cppcoreguidelines-explicit-virtual-functions

Addresses the bugzilla bug #30397. (https://bugs.llvm.org/show_bug.cgi?id=30397)
modernize-use-override suggests that destructors require the override specifier
and the CPP core guidelines do not recommend this.

Patch by lewmpk.

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

llvm-svn: 355093

5 years agoAdded missing license headers
Dmitri Gribenko [Thu, 28 Feb 2019 14:01:11 +0000 (14:01 +0000)]
Added missing license headers

Reviewers: ioeric

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355092

5 years agoUse ArrayRef::copy, instead of copying data manually
Dmitri Gribenko [Thu, 28 Feb 2019 14:00:26 +0000 (14:00 +0000)]
Use ArrayRef::copy, instead of copying data manually

Reviewers: ioeric

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355091

5 years agoMoved Ref into its own header and implementation file
Dmitri Gribenko [Thu, 28 Feb 2019 13:49:25 +0000 (13:49 +0000)]
Moved Ref into its own header and implementation file

Reviewers: ioeric

Subscribers: mgorny, jkorous, mgrang, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355090

5 years ago[clang-tidy] bugprone-string-integer-assignment: Reduce false positives.
Clement Courbet [Thu, 28 Feb 2019 13:39:01 +0000 (13:39 +0000)]
[clang-tidy] bugprone-string-integer-assignment: Reduce false positives.

Summary: Detect a few expressions as likely character expressions, see PR27723.

Reviewers: xazax.hun, alexfh

Subscribers: rnkovacs, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355089

5 years agoMoved Symbol into its own header and implementation file
Dmitri Gribenko [Thu, 28 Feb 2019 13:23:03 +0000 (13:23 +0000)]
Moved Symbol into its own header and implementation file

Reviewers: ioeric

Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355088

5 years ago[PowerPC] Removed STATISTIC that was causing build errors.
Stefan Pintilie [Thu, 28 Feb 2019 12:40:28 +0000 (12:40 +0000)]
[PowerPC] Removed STATISTIC that was causing build errors.

llvm-svn: 355087

5 years agoMoved SymbolOrigin into its own header and implementation file
Dmitri Gribenko [Thu, 28 Feb 2019 12:31:49 +0000 (12:31 +0000)]
Moved SymbolOrigin into its own header and implementation file

Reviewers: ioeric

Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355086

5 years ago[PowerPC] Move the stack pointer update instruction later in the prologue and earlier...
Stefan Pintilie [Thu, 28 Feb 2019 12:23:28 +0000 (12:23 +0000)]
[PowerPC] Move the stack pointer update instruction later in the prologue and earlier in the epilogue.

Move the stdu instruction in the prologue and epilogue.
This should provide a small performance boost in functions that are able to do
this. I've kept this change rather conservative at the moment and functions
with frame pointers or base pointers will not try to move the stack pointer
update.

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

llvm-svn: 355085

5 years ago[X86][AVX] Remove superfluous insert_subvector(zero, bitcast(x)) -> bitcast(insert_su...
Simon Pilgrim [Thu, 28 Feb 2019 11:39:52 +0000 (11:39 +0000)]
[X86][AVX] Remove superfluous insert_subvector(zero, bitcast(x)) -> bitcast(insert_subvector(zero, x)) fold

This is caught by other existing bitcast folds.

llvm-svn: 355084

5 years ago[ARM GlobalISel] Make arm_i32imm an IntImmLeaf
Diana Picus [Thu, 28 Feb 2019 11:13:05 +0000 (11:13 +0000)]
[ARM GlobalISel] Make arm_i32imm an IntImmLeaf

This gets rid of some duplication in the TableGen definition, but it
forces us to keep both a pointer and a reference to the subtarget in the
ARMInstructionSelector. That is pretty ugly but it might be a reasonable
trade-off, since the TableGen descriptions should outlive the code in
the selector (or in the worst case we can update to use just the
reference when we get rid of DAGISel).

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

llvm-svn: 355083

5 years agoMoved SymbolLocation into its own header and implementation file
Dmitri Gribenko [Thu, 28 Feb 2019 11:02:01 +0000 (11:02 +0000)]
Moved SymbolLocation into its own header and implementation file

Reviewers: ioeric

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

Tags: #clang

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

llvm-svn: 355082

5 years agoMoved DenseMap support for SymbolID into SymbolID.h
Dmitri Gribenko [Thu, 28 Feb 2019 11:00:44 +0000 (11:00 +0000)]
Moved DenseMap support for SymbolID into SymbolID.h

llvm-svn: 355081

5 years agoFixed typos in a test: s/CEHCK/CHECK/
Dmitri Gribenko [Thu, 28 Feb 2019 10:58:13 +0000 (10:58 +0000)]
Fixed typos in a test: s/CEHCK/CHECK/

Reviewers: ilya-biryukov, serge-sans-paille

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 355080

5 years agoFixed a typo in the test s/CEHCK/CHECK/
Dmitri Gribenko [Thu, 28 Feb 2019 10:56:39 +0000 (10:56 +0000)]
Fixed a typo in the test s/CEHCK/CHECK/

Summary:
Turns out the test was not correct, I had to adjust the test to work.  I
also added CHECK-LABELs for better error messages from FileCheck while
I'm here.

Reviewers: jsji

Subscribers: nemanjai, eraman, llvm-commits

Tags: #llvm

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

llvm-svn: 355079

5 years ago[X86][AVX] Fold vf64 concat_vectors(movddup(x),movddup(x)) -> broadcast(x)
Simon Pilgrim [Thu, 28 Feb 2019 10:53:58 +0000 (10:53 +0000)]
[X86][AVX] Fold vf64 concat_vectors(movddup(x),movddup(x)) -> broadcast(x)

llvm-svn: 355078

5 years ago[ARM GlobalISel] Support global variables for Thumb2
Diana Picus [Thu, 28 Feb 2019 10:42:47 +0000 (10:42 +0000)]
[ARM GlobalISel] Support global variables for Thumb2

Add the same level of support as for ARM mode (i.e. still no TLS
support).

In most cases, it is sufficient to replace the opcodes with the
t2-equivalent, but there are some idiosyncrasies that I decided to
preserve because I don't understand the full implications:
* For ARM we use LDRi12 to load from constant pools, but for Thumb we
  use t2LDRpci (I'm not sure if the ideal would be to use t2LDRi12 for
  Thumb as well, or to use LDRcp for ARM).
* For Thumb we don't have an equivalent for MOV|LDRLIT_ga_pcrel_ldr, so
  we have to generate MOV|LDRLIT_ga_pcrel plus a load from GOT.

The tests are in separate files because they're hard enough to read even
without doubling the number of checks.

llvm-svn: 355077

5 years ago[clang-tidy] misc-string-integer-assignment: fix false positive
Clement Courbet [Thu, 28 Feb 2019 10:33:32 +0000 (10:33 +0000)]
[clang-tidy] misc-string-integer-assignment: fix false positive

Summary:
using CodePoint = uint32_t;
CodePoint cp;
basic_string<CodePoint> s;
s += cp;

See PR27723.

Reviewers: xazax.hun, alexfh

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

llvm-svn: 355076

5 years ago[LLD][ELF] - Stop using binary input in invalid/tls-symbol.s test. NFCI.
George Rimar [Thu, 28 Feb 2019 09:24:12 +0000 (09:24 +0000)]
[LLD][ELF] - Stop using binary input in invalid/tls-symbol.s test. NFCI.

We can use yaml2obj instead, patch does this.

llvm-svn: 355075