platform/upstream/llvm.git
6 years ago[PatternMatch] allow undef elements in vectors with m_Neg
Sanjay Patel [Sun, 1 Jul 2018 13:42:57 +0000 (13:42 +0000)]
[PatternMatch] allow undef elements in vectors with m_Neg

This is similar to the m_Not change from D44076.

llvm-svn: 336064

6 years ago[SLPVectorizer] Use InstructionsState Op/Alt opcodes directly. NFCI.
Simon Pilgrim [Sun, 1 Jul 2018 13:41:58 +0000 (13:41 +0000)]
[SLPVectorizer] Use InstructionsState Op/Alt opcodes directly. NFCI.

llvm-svn: 336063

6 years ago[UnrollAndJam] New Unroll and Jam pass
David Green [Sun, 1 Jul 2018 12:47:30 +0000 (12:47 +0000)]
[UnrollAndJam] New Unroll and Jam pass

This is a simple implementation of the unroll-and-jam classical loop
optimisation.

The basic idea is that we take an outer loop of the form:

  for i..
    ForeBlocks(i)
    for j..
      SubLoopBlocks(i, j)
    AftBlocks(i)

Instead of doing normal inner or outer unrolling, we unroll as follows:

  for i... i+=2
    ForeBlocks(i)
    ForeBlocks(i+1)
    for j..
      SubLoopBlocks(i, j)
      SubLoopBlocks(i+1, j)
    AftBlocks(i)
    AftBlocks(i+1)
  Remainder Loop

So we have unrolled the outer loop, then jammed the two inner loops into
one. This can lead to a simpler inner loop if memory accesses can be shared
between the now jammed loops.

To do this we have to prove that this is all safe, both for the memory
accesses (using dependence analysis) and that ForeBlocks(i+1) can move before
AftBlocks(i) and SubLoopBlocks(i, j).

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

llvm-svn: 336062

6 years agoRevert "[llvm-readobj] Fix printing format"
Paul Semel [Sun, 1 Jul 2018 11:54:09 +0000 (11:54 +0000)]
Revert "[llvm-readobj] Fix printing format"

There is a problem with the formatting on windows build.
I need to investigate on this.

llvm-svn: 336061

6 years ago[SLPVectorizer][X86] Add some alternate tests for cast operators
Simon Pilgrim [Sun, 1 Jul 2018 11:29:46 +0000 (11:29 +0000)]
[SLPVectorizer][X86] Add some alternate tests for cast operators

Alternate opcode handling only supports binary operators, these tests demonstrate missed opportunities to vectorize some sitofp/uitofp and fptosi/fptoui style casts as well as some (successful) float bits manipulations

llvm-svn: 336060

6 years ago[Evaluator] Improve evaluation of call instruction
Eugene Leviant [Sun, 1 Jul 2018 11:02:07 +0000 (11:02 +0000)]
[Evaluator] Improve evaluation of call instruction

Recommit of r335324 after buildbot failure fix

llvm-svn: 336059

6 years ago[llvm-readobj] Fix printing format
Paul Semel [Sun, 1 Jul 2018 09:51:59 +0000 (09:51 +0000)]
[llvm-readobj] Fix printing format

We were printing every character, even those that weren't printable. It
doesn't really make sense for this option.

The string content was sticked to its address, added two spaces in
between.

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

llvm-svn: 336058

6 years ago[X86] Remove unnecessary include. NFC
Craig Topper [Sun, 1 Jul 2018 05:54:22 +0000 (05:54 +0000)]
[X86] Remove unnecessary include. NFC

Leftover from when the pass contained a DenseMap before it switched to binary search.

llvm-svn: 336057

6 years ago[X86] Move the memory unfolding table creation into its own class and make it a Manag...
Craig Topper [Sun, 1 Jul 2018 05:47:49 +0000 (05:47 +0000)]
[X86] Move the memory unfolding table creation into its own class and make it a ManagedStatic.

Also move the static folding tables, their search functions and the new class into new cpp/h files.

The unfolding table is effectively static data. It's just a different ordering and a subset of the static folding tables.

By putting it in a separate ManagedStatic we ensure we only have one copy instead of one per X86InstrInfo object. This way also makes it only get initialized when really needed.

llvm-svn: 336056

6 years ago[X86] Move the X86InstrFMA3Info class into the cpp file. Expose only a getFMA3Group...
Craig Topper [Sat, 30 Jun 2018 22:38:42 +0000 (22:38 +0000)]
[X86] Move the X86InstrFMA3Info class into the cpp file. Expose only a getFMA3Group free function. NFCI

The class only exists to hold a DenseMap and is only created as a ManagedStatic. It used to expose a single static method that outside code was expected to use.

This patch moves that static function out of the class and moves it implementation into the cpp file. It can now access the ManagedStatic directly by name without the need for the other static method that accessed the ManagedStatic.

llvm-svn: 336055

6 years ago[X86] Remove the AsmName from the HAX,HDX,HCX,HBX,HSI,HDI,HBP,HSP,HIP artificial...
Craig Topper [Sat, 30 Jun 2018 22:38:41 +0000 (22:38 +0000)]
[X86] Remove the AsmName from the HAX,HDX,HCX,HBX,HSI,HDI,HBP,HSP,HIP artificial registers so they can't be parsed by the assembly parser.

There are no instructions that use them so they weren't causing any bad matches. But they weren't being diagnosed as "invalid register name" if they were used and would instead trigger some form of invalid operand.

llvm-svn: 336054

6 years ago[UBsan] Enable subset of unit tests for OpenBSD
David Carlier [Sat, 30 Jun 2018 21:35:05 +0000 (21:35 +0000)]
[UBsan] Enable subset of unit tests for OpenBSD

Reviewers: kubamracek, krytarowski

Reviewed By: krytarowski

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

llvm-svn: 336053

6 years ago[X86] Use MVT::i8 for scalar shift amounts since that is what they ultimately need...
Craig Topper [Sat, 30 Jun 2018 18:30:31 +0000 (18:30 +0000)]
[X86] Use MVT::i8 for scalar shift amounts since that is what they ultimately need to legalize to.

I believe all of these are constants so legalizing them should be pretty trivial, but this saves a step.

In one case it looks like we may have been creating a shift amount larger than the shift input itself.

llvm-svn: 336052

6 years ago[X86] When combining load to BZHI, make sure we create the shift instruction with...
Craig Topper [Sat, 30 Jun 2018 17:49:42 +0000 (17:49 +0000)]
[X86] When combining load to BZHI, make sure we create the shift instruction with an i8 type.

This combine runs pretty late and causes us to introduce a shift after the op legalization phase has run. We need to be sure we create the shift with the proper type for the shift amount. If we don't do this, we will still re-legalize the operation properly, but we won't get a chance to fully optimize the truncate that gets inserted.

So this patch adds the necessary truncate when the shift is created. I've also narrowed the subtract that gets created to always be an i32 type. The truncate would have trigered SimplifyDemandedBits to optimize it anyway. But using a more appropriate VT here is free and saves an optimization step.

llvm-svn: 336051

6 years ago[InstCombine] add tests for negate vector with undef elts; NFC
Sanjay Patel [Sat, 30 Jun 2018 14:11:46 +0000 (14:11 +0000)]
[InstCombine] add tests for negate vector with undef elts; NFC

llvm-svn: 336050

6 years agoFix Wdocumentation compiler warning. NFCI.
Simon Pilgrim [Sat, 30 Jun 2018 12:24:23 +0000 (12:24 +0000)]
Fix Wdocumentation compiler warning. NFCI.

llvm-svn: 336049

6 years ago[DAGCombiner] Handle correctly non-splat power of 2 -1 divisor (PR37119)
Simon Pilgrim [Sat, 30 Jun 2018 12:22:55 +0000 (12:22 +0000)]
[DAGCombiner] Handle correctly non-splat power of 2 -1 divisor (PR37119)

The combine added in commit 329525 overlooked the case where one, but not all, of the divisor elements is -1, -1 is the only power of two value for which the sdiv expansion recipe breaks.

Thanks to @zvi for the original patch.

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

llvm-svn: 336048

6 years agoAdd expected fail triple x86_64-pc-windows-gnu to test as x86_64-w64-mingw32 is alrea...
Yaron Keren [Sat, 30 Jun 2018 11:18:44 +0000 (11:18 +0000)]
Add expected fail triple x86_64-pc-windows-gnu to test as x86_64-w64-mingw32 is already there

llvm-svn: 336047

6 years ago[asan] Use MADV_NOCORE for use_madv_dontdump on FreeBSD.
Fangrui Song [Sat, 30 Jun 2018 08:27:48 +0000 (08:27 +0000)]
[asan] Use MADV_NOCORE for use_madv_dontdump on FreeBSD.

Currently in FreeBSD 12.0-CURRENT with trunk clang+compiler-rt, faulty -fsanitize=address executable hangs at 'urdlck' state.

Ka Ho Ng has verified that by backporting this to llvm 6.0.1, with use_madv_dontdump=1, shadow memory is not dumped.

ASAN_OPTIONS=abort_on_error=1:disable_coredump=0:use_madv_dontdump=1 ./a

Reviewers: dimitry, kcc, dvyukov, emaste, khng300

Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 336046

6 years ago[X86] Update some avx512 fast-isel tests to match their real clang IRgen.
Craig Topper [Sat, 30 Jun 2018 07:25:29 +0000 (07:25 +0000)]
[X86] Update some avx512 fast-isel tests to match their real clang IRgen.

Especially of note was the test_mm_mask_set1_epi64 and other set1 tests that were truncating the element to be broadcasted to i8 and broadcasting that instead of a whole 64 bit value.

Some of the others were just correcting mask sizes on parameters due to bugs in the clang test case they were generated from that have now been fixed.

Some were converting i8 to <4 x i1>/<2 x i1> by truncating to i4/i2 and then bitcasting. But the clang codegen is bitcast to <8 x i1>, then extract to <4 x i1>/<2 x i1>. This is likely to incur less trouble from the integer type legalizer in the backend.

llvm-svn: 336045

6 years ago[X86] Change some chec-prefixes from X32 to X86 to match the FileCheck command line.
Craig Topper [Sat, 30 Jun 2018 06:45:10 +0000 (06:45 +0000)]
[X86] Change some chec-prefixes from X32 to X86 to match the FileCheck command line.

I think this test changed and these test cases were created around the same time and missed the change.

llvm-svn: 336044

6 years ago[X86] Remove test cases from avx512vl-intrinsics-fast-isel.ll for intrinsics that...
Craig Topper [Sat, 30 Jun 2018 06:45:09 +0000 (06:45 +0000)]
[X86] Remove test cases from avx512vl-intrinsics-fast-isel.ll for intrinsics that don't really exist in clang.

llvm-svn: 336043

6 years ago[X86] Correct the width of mask arguments in intrinsic headers and tests.
Craig Topper [Sat, 30 Jun 2018 06:05:17 +0000 (06:05 +0000)]
[X86] Correct the width of mask arguments in intrinsic headers and tests.

All of these found by grepping through IR from the builtin tests for extra trunc and zext/sext instructions that shouldn't have been there.

Some of these were real bugs where we lost bits from the user input:
_mm512_mask_broadcast_f32x8
_mm512_maskz_broadcast_f32x8
_mm512_mask_broadcast_i32x8
_mm512_maskz_broadcast_i32x8
_mm256_mask_cvtusepi16_storeu_epi8

llvm-svn: 336042

6 years agoAMDGPU/GlobalISel: Make IMPLICIT_DEF of all sizes < 512 legal.
Tom Stellard [Sat, 30 Jun 2018 04:09:44 +0000 (04:09 +0000)]
AMDGPU/GlobalISel: Make IMPLICIT_DEF of all sizes < 512 legal.

Summary:
We could split sizes that are not power of two into smaller sized
G_IMPLICIT_DEF instructions, but this ends up generating
G_MERGE_VALUES instructions which we then have to handle in the instruction
selector.  Since G_IMPLICIT_DEF is really a no-op it's easier just to
keep everything that can fit into a register legal.

Reviewers: arsenm

Reviewed By: arsenm

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

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

llvm-svn: 336041

6 years ago[MachineOutliner] Add support for target-default outlining.
Jessica Paquette [Sat, 30 Jun 2018 03:56:03 +0000 (03:56 +0000)]
[MachineOutliner] Add support for target-default outlining.

This adds functionality to the outliner that allows targets to
specify certain functions that should be outlined from by default.

If a target supports default outlining, then it specifies that in
its TargetOptions. In the case that it does, and the user hasn't
specified that they *never* want to outline, the outliner will
be added to the pass pipeline and will run on those default functions.

This is a preliminary patch for turning the outliner on by default
under -Oz for AArch64.

https://reviews.llvm.org/D48776

llvm-svn: 336040

6 years agoDriver: Add an explicit target to testcase from r336037
Tom Stellard [Sat, 30 Jun 2018 03:50:10 +0000 (03:50 +0000)]
Driver: Add an explicit target to testcase from r336037

llvm-svn: 336039

6 years agoDriver: Don't mix system tools with devtoolset tools on RHEL
Tom Stellard [Sat, 30 Jun 2018 02:55:54 +0000 (02:55 +0000)]
Driver: Don't mix system tools with devtoolset tools on RHEL

Summary:
On RHEL, devtoolset provides a more up-to-date toolchain than the base
install, and we want to make sure all the tools use are from the same
toolchain.

Reviewers: rsmith, bruno

Reviewed By: bruno

Subscribers: bruno, cfe-commits

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

llvm-svn: 336037

6 years ago[X86] Remove masking from the avx512 rotate builtins. Use a select builtin instead.
Craig Topper [Sat, 30 Jun 2018 01:32:14 +0000 (01:32 +0000)]
[X86] Remove masking from the avx512 rotate builtins. Use a select builtin instead.

llvm-svn: 336036

6 years ago[X86] Remove masking from avx512 rotate intrinsics. Use select in IR instead.
Craig Topper [Sat, 30 Jun 2018 01:32:04 +0000 (01:32 +0000)]
[X86] Remove masking from avx512 rotate intrinsics. Use select in IR instead.

llvm-svn: 336035

6 years ago[libc++abi] Look for __config instead of vector
Shoaib Meenai [Sat, 30 Jun 2018 01:25:47 +0000 (01:25 +0000)]
[libc++abi] Look for __config instead of vector

vector is a generic C++ header, whereas __config is libc++-specific, so
we can look for it instead to guarantee we're finding a libc++
installation. This was suggested by Eric in https://reviews.llvm.org/D48694.

This is less important now that we're limiting the header search to the
specified directories (which definitely shouldn't have any other C++
library's headers anyway), but it shouldn't hurt either. There's a
chance some other library could also be providing a __config header, so
there's still a trade-off there. It would be ideal if we could check for
the presence of both __config and vector in the same directory, but
there doesn't seem to be any easy way to do that in CMake.

llvm-svn: 336034

6 years ago[libc++abi] Limit libc++ header search to specified paths
Shoaib Meenai [Sat, 30 Jun 2018 01:04:50 +0000 (01:04 +0000)]
[libc++abi] Limit libc++ header search to specified paths

Right now, when libc++abi is locating libc++ headers, it specifies
several search locations, but it also doesn't prevent CMake from looking
for those headers in system directories. I don't know if this was
intentional or an oversight, but it has several issues:

* We're looking specifically for the vector header, which could just as
  easily be found in a libstdc++ (or other C++ library) installation.
* No system I know of places their C++ headers directly in system
  include directories (they're always under a C++ subdirectory), so the
  system search will never succeed.
* find_path searches system paths before the user-specified PATHS, so
  if some system does happen to have C++ headers in its system include
  directories, those headers will be preferred, which doesn't seem
  desirable.

It makes sense to me to limit this header search to the explicitly
specified paths (using NO_DEFAULT_PATH, as is done for the other
find_path call in this file), but I'm putting it up for review in case
there's some use case I'm not thinking of.

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

llvm-svn: 336032

6 years agoAdd protocol redefinition to the current scope/context
Bruno Cardoso Lopes [Sat, 30 Jun 2018 00:49:27 +0000 (00:49 +0000)]
Add protocol redefinition to the current scope/context

Not doing so causes the AST writter to assert since the decl in question
never gets emitted. This is fine when modules is not used, but otherwise
we need to serialize something other than garbage.

rdar://problem/39844933

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

llvm-svn: 336031

6 years ago[instsimplify] Move the instsimplify pass to use more obvious file names
Chandler Carruth [Fri, 29 Jun 2018 23:36:03 +0000 (23:36 +0000)]
[instsimplify] Move the instsimplify pass to use more obvious file names
and diretory.

Also cleans up all the associated naming to be consistent and removes
the public access to the pass ID which was unused in LLVM.

Also runs clang-format over parts that changed, which generally cleans
up a bunch of formatting.

This is in preparation for doing some internal cleanups to the pass.

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

llvm-svn: 336028

6 years agoFix test after S_PROCREF change.
Zachary Turner [Fri, 29 Jun 2018 22:41:16 +0000 (22:41 +0000)]
Fix test after S_PROCREF change.

Since the names are being hashed correctly now, enumerating them
returns them in a different order.  Update the test to reflect
that.

llvm-svn: 336027

6 years ago[CUDA] Make __host__/__device__ min/max overloads constexpr in C++14.
Justin Lebar [Fri, 29 Jun 2018 22:28:09 +0000 (22:28 +0000)]
[CUDA] Make __host__/__device__ min/max overloads constexpr in C++14.

Summary: Tests in a separate change to the test-suite.

Reviewers: rsmith, tra

Subscribers: lahwaacz, sanjoy, cfe-commits

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

llvm-svn: 336026

6 years ago[CUDA] Make min/max shims host+device.
Justin Lebar [Fri, 29 Jun 2018 22:27:56 +0000 (22:27 +0000)]
[CUDA] Make min/max shims host+device.

Summary:
Fixes PR37753: min/max can't be called from __host__ __device__
functions in C++14 mode.

Testcase in a separate test-suite commit.

Reviewers: rsmith

Subscribers: sanjoy, lahwaacz, cfe-commits

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

llvm-svn: 336025

6 years ago[CodeView] Correctly compute the name of S_PROCREF symbols.
Zachary Turner [Fri, 29 Jun 2018 22:19:02 +0000 (22:19 +0000)]
[CodeView] Correctly compute the name of S_PROCREF symbols.

We have a function which switches on the type of a symbol record
to return a hardcoded offset into the record that contains the
symbol name.  Not all symbols have names to begin with, and for
those records we return -1 for the offset.

Names are used for various things.  Importantly for this particular
bug, a hash of the record name is used as a key for certain hash
tables which are serialied into the PDB file.  One of these hash
tables is for the global symbol stream, which is basically a
collection of S_PROCREF symbols which contain the name of the
symbol, a module, and an address offset.

However, for S_PROCREF symbols, the function to return the offset
of the name was returning -1: basically it wasn't implemented.
As a result of this, all global symbols were hashing to the same
value, essentially it was as if every single global symbol's name
was the empty string.

This manifests in the VS debugger when you try to call a function
(global or member, doesn't matter) through the immediate window
and the debugger simply reports an error because it can't find the
function.  This makes perfect sense, because it is hashing the name
for real, looking in the global symbol hash table, and there is only
1 entry there which corresponds to a symbol whose name is the empty
string.

Fixing this fixes the MSVC debugger in this case.

llvm-svn: 336024

6 years ago[analyzer] [tests] Allow the tested project to specify it's own analyzer wrapper
George Karpenkov [Fri, 29 Jun 2018 22:05:32 +0000 (22:05 +0000)]
[analyzer] [tests] Allow the tested project to specify it's own analyzer wrapper

llvm-svn: 336023

6 years ago[analyzer] [tests] Fix 80 column violation in SATestBuild.py
George Karpenkov [Fri, 29 Jun 2018 22:05:13 +0000 (22:05 +0000)]
[analyzer] [tests] Fix 80 column violation in SATestBuild.py

llvm-svn: 336022

6 years agoPR33924: merge local declarations that have linkage of some kind within
Richard Smith [Fri, 29 Jun 2018 21:58:50 +0000 (21:58 +0000)]
PR33924: merge local declarations that have linkage of some kind within
merged function definitions; also merge functions with deduced return
types.

This seems like two independent fixes, but unfortunately they are hard
to separate because it's challenging to reliably test either one of them
without also testing the other.

A complication arises with deduced return type support: we need the type
of the function in order to know how to merge it, but we can't load the
actual type of the function because it might reference an entity
declared within the function (and we need to have already merged the
function to correctly merge that entity, which we would need to do to
determine if the function types match). So we instead compare the
declared function type when merging functions, and defer loading the
actual type of a function with a deduced type until we've finished
loading and merging the function.

llvm-svn: 336021

6 years agoSpurious commit just to help Richard, because git is weird.
David Blaikie [Fri, 29 Jun 2018 21:58:24 +0000 (21:58 +0000)]
Spurious commit just to help Richard, because git is weird.

llvm-svn: 336020

6 years ago[profile] Add llvm_gcov_flush to be called outside a shared library
Chih-Hung Hsieh [Fri, 29 Jun 2018 21:45:55 +0000 (21:45 +0000)]
[profile] Add llvm_gcov_flush to be called outside a shared library

__gcov_flush is hidden.
For applications to dump profiling data of selected .so files,
they can use dlsym to find and call llvm_gcov_flush in each .so file.

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

llvm-svn: 336019

6 years ago[WebAssembly] Update comments for non-splat pow2 vector test case
Heejin Ahn [Fri, 29 Jun 2018 21:27:20 +0000 (21:27 +0000)]
[WebAssembly] Update comments for non-splat pow2 vector test case

Summary:
After rL335727, (sdiv X, 1) is treated as a special case, so we can
safely transform 'sdiv's in non-splat pow vectors into 'shr's even when
some of its entries are '1'. The test expectations have been already
fixed in rL335771, but the comments were out of date.

Also changed the filename from `vector_sdiv.ll` to `vector-sdiv.ll` to
be consistent with other test file names.

Reviewers: RKSimon

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

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

llvm-svn: 336018

6 years ago[WebAssembly] Comment out a switch block in ISelDAGToDAG
Heejin Ahn [Fri, 29 Jun 2018 21:19:22 +0000 (21:19 +0000)]
[WebAssembly] Comment out a switch block in ISelDAGToDAG

Summary: Fixes PR37977.

Reviewers: RKSimon

Subscribers: dschuff, sbc100, sunfish, llvm-commits

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

llvm-svn: 336017

6 years ago[modules] Emit the type of the TypeSourceInfo for a DeclaratorDecl (but
Richard Smith [Fri, 29 Jun 2018 20:46:25 +0000 (20:46 +0000)]
[modules] Emit the type of the TypeSourceInfo for a DeclaratorDecl (but
not the corresponding location information) earlier.

We need the type as written in order to properly merge functions with
deduced return types, so we need to load that early. But we don't want
to load the location information early, because that contains
problematic things such as the function parameters.

llvm-svn: 336016

6 years ago[MemorySSA] Add APIs to MemoryPhis to delete incoming blocks/values, and an updater...
Alina Sbirlea [Fri, 29 Jun 2018 20:46:16 +0000 (20:46 +0000)]
[MemorySSA] Add APIs to MemoryPhis to delete incoming blocks/values, and an updater API to remove blocks.

Summary:
MemoryPhis now have APIs analogous to BB Phis to remove an incoming value/block.
The MemorySSAUpdater uses the above APIs when updating MemorySSA given a set of dead blocks about to be deleted.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

llvm-svn: 336015

6 years agoIntroduce a separate preprocessor macro, _LIBUNWIND_USE_DLADDR, for directly controll...
Jordan Rupprecht [Fri, 29 Jun 2018 20:41:50 +0000 (20:41 +0000)]
Introduce a separate preprocessor macro, _LIBUNWIND_USE_DLADDR, for directly controlling a dependency on dladdr(). This will allow us to use libunwind without adding a libdl dependency.

Reviewers: saugustine

Subscribers: christof, chrib, cfe-commits, echristo

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

llvm-svn: 336014

6 years agoSpecify an explicit underlying type for this enum to fix Windows
Richard Smith [Fri, 29 Jun 2018 20:41:23 +0000 (20:41 +0000)]
Specify an explicit underlying type for this enum to fix Windows
buildbots.

On Windows targets, enums always get an underlying type of 'int', even
if they have wider enumerators. (This is non-conforming, but it's
effectively part of the target ABI.)

llvm-svn: 336013

6 years agoRevert "Revert "Support for multiarch runtimes layout""
Eric Christopher [Fri, 29 Jun 2018 20:27:40 +0000 (20:27 +0000)]
Revert "Revert "Support for multiarch runtimes layout""

This reverts commit r336005 that was accidentally committed.

llvm-svn: 336012

6 years ago[HWASan] Do not retag allocas before return from the function.
Alex Shlyapnikov [Fri, 29 Jun 2018 20:20:17 +0000 (20:20 +0000)]
[HWASan] Do not retag allocas before return from the function.

Summary:
Retagging allocas before returning from the function might help
detecting use after return bugs, but it does not work at all in real
life, when instrumented and non-instrumented code is intermixed.
Consider the following code:

F_non_instrumented() {
  T x;
  F1_instrumented(&x);
  ...
}

{
  F_instrumented();
  F_non_instrumented();
}

- F_instrumented call leaves the stack below the current sp tagged
  randomly for UAR detection
- F_non_instrumented allocates its own vars on that tagged stack,
  not generating any tags, that is the address of x has tag 0, but the
  shadow memory still contains tags left behind by F_instrumented on the
  previous step
- F1_instrumented verifies &x before using it and traps on tag mismatch,
  0 vs whatever tag was set by F_instrumented

Reviewers: eugenis

Subscribers: srhines, llvm-commits

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

llvm-svn: 336011

6 years ago[LLVMContext] Detecting leaked instructions with metadata
Vedant Kumar [Fri, 29 Jun 2018 20:13:13 +0000 (20:13 +0000)]
[LLVMContext] Detecting leaked instructions with metadata

When instructions with metadata are accidentally leaked, the result is a
difficult-to-find memory corruption in ~LLVMContextImpl that leads to
random crashes.

Patch by ArvÄ«ds Kokins!

llvm-svn: 336010

6 years ago[lldb-mi] Clean up and update a few MI commands.
Alexander Polyakov [Fri, 29 Jun 2018 19:58:31 +0000 (19:58 +0000)]
[lldb-mi] Clean up and update a few MI commands.

Summary:
This patch updates a few MI commands using a new way of
handling an errors in lldb-mi and removes unnecessary
m_lldbResult variables.

Reviewers: aprantl, clayborg, labath

Reviewed By: aprantl, clayborg

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 336009

6 years agoRequest init/fini array on FreeBSD 12 and later
Dimitry Andric [Fri, 29 Jun 2018 19:18:17 +0000 (19:18 +0000)]
Request init/fini array on FreeBSD 12 and later

Summary:
It seems a bad idea to change the default in the middle of a release
branch due to possible changes in global ctor / dtor ordering between
.ctors and .init_array. With FreeBSD 11.0's release imminent lets change
the default now for FreeBSD 12 (the current development stream) and
later.

FreeBSD rtld has supported .init_array / .fini_array for many years. As
of Jan 1 2017 all supported FreeBSD releases and branches will have
support.

Reviewers: dim, brooks, arichardson

Reviewed By: dim, brooks, arichardson

Subscribers: bsdjhb, krytarowski, emaste, cfe-commits

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

llvm-svn: 336008

6 years agoPass DWARFUnit to verifier by reference not by value. I am moderately
Paul Robinson [Fri, 29 Jun 2018 19:17:44 +0000 (19:17 +0000)]
Pass DWARFUnit to verifier by reference not by value.  I am moderately
sure this should not cause a memory leak.

llvm-svn: 336007

6 years agoAdd a blank line to docs/README.txt test commit access
Jordan Rupprecht [Fri, 29 Jun 2018 19:05:21 +0000 (19:05 +0000)]
Add a blank line to docs/README.txt test commit access

Subscribers: christof, cfe-commits

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

llvm-svn: 336006

6 years agoRevert "Support for multiarch runtimes layout"
Jordan Rupprecht [Fri, 29 Jun 2018 19:05:20 +0000 (19:05 +0000)]
Revert "Support for multiarch runtimes layout"

This reverts commit 0c7cea3c0c6338b99e30c13201365a3dd4edc6f4.

llvm-svn: 336005

6 years ago[mips][ias] Enable IAS by default for OpenBSD / FreeBSD mips64/mips64el.
Brad Smith [Fri, 29 Jun 2018 19:03:03 +0000 (19:03 +0000)]
[mips][ias] Enable IAS by default for OpenBSD / FreeBSD mips64/mips64el.

Reviewers: atanasyan

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

llvm-svn: 336004

6 years ago[analyzer] Replace the vector of ConstraintSets by a single ConstraintSet and a funct...
Mikhail R. Gadelha [Fri, 29 Jun 2018 18:11:43 +0000 (18:11 +0000)]
[analyzer] Replace the vector of ConstraintSets by a single ConstraintSet and a function to merge ConstraintSets

Now, instead of adding the constraints when they are removed, this patch adds them when they first appear and, since we walk the bug report backward, it should be the last set of ranges generated by the CSA for a given symbol.

These are the number before and after the patch:
```
Project    |  current |   patch  |
tmux       |  283.222 |  123.052 |
redis      |  614.858 |  400.347 |
openssl    |  308.292 |  307.149 |
twin       |  274.478 |  245.411 |
git        |  547.687 |  477.335 |
postgresql | 2927.495 | 2002.526 |
sqlite3    | 3264.305 | 1028.416 |
```

Major speedups in tmux and sqlite (less than half of the time), redis and postgresql were about 25% faster while the rest are basically the same.

Reviewers: NoQ, george.karpenkov

Reviewed By: george.karpenkov

Subscribers: rnkovacs, xazax.hun, szepet, a.sidorin

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

llvm-svn: 336002

6 years ago[MachineOutliner] Make -mno-outline use -enable-machine-outliner=never
Jessica Paquette [Fri, 29 Jun 2018 18:06:10 +0000 (18:06 +0000)]
[MachineOutliner] Make -mno-outline use -enable-machine-outliner=never

This updates -mno-outline so that it passes -enable-machine-outliner=never
instead of nothing. This puts it in sync with the behaviour in llc and
other tools.

llvm-svn: 336001

6 years agoRevert "Extend CFGPrinter and CallPrinter with Heat Colors"
Sean Fertile [Fri, 29 Jun 2018 17:48:58 +0000 (17:48 +0000)]
Revert "Extend CFGPrinter and CallPrinter with Heat Colors"

This reverts r335996 which broke graph printing in Polly.

llvm-svn: 336000

6 years agoAMDGPU: Don't use struct type for argument layout
Matt Arsenault [Fri, 29 Jun 2018 17:31:42 +0000 (17:31 +0000)]
AMDGPU: Don't use struct type for argument layout

This was introducing unnecessary padding after the explicit
arguments, depending on the alignment of the total struct type.
Also has the side effect of avoiding creating an extra GEP for
the offset from the base kernel argument to the explicit kernel
argument offset.

llvm-svn: 335999

6 years ago[X86] Limit the number of target specific nodes emitted in LowerShiftParts
Craig Topper [Fri, 29 Jun 2018 17:24:07 +0000 (17:24 +0000)]
[X86] Limit the number of target specific nodes emitted in LowerShiftParts

The important part is the creation of the SHLD/SHRD nodes. The compare and the conditional move can use target independent nodes that can be legalized on their own. This gives some opportunities to trigger the optimizations present in the lowering for those things. And its just better to limit the number of places we emit target specific nodes.

The changed test cases still aren't optimal.

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

llvm-svn: 335998

6 years ago[cfi] Use __builtin version of __clear_cache.
Evgeniy Stepanov [Fri, 29 Jun 2018 17:22:58 +0000 (17:22 +0000)]
[cfi] Use __builtin version of __clear_cache.

__builtin___clear_cache is also present on X86 and does the right thing (i.e. nop) there.

llvm-svn: 335997

6 years agoExtend CFGPrinter and CallPrinter with Heat Colors
Sean Fertile [Fri, 29 Jun 2018 17:13:58 +0000 (17:13 +0000)]
Extend CFGPrinter and CallPrinter with Heat Colors

Extends the CFGPrinter and CallPrinter with heat colors based on heuristics or
profiling information. The colors are enabled by default and can be toggled
on/off for CFGPrinter by using the option -cfg-heat-colors for both
-dot-cfg[-only] and -view-cfg[-only].  Similarly, the colors can be toggled
on/off for CallPrinter by using the option -callgraph-heat-colors for both
-dot-callgraph and -view-callgraph.

Patch by Rodrigo Caetano Rocha!

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

llvm-svn: 335996

6 years ago[dsymutil] Rename conflicting declaration
Jonas Devlieghere [Fri, 29 Jun 2018 17:11:34 +0000 (17:11 +0000)]
[dsymutil] Rename conflicting declaration

Using MemoryBuffer as member name clashed with the llvm::MemoryBuffer
class.

llvm-svn: 335995

6 years ago[X86] Use a std::vector for the memory unfolding table.
Craig Topper [Fri, 29 Jun 2018 17:11:26 +0000 (17:11 +0000)]
[X86] Use a std::vector for the memory unfolding table.

Previously we used a DenseMap which is costly to set up due to multiple full table rehashes as the size increases and causes the table to be reallocated.

This patch changes the table to a vector of structs. We now walk the reg->mem tables and push new entries in the mem->reg table for each row not marked TB_NO_REVERSE. Once all the table entries have been created, we sort the vector. Then we can use a binary search for lookups.

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

llvm-svn: 335994

6 years ago[Fixed Point Arithmetic] Rename `-fsame-fbits` flag
Leonard Chan [Fri, 29 Jun 2018 17:08:19 +0000 (17:08 +0000)]
[Fixed Point Arithmetic] Rename `-fsame-fbits` flag

- Rename the `-fsame-fbits` flag to `-fpadding-on-unsigned-fixed-point`
- Move the flag from a driver option to a cc1 option
- Rename the `SameFBits` member in TargetInfo to `PaddingOnUnsignedFixedPoint`
- Updated descriptions

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

llvm-svn: 335993

6 years ago[ELF] Set -o because current directory may not be writable during a test
Fangrui Song [Fri, 29 Jun 2018 17:07:22 +0000 (17:07 +0000)]
[ELF] Set -o because current directory may not be writable during a test

llvm-svn: 335992

6 years ago[dsymutil] Make the CachedBinaryHolder the default
Jonas Devlieghere [Fri, 29 Jun 2018 16:51:52 +0000 (16:51 +0000)]
[dsymutil] Make the CachedBinaryHolder the default

Replaces all uses of the old binary holder with its cached variant.

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

llvm-svn: 335991

6 years ago[dsymutil] Introduce a new CachedBinaryHolder
Jonas Devlieghere [Fri, 29 Jun 2018 16:50:41 +0000 (16:50 +0000)]
[dsymutil] Introduce a new CachedBinaryHolder

The original binary holder has an optimization where it caches a static
library (archive) between consecutive calls to GetObjects. However, the
actual memory buffer wasn't cached between calls.

This made sense when dsymutil was processing objects one after each
other, but when processing them in parallel, several binaries have to be
in memory at the same time. For this reason, every link context
contained a binary holder.

Having one binary holder per context is problematic, because the same
static archive was cached for every object file. Luckily, when the file
is mmap'ed, this was only costing us virtual memory.

This patch introduces a new BinaryHolder variant that is fully cached,
for all the object files it load, as well as the static archives. This
way, we don't have to give up on this optimization of bypassing the
file system.

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

llvm-svn: 335990

6 years ago[mips] Support shrink-wrapping
Petar Jovanovic [Fri, 29 Jun 2018 16:37:16 +0000 (16:37 +0000)]
[mips] Support shrink-wrapping

Except for -O0, it's enabled by default.

Patch by Vladimir Stefanovic.

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

llvm-svn: 335989

6 years ago[AMDGPU] Enable LICM in the BE pipeline
Stanislav Mekhanoshin [Fri, 29 Jun 2018 16:26:53 +0000 (16:26 +0000)]
[AMDGPU] Enable LICM in the BE pipeline

This allows to hoist code portion to compute reciprocal of loop
invariant denominator in integer division after codegen prepare
expansion.

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

llvm-svn: 335988

6 years ago[OPENMP, NVPTX] Sync threads before start ordered loops.
Alexey Bataev [Fri, 29 Jun 2018 16:16:00 +0000 (16:16 +0000)]
[OPENMP, NVPTX] Sync threads before start ordered loops.

Summary: Threads must be synchronized before starting ordered construct.

Reviewers: grokos

Subscribers: guansong, openmp-commits

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

llvm-svn: 335987

6 years ago[MachineOutliner] Add always and never options to -enable-machine-outliner
Jessica Paquette [Fri, 29 Jun 2018 16:12:45 +0000 (16:12 +0000)]
[MachineOutliner] Add always and never options to -enable-machine-outliner

This is a recommit of r335887, which was erroneously committed earlier.

To enable the MachineOutliner by default on AArch64, we need to be able to
disable the MachineOutliner and also provide an option to "always" enable the
outliner.

This adds that capability. It allows the user to still use the old
-enable-machine-outliner option, which defaults to "always". This is building
up to allowing the user to specify "always" versus the target default
outlining behaviour.

https://reviews.llvm.org/D48682

llvm-svn: 335986

6 years ago[lld] Address post-commit review of r335848
Filipe Cabecinhas [Fri, 29 Jun 2018 15:34:36 +0000 (15:34 +0000)]
[lld] Address post-commit review of r335848

llvm-svn: 335985

6 years ago[InstCombine] add more tests for shuffle-binop folds; NFC
Sanjay Patel [Fri, 29 Jun 2018 15:28:11 +0000 (15:28 +0000)]
[InstCombine] add more tests for shuffle-binop folds; NFC

The mul+shl tests add coverage for the fold enabled with D48678.
The and+or tests are not handled yet; that's D48662.

llvm-svn: 335984

6 years ago[clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl
Ben Hamilton [Fri, 29 Jun 2018 15:26:37 +0000 (15:26 +0000)]
[clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl

Summary:
In D44638, I partially fixed `NS_SWIFT_NAME(foo(bar:baz:))`-style
annotations on C functions, but didn't add a test for Objective-C
method declarations.

For ObjC method declarations which are annotated with `NS_SWIFT_NAME(...)`,
we currently fail to annotate the final component of the selector
name as `TT_SelectorName`.

Because the token type is left unknown, clang-format will happily
cause a compilation error when it changes the following:

```
@interface Foo
- (void)doStuffWithFoo:(id)name
                   bar:(id)bar
                   baz:(id)baz
    NS_SWIFT_NAME(doStuff(withFoo:bar:baz:));
@end
```

to:

```
@interface Foo
- (void)doStuffWithFoo:(id)name
                   bar:(id)bar
                   baz:(id)baz
    NS_SWIFT_NAME(doStuff(withFoo:bar:baz
:));
@end
```

(note the linebreak before the final `:`).

The logic which decides whether or not to annotate the token before a
`:` with `TT_SelectorName` is pretty fragile, and has to handle some
pretty odd cases like pair-parameters:

```
[I drawRectOn:surface ofSize:aa:bbb atOrigin:cc:dd];
```

So, to minimize the effect of this change, I decided to only annotate
unknown identifiers before a `:` as `TT_SelectorName` for Objective-C
declaration lines.

Test Plan: New tests included. Confirmed tests failed before change and
  passed after change. Ran tests with:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, krasimir, jolesiak

Reviewed By: krasimir

Subscribers: cfe-commits

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

llvm-svn: 335983

6 years ago[scs] Disable negative test in shadowcallstack.
Evgeniy Stepanov [Fri, 29 Jun 2018 15:16:45 +0000 (15:16 +0000)]
[scs] Disable negative test in shadowcallstack.

The test checks that scs does NOT work correctly w/o runtime support.
That's a strange thing to test, and it is also flaky, because things
may just work if x18 happens to point to a writable page.

llvm-svn: 335982

6 years ago[scudo] Add some runtime tests for the minimal runtime
Kostya Kortchinsky [Fri, 29 Jun 2018 14:56:25 +0000 (14:56 +0000)]
[scudo] Add some runtime tests for the minimal runtime

Summary:
As well as some tests to ensure that various combinations of the clang command
line flags work (shared/static/minimal).

Reviewers: eugenis, alekseyshl, vitalybuka

Reviewed By: vitalybuka

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

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

llvm-svn: 335981

6 years ago[clangd] codeComplete returns more structured completion items, LSP. NFC.
Sam McCall [Fri, 29 Jun 2018 14:47:57 +0000 (14:47 +0000)]
[clangd] codeComplete returns more structured completion items, LSP. NFC.

Summary:
LSP has some presentational fields with limited semantics (e.g. 'detail') and
doesn't provide a good place to return information like namespace.

Some places where more detailed information is useful:
 - tools like quality analysis
 - alternate frontends that aren't strictly LSP
 - code completion unit tests

In this patch, ClangdServer::codeComplete still return LSP CompletionList, but
I plan to switch that soon (should be a no-op for ClangdLSPServer).

Deferring this makes it clear that we don't change behavior (tests stay the
same) and also keeps the API break to a small patch which can be reverted.

Reviewers: ioeric

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

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

llvm-svn: 335980

6 years ago[ELF] - Linker script: add tests for checking malformed numbers parsing.
George Rimar [Fri, 29 Jun 2018 14:29:44 +0000 (14:29 +0000)]
[ELF] - Linker script: add tests for checking malformed numbers parsing.

Previoulsy we had no test that covered malfolmed numbers
with 'H', 'K' and 'M' suffixes, so the following lines
were uncovered:

https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L996
https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L1003
https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L1008

Patch fixes that.

llvm-svn: 335979

6 years ago[clang-format] Support additional common functions for text proto formatting
Krasimir Georgiev [Fri, 29 Jun 2018 14:25:25 +0000 (14:25 +0000)]
[clang-format] Support additional common functions for text proto formatting

Summary: This adds a few more common function names expecting a text proto argument.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 335978

6 years ago[llvm-mca] Remove field HasReadAdvanceEntries from class ReadDescriptor.
Andrea Di Biagio [Fri, 29 Jun 2018 14:24:46 +0000 (14:24 +0000)]
[llvm-mca] Remove field HasReadAdvanceEntries from class ReadDescriptor.

This simplifies the logic that updates RAW dependencies in the DispatchStage.
There is no advantage in storing that flag in the ReadDescriptor; we should
simply rely on the call to `STI.getReadAdvanceCycles()` to obtain the
ReadAdvance cycles. If there are no read-advance entries, then method
`getReadAdvanceCycles()` quickly returns 0.

No functional change intended.

llvm-svn: 335977

6 years ago[DEBUG_INFO, NVPTX] Do not emit .debug_loc section.
Alexey Bataev [Fri, 29 Jun 2018 14:23:28 +0000 (14:23 +0000)]
[DEBUG_INFO, NVPTX] Do not emit .debug_loc section.

Summary:
.debug_loc section is not supported for NVPTX target. If there is an
object whose location can change during its lifetime, we do not generate
debug location info for this variable.

Reviewers: echristo

Subscribers: jholewinski, JDevlieghere, llvm-commits

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

llvm-svn: 335976

6 years ago[Hexagon] Remove unused instruction itineraties, NFC
Krzysztof Parzyszek [Fri, 29 Jun 2018 13:55:28 +0000 (13:55 +0000)]
[Hexagon] Remove unused instruction itineraties, NFC

llvm-svn: 335975

6 years ago[InstCombine] enhance shuffle-of-binops to allow different variable ops (PR37806)
Sanjay Patel [Fri, 29 Jun 2018 13:44:06 +0000 (13:44 +0000)]
[InstCombine] enhance shuffle-of-binops to allow different variable ops (PR37806)

This was discussed in D48401 as another improvement for:
https://bugs.llvm.org/show_bug.cgi?id=37806

If we have 2 different variable values, then we shuffle (select) those lanes,
shuffle (select) the constants, and then perform the binop. This eliminates a binop.

The new shuffle uses the same shuffle mask as the existing shuffle, so there's no
danger of creating a difficult shuffle.

All of the earlier constraints still apply, but we also check for extra uses to
avoid creating more instructions than we'll remove.

Additionally, we're disallowing the fold for div/rem because that could expose a
UB hole.

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

llvm-svn: 335974

6 years ago[ELF] - Eliminate dead code from shouldKeepInSymtab. NFC.
George Rimar [Fri, 29 Jun 2018 13:34:05 +0000 (13:34 +0000)]
[ELF] - Eliminate dead code from shouldKeepInSymtab. NFC.

shouldKeepInSymtab is called from copyLocalSymbols:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L574

The pre-condition is that symbol should be Defined:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L572

And its section is Live:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L548

InputSection::Discarded section can never be Live. And hence I believe
check I removed in this patch is excessive.

llvm-svn: 335973

6 years ago[clangd] Improve output of --help and --version. NFC.
Sam McCall [Fri, 29 Jun 2018 13:24:20 +0000 (13:24 +0000)]
[clangd] Improve output of --help and --version. NFC.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 335972

6 years agoUse range for in normalizeValInst [NFCI]
Tobias Grosser [Fri, 29 Jun 2018 13:06:44 +0000 (13:06 +0000)]
Use range for in normalizeValInst [NFCI]

llvm-svn: 335971

6 years agoTranslate a couple of foreach callbacks into range-based iterator loops
Tobias Grosser [Fri, 29 Jun 2018 12:23:48 +0000 (12:23 +0000)]
Translate a couple of foreach callbacks into range-based iterator loops

Thanks to Philip Pfaffe for providing iterator support in the previous
commit.

llvm-svn: 335970

6 years ago[ELF] - EhFrame.cpp: cover personality encoding handling code with the test cases.
George Rimar [Fri, 29 Jun 2018 12:19:35 +0000 (12:19 +0000)]
[ELF] - EhFrame.cpp: cover personality encoding handling code with the test cases.

CIEs augmentation string can have 'P' character,
what means the next byte is the personality encoding, a DW_EH_PE_xxx value.
This is followed by a pointer to the personality function.

We had the support of the different encodings earlier, but had no test cases.

This change adds coverage of DW_EH_PE_absptr/DW_EH_PE_signed/DW_EH_PE_udata2/DW_EH_PE_sdata2 and
DW_EH_PE_udata8/DW_EH_PE_sdata8 cases for place below:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L123

llvm-svn: 335969

6 years ago[ASTImporter] Added import of CXXStdInitializerListExpr
Gabor Marton [Fri, 29 Jun 2018 12:17:34 +0000 (12:17 +0000)]
[ASTImporter] Added import of CXXStdInitializerListExpr

Reviewers: a.sidorin

Reviewed By: a.sidorin

Subscribers: martong, cfe-commits

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

Patch by Balazs Keri!

llvm-svn: 335968

6 years agoAdd a test for reading lld-generated build-ids
Pavel Labath [Fri, 29 Jun 2018 12:15:54 +0000 (12:15 +0000)]
Add a test for reading lld-generated build-ids

Summary:
This test makes sure we are able to read the shorter build-ids which are
generated by lld.

To make this work, I've extended lldb-test to print the UUID of the
loaded object file. I've renamed the lldb-test subcommand from
"module-sections" to "object-file" to reflect the fact it prints more
than just the sections.

I've also added the module Architecture to the output, so we could avoid
printing the entire symbol file information just to get the ArchSpec
details in the lc_version_min test (which was also the only test in it's
folder not using the module-sections command).

Reviewers: aprantl, zturner

Subscribers: lldb-commits

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

llvm-svn: 335967

6 years agoAdd missing namespace specifier
Tobias Grosser [Fri, 29 Jun 2018 11:49:34 +0000 (11:49 +0000)]
Add missing namespace specifier

llvm-svn: 335966

6 years agoFix overconfident assert in ScalarEvolution::isImpliedViaMerge
Roman Shirokiy [Fri, 29 Jun 2018 11:46:30 +0000 (11:46 +0000)]
Fix overconfident assert in ScalarEvolution::isImpliedViaMerge
We can have AddRec with loops having many predecessors.
This changes an assert to an early return.

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

llvm-svn: 335965

6 years ago[analyzer][UninitializedObjectChecker] Added a NotesAsWarnings flag
Kristof Umann [Fri, 29 Jun 2018 11:25:24 +0000 (11:25 +0000)]
[analyzer][UninitializedObjectChecker] Added a NotesAsWarnings flag

In order to better support consumers of the plist output that don't
parse note entries just yet, a 'NotesAsWarnings' flag was added.
If it's set to true, all notes will be converted to warnings.

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

llvm-svn: 335964

6 years agoUUID: Add support for arbitrary-sized module IDs
Pavel Labath [Fri, 29 Jun 2018 11:20:29 +0000 (11:20 +0000)]
UUID: Add support for arbitrary-sized module IDs

Summary:
The data structure is optimized for the case where the UUID size is <=
20 bytes (standard length emitted by the GNU linkers), but larger sizes
are also possible.

I've modified the string conversion function to support the new sizes as
well. For standard UUIDs it maintains the traditional formatting
(4-2-2-2-6). If a UUID is shorter, we just cut this sequence short, and
for longer UUIDs it will just repeat the last 6-byte block as long as
necessary.

I've also modified ObjectFileELF to take advantage of the new UUIDs and
avoid manually padding the UUID to 16 bytes. While there, I also made
sure the computed UUID does not depend on host endianness.

Reviewers: clayborg, lemo, sas, davide, espindola

Subscribers: emaste, arichardson, lldb-commits

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

llvm-svn: 335963

6 years ago[AArch64] Armv8.4-A: Virtualization system registers
Sjoerd Meijer [Fri, 29 Jun 2018 11:03:15 +0000 (11:03 +0000)]
[AArch64] Armv8.4-A: Virtualization system registers

This adds the Secure EL2 extension.

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

llvm-svn: 335962

6 years ago[cmake] Change WIN32 test to CMAKE_HOST_WIN32
Filipe Cabecinhas [Fri, 29 Jun 2018 10:34:37 +0000 (10:34 +0000)]
[cmake] Change WIN32 test to CMAKE_HOST_WIN32

The test is about what can be run on the host, not the cmake target.
When cross-compiling (compiler-rt at least) on Windows, we end up with
lit being unable to run llvm-lit because it can't find the llvm-lit
module.

llvm-svn: 335961

6 years agoFix use-after-free in CommandCompletions.cpp
Pavel Labath [Fri, 29 Jun 2018 10:27:18 +0000 (10:27 +0000)]
Fix use-after-free in CommandCompletions.cpp

The code was creating a StringRef to a temporary std::string. The
solution is to just drop the .str() from the original StringRef.

This manifested it self as the new TestCompletions test failing in some
configurations.

llvm-svn: 335960