lldb.git
6 years agoClang changes for overloading invariant.start and end intrinsics
Anna Thomas [Fri, 22 Jul 2016 17:50:08 +0000 (17:50 +0000)]
Clang changes for overloading invariant.start and end intrinsics

This change depends on the corresponding LLVM change at:
https://reviews.llvm.org/D22519

The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this LLVM change, these intrinsics are overloaded for any adddress space
for memory objects and we can use these llvm invariant intrinsics in
non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

llvm-svn: 276448

6 years agoInvariant start/end intrinsics overloaded for address space
Anna Thomas [Fri, 22 Jul 2016 17:49:40 +0000 (17:49 +0000)]
Invariant start/end intrinsics overloaded for address space

Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this change, these intrinsics are overloaded for any adddress space
for memory objects
and we can use these llvm invariant intrinsics in non-default address
spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

Reviewers: apilipenko, reames

Subscribers: llvm-commits
llvm-svn: 276447

6 years ago[utils] Update coverage regression checking script
Vedant Kumar [Fri, 22 Jul 2016 17:38:03 +0000 (17:38 +0000)]
[utils] Update coverage regression checking script

r276409 changed the coverage summary format. Update the script so that
it can parse the new output, and incorporate the new information into
its warnings.

llvm-svn: 276446

6 years agoClangRenameTests: Update libdeps.
NAKAMURA Takumi [Fri, 22 Jul 2016 17:33:04 +0000 (17:33 +0000)]
ClangRenameTests: Update libdeps.

llvm-svn: 276445

6 years agoRemove unused parameters from simplifySCoP(). NFC.
Michael Kruse [Fri, 22 Jul 2016 17:31:17 +0000 (17:31 +0000)]
Remove unused parameters from simplifySCoP(). NFC.

llvm-svn: 276444

6 years agoAMDGPU: Implement get_global_offset builtin
Jan Vesely [Fri, 22 Jul 2016 17:24:24 +0000 (17:24 +0000)]
AMDGPU: Implement get_global_offset builtin

Also fix get_global_id to consider offset
No idea how to add this for ptx, so they are stuck with the old get_global_id
implementation.

v2: split to a separate patch

v3: Switch R600 to use implictarg.ptr

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 276443

6 years agoAMDGPU: Use clang intrinsics for workitem builtins
Jan Vesely [Fri, 22 Jul 2016 17:24:20 +0000 (17:24 +0000)]
AMDGPU: Use clang intrinsics for workitem builtins

v2: split into 2 patches
    use clang builtins for other intrinsics as well

v3: Fix warnings
    Switch r600 to use implictarg.ptr

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 276442

6 years ago[Hexagon] Make HexagonCodeGen depend on Scalar
Krzysztof Parzyszek [Fri, 22 Jul 2016 17:23:46 +0000 (17:23 +0000)]
[Hexagon] Make HexagonCodeGen depend on Scalar

Hexagon backend uses LoopDataPrefetch pass that is defined in Scalar.

llvm-svn: 276441

6 years ago[sanitizers] Enable sanitizer_common tests on Win64
Reid Kleckner [Fri, 22 Jul 2016 17:14:31 +0000 (17:14 +0000)]
[sanitizers] Enable sanitizer_common tests on Win64

llvm-svn: 276440

6 years agoAMDGPU: Remove redundant test
Matt Arsenault [Fri, 22 Jul 2016 17:01:36 +0000 (17:01 +0000)]
AMDGPU: Remove redundant test

llvm-svn: 276439

6 years agoAMDGPU: Fix groupstaticsize for large LDS
Matt Arsenault [Fri, 22 Jul 2016 17:01:33 +0000 (17:01 +0000)]
AMDGPU: Fix groupstaticsize for large LDS

The size can exceed s_movk_i32's limit, and we don't
want to use it this early since it inhibits optimizations.

This should probably be merged to the release branch.

llvm-svn: 276438

6 years agoAMDGPU: Add HSA dispatch id intrinsic
Matt Arsenault [Fri, 22 Jul 2016 17:01:30 +0000 (17:01 +0000)]
AMDGPU: Add HSA dispatch id intrinsic

llvm-svn: 276437

6 years agoAMDGPU: Delete more dead code
Matt Arsenault [Fri, 22 Jul 2016 17:01:25 +0000 (17:01 +0000)]
AMDGPU: Delete more dead code

Remove dead code from r600 intrinsic removal.
Remove unset members, rename StackSize to be less ambiguous.

llvm-svn: 276436

6 years agoAMDGPU: Fix i1 fp_to_int
Matt Arsenault [Fri, 22 Jul 2016 17:01:21 +0000 (17:01 +0000)]
AMDGPU: Fix i1 fp_to_int

R600's i1 fp_to_uint selected but was incorrect according to
what instcombine constant folds to.

llvm-svn: 276435

6 years agoAMDGPU: Don't reinvent transferSuccessorsAndUpdatePHIs
Matt Arsenault [Fri, 22 Jul 2016 17:01:15 +0000 (17:01 +0000)]
AMDGPU: Don't reinvent transferSuccessorsAndUpdatePHIs

llvm-svn: 276434

6 years agoGlobalISel: implement alloca instruction
Tim Northover [Fri, 22 Jul 2016 16:59:52 +0000 (16:59 +0000)]
GlobalISel: implement alloca instruction

llvm-svn: 276433

6 years ago[SelectionDAG] Optimization of BITREVERSE legalization for power-of-2 integer scalar...
Simon Pilgrim [Fri, 22 Jul 2016 16:46:25 +0000 (16:46 +0000)]
[SelectionDAG] Optimization of BITREVERSE legalization for power-of-2 integer scalar/vector types

An extension of D19978, this patch replaces the default BITREVERSE evaluation of individual bit masks+shifts with block mask+shifts when we have integer elements of power-of-2 bits in size.

After calling BSWAP to reverse the order of the constituent bytes (which typically follows a similar approach), every neighbouring 4-bits, 2-bits and finally 1-bit pairs are masked off and swapped over with shifts.

In doing so we can significantly reduce the number of operations required.

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

llvm-svn: 276432

6 years ago[Profile] Cleanup: remove unused interface
Xinliang David Li [Fri, 22 Jul 2016 16:11:56 +0000 (16:11 +0000)]
[Profile] Cleanup: remove unused interface

llvm-svn: 276431

6 years ago[Support] Make ErrorAsOutParameter take an Error* rather than an Error&.
Lang Hames [Fri, 22 Jul 2016 16:11:25 +0000 (16:11 +0000)]
[Support] Make ErrorAsOutParameter take an Error* rather than an Error&.

This allows ErrorAsOutParameter to work better with "optional" errors. For
example, consider a function where for certain input values it is known that
the function can't fail. This can now be written as:

Result foo(Arg X, Error *Err) {
  ErrorAsOutParameter EAO(Err);

  if (<Error Condition>) {
    if (Err)
      *Err = <report error>;
    else
      llvm_unreachable("Unexpected failure!");
  }
}

Rather than having to construct an ErrorAsOutParameter under every conditional
where Err is known to be non-null.

llvm-svn: 276430

6 years ago[RDF] Make the graph construction/use less expensive
Krzysztof Parzyszek [Fri, 22 Jul 2016 16:09:47 +0000 (16:09 +0000)]
[RDF] Make the graph construction/use less expensive

- FuncNode::findBlock traverses the function every time. Avoid using it,
  and keep a cache of block addresses in DataFlowGraph instead.
- The operator[] in the map of definition stacks was very slow. Replace
  the map with unordered_map.

llvm-svn: 276429

6 years agoReplace enum types in variadic functions by build-in types.
Samuel Antao [Fri, 22 Jul 2016 16:05:35 +0000 (16:05 +0000)]
Replace enum types in variadic functions by build-in types.

Summary:
When compiling the runtime library with clang we get warnings like:
```
error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
    va_start( args, id );
                    ^
note: parameter of type 'kmp_i18n_id_t' (aka 'kmp_i18n_id') is declared here
    kmp_i18n_id_t id,
```
My understanding is that the va_start macro only gets the promoted type so it won't know what was the exact type of the argument, which can potentially not work for some targets given that the implementation of the the calling convention could not be done properly.

This patch fixes that by using a built-in type in the function signature.

Reviewers: tlwilmar, jlpeyton, AndreyChurbanov

Subscribers: arpith-jacob, carlo.bertolli, caomhin, openmp-commits

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

llvm-svn: 276428

6 years ago[pdb] Move file layout header structs to RawTypes.h
Zachary Turner [Fri, 22 Jul 2016 15:46:46 +0000 (15:46 +0000)]
[pdb] Move file layout header structs to RawTypes.h

This facilitates code reuse between the builder classes and the
"frozen" read only versions of the classes used for parsing
existing PDB files.

llvm-svn: 276427

6 years ago[pdb] Round-trip module & file info to/from YAML.
Zachary Turner [Fri, 22 Jul 2016 15:46:37 +0000 (15:46 +0000)]
[pdb] Round-trip module & file info to/from YAML.

This implements support for writing compiland and compiland source
file info to a binary PDB.  This is tested by adding support for
dumping these fields from an existing PDB to yaml, reading them
back in, and dumping them again and verifying the values are as
expected.

llvm-svn: 276426

6 years agotest commit. update comment grammatically. NFC
Anna Thomas [Fri, 22 Jul 2016 15:37:56 +0000 (15:37 +0000)]
test commit. update comment grammatically. NFC

llvm-svn: 276425

6 years agoptx: Fix builtin names after clang r274770
Jan Vesely [Fri, 22 Jul 2016 15:00:08 +0000 (15:00 +0000)]
ptx: Fix builtin names after clang r274770

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 276423

6 years ago[Hexagon] Use loop data prefetch on Hexagon
Krzysztof Parzyszek [Fri, 22 Jul 2016 14:22:43 +0000 (14:22 +0000)]
[Hexagon] Use loop data prefetch on Hexagon

llvm-svn: 276422

6 years agoUse INT64_MAX instead of LLONG_MAX
Reid Kleckner [Fri, 22 Jul 2016 14:11:58 +0000 (14:11 +0000)]
Use INT64_MAX instead of LLONG_MAX

llvm-svn: 276419

6 years ago[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with generic IR
Simon Pilgrim [Fri, 22 Jul 2016 13:58:56 +0000 (13:58 +0000)]
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with generic IR

As discussed on D22460, I've updated the vbroadcastf128 pd256/ps256 builtins to map directly to generic IR - load+splat a 128-bit vector to both lanes of a 256-bit vector.

Fix for PR28657.

llvm-svn: 276417

6 years ago[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 (reapplied)
Simon Pilgrim [Fri, 22 Jul 2016 13:58:44 +0000 (13:58 +0000)]
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 (reapplied)

As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

Reapplied with fix for PR28657 - removed intrinsic definitions (clang companion patch to be be submitted shortly).

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

llvm-svn: 276416

6 years agoRevert "Revert "[clang-tidy] new cppcoreguidelines-slicing""
Clement Courbet [Fri, 22 Jul 2016 13:45:00 +0000 (13:45 +0000)]
Revert "Revert "[clang-tidy] new cppcoreguidelines-slicing""

Second try for r276408

llvm-svn: 276415

6 years ago[clang-rename] introduce better symbol finding
Kirill Bobyrev [Fri, 22 Jul 2016 13:41:09 +0000 (13:41 +0000)]
[clang-rename] introduce better symbol finding

This patch introduces:

* TypeLoc visiting, which helps a lot in renaming types
* NestedNameSpecifierLoc visiting (through getting them via ASTMatcher at the moment, though, because RecursiveASTVisitor<T>::VisitNestedNameSpecifierLoc isn't implemented), which helps to treat nested names correctly
* better code formatting and refactoring
* bunch of tests

Reviewers: alexfh

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

llvm-svn: 276414

6 years agoRevert "[clang-tidy] new cppcoreguidelines-slicing"
Clement Courbet [Fri, 22 Jul 2016 13:33:51 +0000 (13:33 +0000)]
Revert "[clang-tidy] new cppcoreguidelines-slicing"

Tests fail on clang-x64-ninja-win7 due to too narrow expectation.

llvm-svn: 276413

6 years agoSupport loading files even when incorrect file name specified by the linker
Tamas Berghammer [Fri, 22 Jul 2016 12:55:35 +0000 (12:55 +0000)]
Support loading files even when incorrect file name specified by the linker

"Incorrect" file name seen on Android whene the main executable is
called "app_process32" (or 64) but the linker specifies the package
name (e.g. com.android.calculator2). Additionally it can be present
in case of some linker bugs.

This CL adds logic to try to fetch the correct file name from the proc
file system based on the base address sepcified by the linker in case
we are failed to load the module by name.

Differential revision: http://reviews.llvm.org/D22219

llvm-svn: 276411

6 years ago[FastISel] Ignore @llvm.assume.
Ahmed Bougacha [Fri, 22 Jul 2016 12:54:53 +0000 (12:54 +0000)]
[FastISel] Ignore @llvm.assume.

llvm-svn: 276410

6 years ago[llvm-cov] - Add the coverage of lines in the summary report.
Ying Yi [Fri, 22 Jul 2016 12:46:13 +0000 (12:46 +0000)]
[llvm-cov] - Add the coverage of lines in the summary report.

The llvm-cov ‘report' command displays a summary of the coverage of a binary file.
The summary report currently only includes covered regions and covered functions.
This patch adds the coverage of lines in the summary report.

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

llvm-svn: 276409

6 years ago[clang-tidy] new cppcoreguidelines-slicing
Clement Courbet [Fri, 22 Jul 2016 12:42:19 +0000 (12:42 +0000)]
[clang-tidy] new cppcoreguidelines-slicing

Flags slicing of member variables or vtable. See:

https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es63-dont-slice
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c145-access-polymorphic-objects-through-pointers-and-references

Differential revision:
http://reviews.llvm.org/D21974

llvm-svn: 276408

6 years ago[llvm-profdata] Bring back reading profile data from STDIN.
Benjamin Kramer [Fri, 22 Jul 2016 12:39:55 +0000 (12:39 +0000)]
[llvm-profdata] Bring back reading profile data from STDIN.

This feature was lost in r276197.

llvm-svn: 276407

6 years agoFixing layout of elf-core file related structures
Pavel Labath [Fri, 22 Jul 2016 12:18:45 +0000 (12:18 +0000)]
Fixing layout of elf-core file related structures

Summary:
The binary layout of prstatus and prpsinfo was wrong.
Some of the member variables where not aligned properly
and others where with a wrong type (e.g. the time related
stuff in prstatus).

I used the structs defined in bfd in binutils to see what the layout
of the elf-core format in these section is.
(https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/hosts/x86-64linux.h;h=4e420a1f2081dd3b51f5d6b7a8e4093580f5cdb5;hb=master)
Note: those structures are only for x86 64 bit elf-core files

This shouldn't have any impact on the functionality, because
lldb actually uses only a few of the member variables of those structs
and they are with a correct type and alignment.

I found this while trying to add/fix the support for
i386 core files (https://llvm.org/bugs/show_bug.cgi?id=26947)

Reviewers: labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D22628
Author: Dimitar Vlahovski <dvlahovski@google.com>

llvm-svn: 276406

6 years agoRevert "[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128"
Benjamin Kramer [Fri, 22 Jul 2016 11:03:10 +0000 (11:03 +0000)]
Revert "[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128"

It caused PR28657.

This reverts commit r276281.

llvm-svn: 276405

6 years ago[llvm-cov] - Improve llvm-cov error message
Ying Yi [Fri, 22 Jul 2016 10:52:21 +0000 (10:52 +0000)]
[llvm-cov] - Improve llvm-cov error message

Summary:

When giving the following command:
% llvm-cov report -instr-profile=default.profraw

llvm-cov will give the following error message:

>llvm-cov report: Not enough positional command line arguments specified!
>Must specify at least 1 positional arguments: See: orbis-llvm-cov report -help

This patch changes the error message from  '1 positional arguments'
to '1 positional argument'.

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

llvm-svn: 276404

6 years agoFix a crash when an ELF section symbol have no name
Tamas Berghammer [Fri, 22 Jul 2016 10:43:03 +0000 (10:43 +0000)]
Fix a crash when an ELF section symbol have no name

llvm-svn: 276403

6 years ago[compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation.
Daniel Sanders [Fri, 22 Jul 2016 10:15:09 +0000 (10:15 +0000)]
[compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation.

Allowing this variable to be cached makes it possible to repair the MIPS
buildbots in lieu of either fixing the mips64 sanitizer issues or fixing the
detection of mips64 support (which I think was changed by r268977 but didn't
take effect on this buildbot until the last couple days) so that it returns to
not being built on these buildbots.

llvm-svn: 276402

6 years agotest commit
Ying Yi [Fri, 22 Jul 2016 09:20:21 +0000 (09:20 +0000)]
test commit

llvm-svn: 276401

6 years ago[include-fixer] Fix faulty sort predicate.
Benjamin Kramer [Fri, 22 Jul 2016 09:07:16 +0000 (09:07 +0000)]
[include-fixer] Fix faulty sort predicate.

Note the == on the last line, this isn't a strict-weak ordering.

llvm-svn: 276400

6 years agoThis refactoring of ARM machine block size computation creates two utility
Sjoerd Meijer [Fri, 22 Jul 2016 08:39:12 +0000 (08:39 +0000)]
This refactoring of ARM machine block size computation creates two utility
functions so that the size computation is available not only in ConstantIslands
but in other passes as well.

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

llvm-svn: 276399

6 years ago[ELF] Support PROVIDE and PROVIDE_HIDDEN inside SECTIONS
Eugene Leviant [Fri, 22 Jul 2016 07:38:40 +0000 (07:38 +0000)]
[ELF] Support PROVIDE and PROVIDE_HIDDEN inside SECTIONS

llvm-svn: 276398

6 years ago[mips][microMIPS] Implement SLT, SLTI, SLTIU, SLTU microMIPS32r6 instructions
Hrvoje Varga [Fri, 22 Jul 2016 07:18:33 +0000 (07:18 +0000)]
[mips][microMIPS] Implement SLT, SLTI, SLTIU, SLTU microMIPS32r6 instructions
Differential Revision: https://reviews.llvm.org/D19906

llvm-svn: 276397

6 years agoGPGPU: Generate PTX assembly code for the kernel modules
Tobias Grosser [Fri, 22 Jul 2016 07:11:12 +0000 (07:11 +0000)]
GPGPU: Generate PTX assembly code for the kernel modules

Run the NVPTX backend over the GPUModule IR and write the resulting assembly
code in a string.

To work correctly, it is important to invalidate analysis results that still
reference the IR in the kernel module. Hence, this change clears all references
to dominators, loop info, and scalar evolution.

Finally, the NVPTX backend has troubles to generate code for various special
floating point types (not surprising), but also for uncommon integer types. This
commit does not resolve these issues, but pulls out problematic test cases into
separate files to XFAIL them individually and resolve them in future (not
immediate) changes one by one.

llvm-svn: 276396

6 years ago[ELF][MIPS] Apply mask while reading implicit addend and writing result of R_MIPS_26...
Simon Atanasyan [Fri, 22 Jul 2016 05:56:43 +0000 (05:56 +0000)]
[ELF][MIPS] Apply mask while reading implicit addend and writing result of R_MIPS_26 relocation.

llvm-svn: 276395

6 years ago[AVX512] Add ExeDomain to vector extend and truncate instructions.
Craig Topper [Fri, 22 Jul 2016 05:46:44 +0000 (05:46 +0000)]
[AVX512] Add ExeDomain to vector extend and truncate instructions.

llvm-svn: 276394

6 years ago[AVX512] Add initial support for the Execution Domain fixing pass to change some...
Craig Topper [Fri, 22 Jul 2016 05:00:52 +0000 (05:00 +0000)]
[AVX512] Add initial support for the Execution Domain fixing pass to change some EVEX instructions.

llvm-svn: 276393

6 years ago[AVX512] Fix the ExeDomain for some packed fp instructions.
Craig Topper [Fri, 22 Jul 2016 05:00:42 +0000 (05:00 +0000)]
[AVX512] Fix the ExeDomain for some packed fp instructions.

llvm-svn: 276392

6 years ago[AVX512] Add load folding for some AVX512VL logic and arithmetic instructions.
Craig Topper [Fri, 22 Jul 2016 05:00:39 +0000 (05:00 +0000)]
[AVX512] Add load folding for some AVX512VL logic and arithmetic instructions.

llvm-svn: 276391

6 years ago[AVX512] Update X86InstrInfo::foldMemoryOperandCustom to handle the EVEX encoded...
Craig Topper [Fri, 22 Jul 2016 05:00:35 +0000 (05:00 +0000)]
[AVX512] Update X86InstrInfo::foldMemoryOperandCustom to handle the EVEX encoded instructions too.

llvm-svn: 276390

6 years agoDon't remove side effecting instructions due to ConstantFoldInstruction
David Majnemer [Fri, 22 Jul 2016 04:54:44 +0000 (04:54 +0000)]
Don't remove side effecting instructions due to ConstantFoldInstruction

Just because we can constant fold the result of an instruction does not
imply that we can delete the instruction.  It may have side effects.

This fixes PR28655.

llvm-svn: 276389

6 years agoSync up InstrProfData.inc with compiler-rt with fixes to references
Xinliang David Li [Fri, 22 Jul 2016 04:46:56 +0000 (04:46 +0000)]
Sync up InstrProfData.inc with compiler-rt with fixes to references

llvm-svn: 276388

6 years agoRevert 276386
Xinliang David Li [Fri, 22 Jul 2016 04:31:26 +0000 (04:31 +0000)]
Revert 276386

llvm-svn: 276387

6 years agoSync up InstrProfData.inc with compiler-rt
Xinliang David Li [Fri, 22 Jul 2016 04:18:17 +0000 (04:18 +0000)]
Sync up InstrProfData.inc with compiler-rt

llvm-svn: 276386

6 years ago[Profile] cleanup: do not reference name directly of vars shared between rt and llvm
Xinliang David Li [Fri, 22 Jul 2016 04:08:16 +0000 (04:08 +0000)]
[Profile] cleanup: do not reference name directly of vars shared between rt and llvm

llvm-svn: 276385

6 years ago[ELF/LinkerScript] Support ONLY_IF_{RO, RW} directive.
Davide Italiano [Fri, 22 Jul 2016 03:36:24 +0000 (03:36 +0000)]
[ELF/LinkerScript] Support ONLY_IF_{RO, RW} directive.

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

llvm-svn: 276384

6 years ago[sanitizer] refactor TransferBatch to hide the implementation. NFC
Kostya Serebryany [Fri, 22 Jul 2016 02:21:12 +0000 (02:21 +0000)]
[sanitizer] refactor TransferBatch to hide the implementation. NFC

llvm-svn: 276383

6 years agoFix r276380 for targets without REALPATH.
Pete Cooper [Fri, 22 Jul 2016 01:52:58 +0000 (01:52 +0000)]
Fix r276380 for targets without REALPATH.

This was a mistake in the layout of the code from r276380.  I moved the appropriate lines out of the #ifdef to fix it.

llvm-svn: 276382

6 years agoFix test on windows, symbolizer returns invalid line
Vitaly Buka [Fri, 22 Jul 2016 01:47:28 +0000 (01:47 +0000)]
Fix test on windows, symbolizer returns invalid line

llvm-svn: 276381

6 years agoAvoid dsymutil calls to getFileNameByIndex.
Pete Cooper [Fri, 22 Jul 2016 01:41:32 +0000 (01:41 +0000)]
Avoid dsymutil calls to getFileNameByIndex.

This change adds a hasFileAtIndex method. getChildDeclContext can first call this method, and if it returns true it knows it can then lookup the resolved path cache for the given file index. If we hit that cache then we don't even have to call getFileNameByIndex.

Running dsymutil against the swift executable built from github gives a 20% performance improvement without any change in the binary.

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

Reviewed by friss.

llvm-svn: 276380

6 years ago[asan] revert to using -std=c++11 on test/asan/TestCases/use-after-scope-capture...
Kostya Serebryany [Fri, 22 Jul 2016 01:34:32 +0000 (01:34 +0000)]
[asan] revert to using -std=c++11 on  test/asan/TestCases/use-after-scope-capture.cc to fix Linux failures after r276332. This probably breaks the windows build, sorry, but returns to the earlier status quo.

llvm-svn: 276379

6 years agofix windows
Vitaly Buka [Fri, 22 Jul 2016 01:34:12 +0000 (01:34 +0000)]
fix windows

llvm-svn: 276378

6 years ago[sanitizer] allocator: introduce kUseSeparateSizeClassForBatch (false by default...
Kostya Serebryany [Fri, 22 Jul 2016 01:13:13 +0000 (01:13 +0000)]
[sanitizer] allocator: introduce kUseSeparateSizeClassForBatch (false by default). When true, it will cause all TransferBatches to be allocated on a separate dedicated size class, which improves security and may potentially simplify memory reclamation. However in the current state this may cause up to 3% extra memory usage. Subsequent changes should bring this overhead down

llvm-svn: 276377

6 years agoFix test on windows
Vitaly Buka [Fri, 22 Jul 2016 01:12:04 +0000 (01:12 +0000)]
Fix test on windows

llvm-svn: 276376

6 years agoAdd test to check detection of stack-use-after-scope on various types
Vitaly Buka [Fri, 22 Jul 2016 00:58:06 +0000 (00:58 +0000)]
Add test to check detection of stack-use-after-scope on various types

Summary:
Test for D22657

PR27453

Reviewers: kcc, eugenis

Subscribers: kubabrecka

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

llvm-svn: 276375

6 years agoFix detection of stack-use-after scope for char arrays.
Vitaly Buka [Fri, 22 Jul 2016 00:56:17 +0000 (00:56 +0000)]
Fix detection of stack-use-after scope for char arrays.

Summary:
Clang inserts GetElementPtrInst so findAllocaForValue was not
able to find allocas.

PR27453

Reviewers: kcc, eugenis

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

llvm-svn: 276374

6 years ago[IRCE] Don't misuse CHECK-LABEL; NFC
Sanjoy Das [Fri, 22 Jul 2016 00:41:02 +0000 (00:41 +0000)]
[IRCE] Don't misuse CHECK-LABEL; NFC

llvm-svn: 276373

6 years ago[IRCE] Add an option to skip profitability checks
Sanjoy Das [Fri, 22 Jul 2016 00:40:56 +0000 (00:40 +0000)]
[IRCE] Add an option to skip profitability checks

If `-irce-skip-profitability-checks` is passed in, IRCE will kick in in
all cases where it is legal for it to kick in.  This flag is intended to
help diagnose and analyse performance issues.

llvm-svn: 276372

6 years agoRestructure release notes.
Eugene Zelenko [Fri, 22 Jul 2016 00:34:42 +0000 (00:34 +0000)]
Restructure release notes.

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

llvm-svn: 276371

6 years ago[Coverage] Attempt to appease a Windows builder
Vedant Kumar [Fri, 22 Jul 2016 00:25:09 +0000 (00:25 +0000)]
[Coverage] Attempt to appease a Windows builder

The builder prints out the following IR:

  \5CCoverageMapping\5COutput\5Ctest\5Cf1.c

The updated test in r276367 expects path separators to be either '/' or
'\\', so it chokes on the unexpected "5C" stuff. I'm not sure what that
is, but I included a kludge that should work around it.

Failing bot:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8718

llvm-svn: 276370

6 years agoAdd support to get the shared cache information from the new
Jason Molenda [Fri, 22 Jul 2016 00:17:55 +0000 (00:17 +0000)]
Add support to get the shared cache information from the new
debugserver jGetSharedCacheInfo packet instead of reading
the dyld internal data structures directly.  This code is
(currently) only used for ios native lldb's - I should really
move this ObjectFileMachO::GetProcessSharedCacheUUID method
somewhere else, it makes less and less sense being in the
file reader.

<rdar://problem/25251243>

llvm-svn: 276369

6 years agoGVN-hoist: move check before mutating the IR
Sebastian Pop [Fri, 22 Jul 2016 00:07:01 +0000 (00:07 +0000)]
GVN-hoist: move check before mutating the IR

llvm-svn: 276368

6 years ago[Coverage] Strengthen a test case
Vedant Kumar [Fri, 22 Jul 2016 00:00:02 +0000 (00:00 +0000)]
[Coverage] Strengthen a test case

We should be able to use `mkdir` without turning on `REQUIRES: shell`.
Moreover, this test should check for a path separator which precedes the
relative filename to make sure that absolute paths are being used.

llvm-svn: 276367

6 years ago[AArch64] Cleanup sign extend in genAlternativeCodeSequence
David Majnemer [Thu, 21 Jul 2016 23:46:56 +0000 (23:46 +0000)]
[AArch64] Cleanup sign extend in genAlternativeCodeSequence

Use the machinery in MathExtras instead of rolling it by hand.

This fixes PR28624.

llvm-svn: 276366

6 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Thu, 21 Jul 2016 23:42:31 +0000 (23:42 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

This reapplies r275820 after fixing a string-lifetime issue discovered by the
bots.

A patch by Ádám Balogh!

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

llvm-svn: 276365

6 years agoGVN-hoist: add missing check for all GEP operands available
Sebastian Pop [Thu, 21 Jul 2016 23:32:39 +0000 (23:32 +0000)]
GVN-hoist: add missing check for all GEP operands available

llvm-svn: 276364

6 years ago[llvm-cov] Strengthen a test case
Vedant Kumar [Thu, 21 Jul 2016 23:31:26 +0000 (23:31 +0000)]
[llvm-cov] Strengthen a test case

Check that stylesheets work when we're not using -output-dir.

llvm-svn: 276363

6 years ago[Sparc]: Fix bug in LowerSTORE due to r275592
Douglas Katzman [Thu, 21 Jul 2016 23:28:54 +0000 (23:28 +0000)]
[Sparc]: Fix bug in LowerSTORE due to r275592

llvm-svn: 276362

6 years agoReverting r275115 which caused PR28634.
Wolfgang Pieb [Thu, 21 Jul 2016 23:28:18 +0000 (23:28 +0000)]
Reverting r275115 which caused PR28634.
When empty (forwarding) basic blocks that are referenced by user labels
are removed, incorrect code may be generated.

llvm-svn: 276361

6 years ago[InstCombine] break up foldICmpEqualityWithConstant(); NFCI
Sanjay Patel [Thu, 21 Jul 2016 23:27:36 +0000 (23:27 +0000)]
[InstCombine] break up foldICmpEqualityWithConstant(); NFCI

Almost all of these folds require changes to allow vector types.
Splitting up the logic should make that easier to do incrementally.

llvm-svn: 276360

6 years ago[llvm-cov] Use relative paths to the stylesheet (for html reports)
Vedant Kumar [Thu, 21 Jul 2016 23:26:15 +0000 (23:26 +0000)]
[llvm-cov] Use relative paths to the stylesheet (for html reports)

This makes it easy to swap out the default stylesheet for a custom one.
It also shaves ~6.62 MB out of the report directory for a full coverage
build of llvm+clang.

While we're at it, prune the CSS and add tests for it.

llvm-svn: 276359

6 years agoGVH-hoist: only clone GEPs (PR28606)
Sebastian Pop [Thu, 21 Jul 2016 23:22:10 +0000 (23:22 +0000)]
GVH-hoist: only clone GEPs (PR28606)

Do not clone stored values unless they are GEPs that are special cased to avoid
hoisting them without hoisting their associated ld/st.

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

llvm-svn: 276358

6 years ago[lit] Use full config path in diagnostics.
Daniel Dunbar [Thu, 21 Jul 2016 23:20:41 +0000 (23:20 +0000)]
[lit] Use full config path in diagnostics.

 - This allows tools like emacs to automatically find the config file path when
   you step through errors.

 - Patch by Dave Abrahams.

llvm-svn: 276357

6 years ago[profile] update test case with interface change.
Xinliang David Li [Thu, 21 Jul 2016 23:19:39 +0000 (23:19 +0000)]
[profile] update test case with interface change.

See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614

llvm-svn: 276356

6 years ago[Profile] deprecate __llvm_profile_override_default_filename (part2)
Xinliang David Li [Thu, 21 Jul 2016 23:19:18 +0000 (23:19 +0000)]
[Profile] deprecate __llvm_profile_override_default_filename (part2)

This eliminates unncessary calls and init functions.

Differential Revision: http://reviews.llvm.org/D22614

llvm-svn: 276355

6 years ago[Profile] deprecate __llvm_profile_override_default_filename
Xinliang David Li [Thu, 21 Jul 2016 23:19:10 +0000 (23:19 +0000)]
[Profile] deprecate __llvm_profile_override_default_filename

This eliminates unncessary calls and init functions.

Differential Revision: http://reviews.llvm.org/D22613

llvm-svn: 276354

6 years ago[lit] Bump version number.
Daniel Dunbar [Thu, 21 Jul 2016 23:17:44 +0000 (23:17 +0000)]
[lit] Bump version number.

llvm-svn: 276353

6 years ago[Sema] Handle errors during rewriteBuiltinFunctionDecl
David Majnemer [Thu, 21 Jul 2016 23:03:43 +0000 (23:03 +0000)]
[Sema] Handle errors during rewriteBuiltinFunctionDecl

rewriteBuiltinFunctionDecl can encounter errors when performing
DefaultFunctionArrayLvalueConversion.  These errors were not handled
which led to a null pointer dereference.

This fixes PR28651.

llvm-svn: 276352

6 years agoStop printing double { characters on Dictionary StructuredData objects
Jason Molenda [Thu, 21 Jul 2016 22:50:01 +0000 (22:50 +0000)]
Stop printing double { characters on Dictionary StructuredData objects
when Dumping, thanks to Devin to catching the edit mistake I made in
r276079.

llvm-svn: 276351

6 years ago[CodeGen] Fix a crash when constant folding switch statement
Erik Pilkington [Thu, 21 Jul 2016 22:31:40 +0000 (22:31 +0000)]
[CodeGen] Fix a crash when constant folding switch statement

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

llvm-svn: 276350

6 years ago[PM] Port NaryReassociate to the new PM
Wei Mi [Thu, 21 Jul 2016 22:28:52 +0000 (22:28 +0000)]
[PM] Port NaryReassociate to the new PM

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

llvm-svn: 276349

6 years ago[MIRTesting] Abort when failing to parse a function.
Quentin Colombet [Thu, 21 Jul 2016 22:25:57 +0000 (22:25 +0000)]
[MIRTesting] Abort when failing to parse a function.

When we failed to parse a function in the mir parser, we should abort
the whole compilation instead of continuing in a weird state. Indeed,
this was creating strange machine function passes failures that were
hard to understand, until we notice that the function actually did not
get parsed correctly!

llvm-svn: 276348

6 years ago[X86] Do not use AND8ri8 in AVX512 pattern
Michael Kuperstein [Thu, 21 Jul 2016 22:24:08 +0000 (22:24 +0000)]
[X86] Do not use AND8ri8 in AVX512 pattern

This variant is (as documented in the TD) for disassembler use only, and should
not be used in patterns - it is longer, and is broken on 64-bit.

llvm-svn: 276347

6 years ago[sanitizer] trying to fix Mac bots
Kostya Serebryany [Thu, 21 Jul 2016 22:18:36 +0000 (22:18 +0000)]
[sanitizer] trying to fix Mac  bots

llvm-svn: 276346

6 years ago[InstSimplify] don't crash handling a pointer or aggregate type
Sanjay Patel [Thu, 21 Jul 2016 21:56:00 +0000 (21:56 +0000)]
[InstSimplify] don't crash handling a pointer or aggregate type

llvm-svn: 276345

6 years ago[AArch64][Inline-Asm] Return the 32-bit floating point register class
Akira Hatanaka [Thu, 21 Jul 2016 21:39:05 +0000 (21:39 +0000)]
[AArch64][Inline-Asm] Return the 32-bit floating point register class
when constraint "w" is used on a 32-bit operand.

This enables compiling the following code, which used to error out in
the backend:

void foo1(int a) {
  asm volatile ("sqxtn h0, %s0\n" : : "w"(a):);
}

Fixes PR28633.

llvm-svn: 276344