platform/upstream/llvm.git
7 years agoDo not set branch weight if the branch weight annotation is present.
Dehao Chen [Thu, 23 Mar 2017 14:43:10 +0000 (14:43 +0000)]
Do not set branch weight if the branch weight annotation is present.

Summary: ThinLTO will annotate the CFG twice. If the branch weight is set by the first annotation, we should not set the branch weight again in the second annotation because the first annotation is more accurate as there is less optimization that could affect debug info accuracy.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: mehdi_amini, aprantl, llvm-commits

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

llvm-svn: 298602

7 years ago[libcxx] Improve code generation for vector::clear().
Bruce Mitchener [Thu, 23 Mar 2017 14:39:23 +0000 (14:39 +0000)]
[libcxx] Improve code generation for vector::clear().

Summary:
By manipulating a local variable in the loop, when the loop can
be optimized away (due to no non-trivial destructors), this lets
it be fully optimized away and we modify the __end_ separately.

This results in a substantial improvement in the generated code.

Prior to this change, this would be generated (on x86_64):

    movq    (%rdi), %rdx
    movq    8(%rdi), %rcx
    cmpq    %rdx, %rcx
    je    LBB2_2
    leaq    -12(%rcx), %rax
    subq    %rdx, %rax
    movabsq    $-6148914691236517205, %rdx ## imm = 0xAAAAAAAAAAAAAAAB
    mulq    %rdx
    shrq    $3, %rdx
    notq    %rdx
    leaq    (%rdx,%rdx,2), %rax
    leaq    (%rcx,%rax,4), %rax
    movq    %rax, 8(%rdi)

And after:

    movq    (%rdi), %rax
    movq    %rax, 8(%rdi)

This brings this in line with what other implementations do.

Subscribers: cfe-commits

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

llvm-svn: 298601

7 years agoUse 'REQUIRES: c++98 || c++03 || c++11 || c++14' instead of the deprecated 'REQUIRES...
Marshall Clow [Thu, 23 Mar 2017 14:20:43 +0000 (14:20 +0000)]
Use 'REQUIRES: c++98 || c++03 || c++11 || c++14' instead of the deprecated 'REQUIRES-ANY: c++98, c++03, c++11, c++14'

llvm-svn: 298600

7 years agoX86FixupBWInsts: Minor cleanup. NFC
Zvi Rackover [Thu, 23 Mar 2017 14:08:26 +0000 (14:08 +0000)]
X86FixupBWInsts: Minor cleanup. NFC

Summary: Cleanup some remnants of code from when the X86FixupBWInsts pass did both forward liveness analysis and backward liveness analysis.

Reviewers: MatzeB, myatsina, DavidKreitzer

Reviewed By: MatzeB

Subscribers: llvm-commits

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

llvm-svn: 298599

7 years agoOne more file for the random_shuffle removal
Marshall Clow [Thu, 23 Mar 2017 13:44:06 +0000 (13:44 +0000)]
One more file for the random_shuffle removal

llvm-svn: 298598

7 years agoRemove random_shuffle in C++17. Please use shuffle instead. If you have to, you...
Marshall Clow [Thu, 23 Mar 2017 13:43:37 +0000 (13:43 +0000)]
Remove random_shuffle in C++17.  Please use shuffle instead. If you have to, you cant get it back by defining _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE before including any libc++ headers.

llvm-svn: 298597

7 years ago[Mips] Emit the correct DINS variant
Strahinja Petrovic [Thu, 23 Mar 2017 13:40:07 +0000 (13:40 +0000)]
[Mips] Emit the correct DINS variant

This patch fixes emitting of correct variant of DINS instruction.

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

llvm-svn: 298596

7 years agoUpdate to isl-0.18-402-ga30c537
Tobias Grosser [Thu, 23 Mar 2017 13:38:24 +0000 (13:38 +0000)]
Update to isl-0.18-402-ga30c537

This is a regular maintenance update.

llvm-svn: 298595

7 years ago[X86][SSE] Tidyup canWidenShuffleElements. NFCI.
Simon Pilgrim [Thu, 23 Mar 2017 13:33:03 +0000 (13:33 +0000)]
[X86][SSE] Tidyup canWidenShuffleElements. NFCI.

Pull out mask elements at the start, allowing us to make the widening pattern matching more readable.

llvm-svn: 298594

7 years ago[Mips] Fix for decoding DINS instruction - disassembler
Strahinja Petrovic [Thu, 23 Mar 2017 13:19:04 +0000 (13:19 +0000)]
[Mips] Fix for decoding DINS instruction - disassembler

This patch fixes decoding of size and position for DINSM
and DINSU instructions.

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

llvm-svn: 298593

7 years ago[X86][SSE] Add computeNumSignBits test for sitofp of (extended) i64 extracted element
Simon Pilgrim [Thu, 23 Mar 2017 13:18:09 +0000 (13:18 +0000)]
[X86][SSE] Add computeNumSignBits test for sitofp of (extended) i64 extracted element

llvm-svn: 298592

7 years ago[ELF] Print two more MIPS targets "supported" by LLD
Simon Atanasyan [Thu, 23 Mar 2017 12:17:32 +0000 (12:17 +0000)]
[ELF] Print two more MIPS targets "supported" by LLD

These targets are related to MIPS N32 ABI.

llvm-svn: 298591

7 years ago[GlobalISel][X86] clang-format. NFC
Igor Breger [Thu, 23 Mar 2017 12:13:29 +0000 (12:13 +0000)]
[GlobalISel][X86] clang-format. NFC

llvm-svn: 298590

7 years agoSupport attributes for Objective-C categories
Alex Lorenz [Thu, 23 Mar 2017 11:44:25 +0000 (11:44 +0000)]
Support attributes for Objective-C categories

rdar://31095315

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

llvm-svn: 298589

7 years ago[CodeGen] Emit a CoreFoundation link guard when @available is used
Alex Lorenz [Thu, 23 Mar 2017 11:14:27 +0000 (11:14 +0000)]
[CodeGen] Emit a CoreFoundation link guard when @available is used

After r297760, __isOSVersionAtLeast in compiler-rt loads the CoreFoundation
symbols at runtime. This means that `@available` will always fail when used in a
binary without a linked CoreFoundation.

This commit forces Clang to emit a reference to a CoreFoundation symbol when
`@available` is used to ensure that linking will fail when CoreFoundation isn't
linked with the build product.

rdar://31039592

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

llvm-svn: 298588

7 years ago[ObjC][ARC] Avoid -Warc-performSelector-leaks for performSelector variations
Alex Lorenz [Thu, 23 Mar 2017 10:46:05 +0000 (10:46 +0000)]
[ObjC][ARC] Avoid -Warc-performSelector-leaks for performSelector variations
that became supported after r297019

The commit r297019 expanded the performSelector ObjC method family heuristic
to ensure that -Wobjc-unsafe-perform-selector covers all performSelector
variations. However, this made the -Warc-performSelector-leaks too noisy, as
that warning produces mostly false positives since the selector is unknown.
This commit reverts the ObjC method family heuristics introduced in r297019.
This ensures that -Warc-performSelector-leaks isn't too noisy. The commit still
preserves the coverage of -Wobjc-unsafe-perform-selector.

rdar://31124629

llvm-svn: 298587

7 years ago[X86][TD][vpmovm2 ] New TD pattern for the vpmovm2 instruction
Michael Zuckerman [Thu, 23 Mar 2017 09:57:01 +0000 (09:57 +0000)]
[X86][TD][vpmovm2 ] New TD pattern for the vpmovm2 instruction

Up until now, vpmovm2 instruction described its destination operand size
by the source operand size. This patch adds new pattern for the vpmovm2
instruction. The node describes new expansion of the destination (from
{128|256} to 512).

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

llvm-svn: 298586

7 years agoFix warnings from clang build on macOS.
Bruce Mitchener [Thu, 23 Mar 2017 09:52:26 +0000 (09:52 +0000)]
Fix warnings from clang build on macOS.

Reviewers: lldb-commits

Subscribers: lldb-commits

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

llvm-svn: 298585

7 years ago[ValueTracking] Use APInt::isNegative instead of using operator[BitWidth-1]. NFCI
Craig Topper [Thu, 23 Mar 2017 07:06:42 +0000 (07:06 +0000)]
[ValueTracking] Use APInt::isNegative instead of using operator[BitWidth-1]. NFCI

llvm-svn: 298584

7 years ago[ValueTracking] Use setAllBits/setSignBit/setLowBits/setHighBits. NFCI
Craig Topper [Thu, 23 Mar 2017 07:06:39 +0000 (07:06 +0000)]
[ValueTracking] Use setAllBits/setSignBit/setLowBits/setHighBits. NFCI

llvm-svn: 298583

7 years agoSilence a couple of 'unused variable' warnings in c++03 tests. No functional change
Marshall Clow [Thu, 23 Mar 2017 06:25:26 +0000 (06:25 +0000)]
Silence a couple of 'unused variable' warnings in c++03 tests. No functional change

llvm-svn: 298582

7 years agoWorked around GCC bug 56480. Explicit specialization in a different namespace.
Michael Park [Thu, 23 Mar 2017 06:21:24 +0000 (06:21 +0000)]
Worked around GCC bug 56480. Explicit specialization in a different namespace.

Summary: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

Reviewers: EricWF

Reviewed By: EricWF

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

llvm-svn: 298581

7 years agoCan't test for noexcept on C++03; std::hash<nullptr_t> isn't available until C++17
Marshall Clow [Thu, 23 Mar 2017 06:20:18 +0000 (06:20 +0000)]
Can't test for noexcept on C++03; std::hash<nullptr_t> isn't available until C++17

llvm-svn: 298580

7 years ago[IR] Use a binary search in DataLayout::getAlignmentInfo
Craig Topper [Thu, 23 Mar 2017 06:15:56 +0000 (06:15 +0000)]
[IR] Use a binary search in DataLayout::getAlignmentInfo

Summary:
We currently do a linear scan through all of the Alignments array entries anytime getAlignmentInfo is called. I noticed while profiling compile time on a -O2 opt run that this function can be called quite frequently and was showing about as about 1% of the time in callgrind.

This patch puts the Alignments array into a sorted order by type and then by bitwidth. We can then do a binary search. And use the sorted nature to handle the special cases for INTEGER_ALIGN. Some of this is modeled after the sorting/searching we do for pointers already.

This reduced the time spent in this routine by about 2/3 in the one compilation I was looking at.

We could maybe improve this more by using a DenseMap to cache the results, but just sorting was easy and didn't require extra data structure. And I think it made the integer handling simpler.

Reviewers: sanjoy, davide, majnemer, resistor, arsenm, mehdi_amini

Reviewed By: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 298579

7 years ago[IR] Mark Use::getUser and Use::getImpliedUse as LLVM_READONLY.
Craig Topper [Thu, 23 Mar 2017 05:25:25 +0000 (05:25 +0000)]
[IR] Mark Use::getUser and Use::getImpliedUse as LLVM_READONLY.

llvm-svn: 298578

7 years ago[ELF] Allow references to reserved symbols in linker scripts
Petr Hosek [Thu, 23 Mar 2017 03:52:34 +0000 (03:52 +0000)]
[ELF] Allow references to reserved symbols in linker scripts

This requires collectign all symbols referenced in the linker script
and adding them to symbol table as undefined symbol.

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

llvm-svn: 298577

7 years agoSimplify. No functionality change intended.
Rui Ueyama [Thu, 23 Mar 2017 03:44:08 +0000 (03:44 +0000)]
Simplify. No functionality change intended.

I honestly do not understand this part of code as it is too tangled.
What I'm trying now is to carefully disentangle it by transforming
code without changing meaining to see if I can improve overall
readability.

llvm-svn: 298576

7 years agoRemove unnecessary local variable.
Rui Ueyama [Thu, 23 Mar 2017 03:11:03 +0000 (03:11 +0000)]
Remove unnecessary local variable.

llvm-svn: 298575

7 years agoFix issues in clang-format's AlignConsecutive modes.
Nikola Smiljanic [Thu, 23 Mar 2017 02:51:25 +0000 (02:51 +0000)]
Fix issues in clang-format's AlignConsecutive modes.

Patch by Ben Harper.

llvm-svn: 298574

7 years agoImplement P0599: 'noexcept for hash functions'. Fix a couple of hash functions (optio...
Marshall Clow [Thu, 23 Mar 2017 02:40:28 +0000 (02:40 +0000)]
Implement P0599: 'noexcept for hash functions'. Fix a couple of hash functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234

llvm-svn: 298573

7 years ago[ARM] Reduce code duplication by factoring out in a lambda. NFCI.
Davide Italiano [Thu, 23 Mar 2017 01:34:45 +0000 (01:34 +0000)]
[ARM] Reduce code duplication by factoring out in a lambda. NFCI.

llvm-svn: 298572

7 years agoRefine comment.
Rui Ueyama [Thu, 23 Mar 2017 01:19:10 +0000 (01:19 +0000)]
Refine comment.

llvm-svn: 298571

7 years agoFix Windows buildbots.
Rui Ueyama [Thu, 23 Mar 2017 01:16:57 +0000 (01:16 +0000)]
Fix Windows buildbots.

llvm-svn: 298570

7 years agoForce @{init,fini}_array if section name starts with ".{init,fini}_array.".
Rui Ueyama [Thu, 23 Mar 2017 01:00:41 +0000 (01:00 +0000)]
Force @{init,fini}_array if section name starts with ".{init,fini}_array.".

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

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

llvm-svn: 298569

7 years agoPrint out "suppoted targets".
Rui Ueyama [Thu, 23 Mar 2017 01:00:22 +0000 (01:00 +0000)]
Print out "suppoted targets".

This is to improve compatibility with GNU Libtool that expect
/supported targets:.* elf/ in a message for the -help option.

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

llvm-svn: 298568

7 years ago[ELF] Add -z nodlopen option.
Davide Italiano [Thu, 23 Mar 2017 00:54:16 +0000 (00:54 +0000)]
[ELF] Add -z nodlopen option.

Patch by Mark Kettenis.

llvm-svn: 298567

7 years agoAddress post-commit review comments regarding test_workarounds.h
Eric Fiselier [Thu, 23 Mar 2017 00:48:59 +0000 (00:48 +0000)]
Address post-commit review comments regarding test_workarounds.h

llvm-svn: 298566

7 years ago[coroutines] Implement unhandled_exception changes.
Eric Fiselier [Thu, 23 Mar 2017 00:33:33 +0000 (00:33 +0000)]
[coroutines] Implement unhandled_exception changes.

Summary:
This patch adopts the recent changes that renamed `set_exception(exception_pointer)` to `unhandled_exception()`.

Additionally `unhandled_exception()` is now required, and so an error is emitted when exceptions are enabled but the promise type does not provide the member.
When exceptions are disabled a warning is emitted instead of an error, The warning notes that the `unhandled_exception()` function is required when exceptions are enabled.

Reviewers: rsmith, GorNishanov, aaron.ballman, majnemer

Reviewed By: GorNishanov

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 298565

7 years ago[codeview] Move type index remapping logic to type merger
Reid Kleckner [Thu, 23 Mar 2017 00:14:23 +0000 (00:14 +0000)]
[codeview] Move type index remapping logic to type merger

Summary:
This removes the 'remapTypeIndices' method on every TypeRecord class. My
original idea was that this would be the beginning of some kind of
generic entry point that would enumerate all of the TypeIndices inside
of a TypeRecord, so that we could write generic graph algorithms for
them without duplicating the knowledge of which fields are type index
fields everywhere. This never happened, and nothing else uses this
method. I need to change the API to deal with merging into IPI streams,
so let's move it into the file that uses it first.

Reviewers: zturner, ruiu

Reviewed By: zturner, ruiu

Subscribers: mgorny, llvm-commits

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

llvm-svn: 298564

7 years ago[AArch64] Drive-by cleanup, make this code shorter. NFCI.
Davide Italiano [Wed, 22 Mar 2017 23:37:58 +0000 (23:37 +0000)]
[AArch64] Drive-by cleanup, make this code shorter. NFCI.

llvm-svn: 298563

7 years agoReapply r298417 "[ARM] Recommit the glueless lowering of addc/adde in Thumb1"
Artyom Skrobov [Wed, 22 Mar 2017 23:35:51 +0000 (23:35 +0000)]
Reapply r298417 "[ARM] Recommit the glueless lowering of addc/adde in Thumb1"

The UB in t2_so_imm_neg conversion has been addressed under D31242 / r298512

This reverts commit r298482.

llvm-svn: 298562

7 years agoDelete some more dead includes.
Zachary Turner [Wed, 22 Mar 2017 23:33:16 +0000 (23:33 +0000)]
Delete some more dead includes.

This breaks the cycle between Target and PluginLanguageC++, reducing
the overall cycle count from 43 to 42.

llvm-svn: 298561

7 years ago[AMDGPU] Do not emit isa info as code object metadata
Konstantin Zhuravlyov [Wed, 22 Mar 2017 23:27:09 +0000 (23:27 +0000)]
[AMDGPU] Do not emit isa info as code object metadata
  - It was decided to expose this information through other means (rocr)

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

llvm-svn: 298560

7 years ago[ARM] simplifying t2_so_imm_neg as suggested by Eli Friedman in D31242 (NFC)
Artyom Skrobov [Wed, 22 Mar 2017 23:12:59 +0000 (23:12 +0000)]
[ARM] simplifying t2_so_imm_neg as suggested by Eli Friedman in D31242 (NFC)

llvm-svn: 298559

7 years ago[AMDGPU] Emit kernel debug properties as code object metadata
Konstantin Zhuravlyov [Wed, 22 Mar 2017 23:10:46 +0000 (23:10 +0000)]
[AMDGPU] Emit kernel debug properties as code object metadata

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

llvm-svn: 298558

7 years agoRename forEach -> parallelForEach and forLoop -> parallelFor.
Rui Ueyama [Wed, 22 Mar 2017 23:03:35 +0000 (23:03 +0000)]
Rename forEach -> parallelForEach and forLoop -> parallelFor.

"Parallel" is the most important aspect of the functions,
so we shouldn't omit that.

llvm-svn: 298557

7 years ago[AMDGPU] Emit kernel code properties as code object metadata
Konstantin Zhuravlyov [Wed, 22 Mar 2017 22:54:39 +0000 (22:54 +0000)]
[AMDGPU] Emit kernel code properties as code object metadata
  - These are not required for low level runtime

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

llvm-svn: 298556

7 years agoClean up some Subtarget uses and casts in the X86 backend, removing unnecessary work...
Eric Christopher [Wed, 22 Mar 2017 22:44:52 +0000 (22:44 +0000)]
Clean up some Subtarget uses and casts in the X86 backend, removing unnecessary work or calls.

llvm-svn: 298555

7 years ago[libc++] Work around C1XX bug which breaks poisoned hash tests.
Eric Fiselier [Wed, 22 Mar 2017 22:41:41 +0000 (22:41 +0000)]
[libc++] Work around C1XX bug which breaks poisoned hash tests.

Summary: This is my attempt to work around the C1XX bug described to me by @BillyONeal.

Reviewers: BillyONeal, STL_MSFT, CaseyCarter

Reviewed By: BillyONeal

Subscribers: cfe-commits, BillyONeal

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

llvm-svn: 298554

7 years ago[x86] improve tests, add tests, auto-generate checks; NFC
Sanjay Patel [Wed, 22 Mar 2017 22:39:17 +0000 (22:39 +0000)]
[x86] improve tests, add tests, auto-generate checks; NFC

llvm-svn: 298553

7 years ago[AMDGPU] Restructure code object metadata creation
Konstantin Zhuravlyov [Wed, 22 Mar 2017 22:32:22 +0000 (22:32 +0000)]
[AMDGPU] Restructure code object metadata creation
  - Rename runtime metadata -> code object metadata
  - Make metadata not flow
  - Switch enums to use ScalarEnumerationTraits
  - Cleanup and move AMDGPUCodeObjectMetadata.h to AMDGPU/MCTargetDesc
  - Introduce in-memory representation for attributes
  - Code object metadata streamer
  - Create metadata for isa and printf during EmitStartOfAsmFile
  - Create metadata for kernel during EmitFunctionBodyStart
  - Finalize and emit metadata to .note during EmitEndOfAsmFile
  - Other minor improvements/bug fixes

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

llvm-svn: 298552

7 years ago[AMDGPU] Fix bug 31610
Konstantin Zhuravlyov [Wed, 22 Mar 2017 21:48:18 +0000 (21:48 +0000)]
[AMDGPU] Fix bug 31610

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

llvm-svn: 298551

7 years agoc++filt: support COFF import thunks
Saleem Abdulrasool [Wed, 22 Mar 2017 21:15:19 +0000 (21:15 +0000)]
c++filt: support COFF import thunks

The synthetic thunk for the import is prefixed with __imp_.  Attempt to
undecorate the names when they begin with the __imp_ prefix.

llvm-svn: 298550

7 years agoActually install scan-build / ccc-analyzer / c++-analyzer on windows
Jonathan Roelofs [Wed, 22 Mar 2017 21:13:49 +0000 (21:13 +0000)]
Actually install scan-build / ccc-analyzer / c++-analyzer on windows

Before, we were only installing the wrappers... oops.

llvm-svn: 298549

7 years ago[libFuzzer] add two experimental flags to make corpus merging more scalable: -save_co...
Kostya Serebryany [Wed, 22 Mar 2017 20:32:44 +0000 (20:32 +0000)]
[libFuzzer] add two experimental flags to make corpus merging more scalable: -save_coverage_summary/-load_coverage_summary. This is still WIP, the documentation will come later if these flags survive

llvm-svn: 298548

7 years agoMerge r298536 changes to Xcode
Tim Hammerquist [Wed, 22 Mar 2017 20:21:52 +0000 (20:21 +0000)]
Merge r298536 changes to Xcode

rdar://problem/31202813

llvm-svn: 298547

7 years ago[DeLICM] Add const qualifiers. NFC.
Michael Kruse [Wed, 22 Mar 2017 20:09:58 +0000 (20:09 +0000)]
[DeLICM] Add const qualifiers. NFC.

llvm-svn: 298546

7 years agoUse lld-link /nopdb to suppress PDB generation when DWARF is required
Reid Kleckner [Wed, 22 Mar 2017 19:49:29 +0000 (19:49 +0000)]
Use lld-link /nopdb to suppress PDB generation when DWARF is required

Fixes cfi/stats.cpp and asan/fuse-lld.cc on Windows.

llvm-svn: 298545

7 years agoAdd a /nopdb flag to disable PDB generation
Reid Kleckner [Wed, 22 Mar 2017 19:49:12 +0000 (19:49 +0000)]
Add a /nopdb flag to disable PDB generation

This will be used in the sanitizer test suite, which wants to use DWARF
line tables.

At some point we should reconsider how LLD handles the long section
names required by DWARF debug sections.

llvm-svn: 298544

7 years ago[Support] Add functions to ISLTools.
Michael Kruse [Wed, 22 Mar 2017 19:31:06 +0000 (19:31 +0000)]
[Support] Add functions to ISLTools.

Add shiftDim and convertZoneToTimepoints overloads for isl maps.

Add distributeDomain, liftDomains and applyDomainRange functions.

These are going to be used in https://reviews.llvm.org/D31247
(Add known array contents to Knowledge)

llvm-svn: 298543

7 years ago[LVI] Add an LVI printer pass to capture test LVI cache after transformations
Anna Thomas [Wed, 22 Mar 2017 19:27:12 +0000 (19:27 +0000)]
[LVI] Add an LVI printer pass to capture test LVI cache after transformations

Summary:
Adding a printer pass for printing the LVI cache values after transformations
that use LVI.
This will help us in identifying cases where LVI
invariants are violated, or transforms that leave LVI in an incorrect state.
Right now, I have added two test cases to show that the printer pass is working.
I will be adding more test cases in a later change, once this change is
checked in upstream.

Reviewers: reames, dberlin, sanjoy, apilipenko

Subscribers: llvm-commits

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

llvm-svn: 298542

7 years agoRemove dead include from GoASTContext.cpp.
Zachary Turner [Wed, 22 Mar 2017 19:24:17 +0000 (19:24 +0000)]
Remove dead include from GoASTContext.cpp.

This #include was the cause of a dependency from Symbol ->
DataFormatters.  However, nothing from the header was being
used anyway, so we can just remove it with no adverse effects.

This reduces the overall cycle count from 44 to 43.

llvm-svn: 298541

7 years agoPreserve nonnull metadata on Loads through SROA & mem2reg.
Luqman Aden [Wed, 22 Mar 2017 19:16:39 +0000 (19:16 +0000)]
Preserve nonnull metadata on Loads through SROA & mem2reg.

Summary:
https://llvm.org/bugs/show_bug.cgi?id=31142 :

SROA was dropping the nonnull metadata on loads from allocas that got optimized out. This patch simply preserves nonnull metadata on loads through SROA and mem2reg.

Reviewers: chandlerc, efriedma

Reviewed By: efriedma

Subscribers: hfinkel, spatel, efriedma, arielb1, davide, llvm-commits

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

llvm-svn: 298540

7 years agoMake nullability test pass on Windows, which evaluates parameters right-to-left.
Nico Weber [Wed, 22 Mar 2017 19:15:24 +0000 (19:15 +0000)]
Make nullability test pass on Windows, which evaluates parameters right-to-left.

llvm-svn: 298539

7 years ago[X86] Implement __readgsqword (and the rest) as builtins (PR32373)
Hans Wennborg [Wed, 22 Mar 2017 19:13:13 +0000 (19:13 +0000)]
[X86] Implement __readgsqword (and the rest) as builtins (PR32373)

It seems MS headers have started using __readgsqword, and since it's
used in a header that doesn't include intrin.h, we can't implement it as
an inline function anymore.

That was already the case for __readfsdword, which Saleem added support
for in r220859. This patch reuses that codegen to implement all of
__read[fg]s{byte,word,dword,qword}.

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

llvm-svn: 298538

7 years agoFactor lsan allocator cache accesses into a function
Francis Ricci [Wed, 22 Mar 2017 18:42:43 +0000 (18:42 +0000)]
Factor lsan allocator cache accesses into a function

Summary:
This patch is the first step towards allows us to move away from using
__thread for the allocator cache on darwin,
which is requiring for building lsan for darwin on ios version 7
and on iossim i386.

This will be followed by patches to move the function into OS-specific files.

Reviewers: kubamracek, kcc

Subscribers: llvm-commits

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

llvm-svn: 298537

7 years agoMove FileSpec from Host -> Utility.
Zachary Turner [Wed, 22 Mar 2017 18:40:07 +0000 (18:40 +0000)]
Move FileSpec from Host -> Utility.

llvm-svn: 298536

7 years ago[analyze deps] Show incoming and outgoing counts on island members.
Zachary Turner [Wed, 22 Mar 2017 18:23:14 +0000 (18:23 +0000)]
[analyze deps] Show incoming and outgoing counts on island members.

llvm-svn: 298535

7 years agoIPO: Const correctness for summaries passed into passes.
Peter Collingbourne [Wed, 22 Mar 2017 18:22:59 +0000 (18:22 +0000)]
IPO: Const correctness for summaries passed into passes.

Pass const qualified summaries into importers and unqualified summaries into
exporters. This lets us const-qualify the summary argument to thinBackend.

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

llvm-svn: 298534

7 years agoAdd "(compatible with GNU linkers)" to the -version output.
Rui Ueyama [Wed, 22 Mar 2017 18:04:57 +0000 (18:04 +0000)]
Add "(compatible with GNU linkers)" to the -version output.

Previous output:

  $ ld.lld -version
  LLD 5.0.0

New output:

  $ ld.lld -version
  LLD 5.0.0 (compatible with GNU linkers)

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

llvm-svn: 298532

7 years agoIR: Fix a race condition in type id clients of ModuleSummaryIndex.
Peter Collingbourne [Wed, 22 Mar 2017 18:04:39 +0000 (18:04 +0000)]
IR: Fix a race condition in type id clients of ModuleSummaryIndex.

Add a const version of the getTypeIdSummary accessor that avoids
mutating the TypeIdMap.

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

llvm-svn: 298531

7 years ago[analyze deps] Also show cycle islands.
Zachary Turner [Wed, 22 Mar 2017 18:04:20 +0000 (18:04 +0000)]
[analyze deps] Also show cycle islands.

We currently display a list of all minimal cycles, but it's
useful to be able to see the big picture impact of these cycles
by merging them all together into groups of interconnected
components.

Because the cycle discovery algorithm only considers "minimal"
cycles, it discards all information for dependencies which are
not considered part of the minimal cycle.  So all we know is that
the components of each island definitely all depend on each other
but it's still possible that there are hidden dependencies due
to transitive includes.

The cycle list should still be the authoritative reference for
deciding where the easiest places to break cycles are, though.

llvm-svn: 298530

7 years ago[DeLICM] Remove overloaded Knowledge constructor. NFC.
Michael Kruse [Wed, 22 Mar 2017 18:01:23 +0000 (18:01 +0000)]
[DeLICM] Remove overloaded Knowledge constructor. NFC.

The isl C++ bindings now has implicit conversions from isl::set to
isl::union_set. Therefore the additional overload accepting isl::set
is not required anymore.

llvm-svn: 298529

7 years agoDocument the status quo of DIExpression semantics in LangRef.rst
Adrian Prantl [Wed, 22 Mar 2017 18:01:01 +0000 (18:01 +0000)]
Document the status quo of DIExpression semantics in LangRef.rst

llvm-svn: 298528

7 years ago[OpenMP] CUDA plugin: More descriptive error messages
George Rokos [Wed, 22 Mar 2017 17:36:22 +0000 (17:36 +0000)]
[OpenMP] CUDA plugin: More descriptive error messages

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

llvm-svn: 298527

7 years agoResubmit "Delete the remainder of platform specific code in FileSpec."
Zachary Turner [Wed, 22 Mar 2017 17:33:23 +0000 (17:33 +0000)]
Resubmit "Delete the remainder of platform specific code in FileSpec."

This was causing a test failure in one of LLDB's tests which
specifically dealt with a limitation in LLVM's implementation
of home_directory() that LLDB's own implementation had worked
around.

This limitation has been addressed in r298513 on the LLVM side,
so the failing test (which is now unnecessary as the limitation
no longer exists) was removed in r298519, allowing this patch to
be re-submitted without modification.

llvm-svn: 298526

7 years ago[compiler-rt] build compiler-rt runtimes without LTO
Bob Haarman [Wed, 22 Mar 2017 17:25:49 +0000 (17:25 +0000)]
[compiler-rt] build compiler-rt runtimes without LTO

Summary: Currently, we build the compiler-rt runtimes with link-time optimization if LTO is configured for the LLVM project. This will break external programs that don't invoke the linker in such a way that it supports LLVM's LTO. To avoid this, this change causes the compiler-rt runtimes to be compiled with -fno-lto. This also makes the check-profile tests work on systems when doing a lld LTO build on a system where the system linker does not support LLVM LTO.

Reviewers: rnk, davidxl

Reviewed By: davidxl

Subscribers: dberris, mgorny, llvm-commits, mehdi_amini

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

llvm-svn: 298525

7 years agoReuse appropriate Launch and Attach on NetBSD
Kamil Rytarowski [Wed, 22 Mar 2017 17:24:37 +0000 (17:24 +0000)]
Reuse appropriate Launch and Attach on NetBSD

Summary:
NetBSD ships with NativeProcessNetBSD  inherited from NativeProcessProtocol.

Link Plugins/Process/gdb-remote with lldbPluginProcessNetBSD in order to resolve
correctly the linking to Launch and Attach from the NetBSD plugin.

Sponsored by <The NetBSD Foundation>

Reviewers: kettenis, labath, emaste, joerg

Reviewed By: labath, emaste

Subscribers: mgorny, #lldb

Tags: #lldb

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

llvm-svn: 298524

7 years agoRename helper functions in DwarfExpression to be less misleading (NFC)
Adrian Prantl [Wed, 22 Mar 2017 17:19:55 +0000 (17:19 +0000)]
Rename helper functions in DwarfExpression to be less misleading (NFC)

llvm-svn: 298523

7 years ago[DeLICM] Remove AllElements. NFC.
Michael Kruse [Wed, 22 Mar 2017 17:18:39 +0000 (17:18 +0000)]
[DeLICM] Remove AllElements. NFC.

It is not used and will not be used (anymore) in future commits.

llvm-svn: 298522

7 years agoFix testcase on windows.
Adrian Prantl [Wed, 22 Mar 2017 17:15:03 +0000 (17:15 +0000)]
Fix testcase on windows.

llvm-svn: 298521

7 years ago[InstCombine] canonicalize insertelement of scalar constant ahead of insertelement...
Sanjay Patel [Wed, 22 Mar 2017 17:10:44 +0000 (17:10 +0000)]
[InstCombine] canonicalize insertelement of scalar constant ahead of insertelement of variable

insertelement (insertelement X, Y, IdxC1), ScalarC, IdxC2 -->
insertelement (insertelement X, ScalarC, IdxC2), Y, IdxC1

As noted in the code comment and seen in the test changes, the motivation is that by pulling
constant insertion up, we may be able to constant fold some insertelement instructions.

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

llvm-svn: 298520

7 years agoDelete TestLLVM.py
Zachary Turner [Wed, 22 Mar 2017 17:08:25 +0000 (17:08 +0000)]
Delete TestLLVM.py

This was added to workaround a limitation in LLVM's implementation
of getting the current user's home directory, since it would
only look at the value of $HOME, but we did not want to rely
on that being set so we would also look in the password database.

Adding the ability to look in the password database to LLVM was
a straightforward patch that was submitted in r298513, so since
that is done this test is no longer needed.

llvm-svn: 298519

7 years agoFix PR32298 by adding an early exit to getFrameIndexExprs().
Adrian Prantl [Wed, 22 Mar 2017 16:50:16 +0000 (16:50 +0000)]
Fix PR32298 by adding an early exit to getFrameIndexExprs().

Also add an assertion for the case that there are multiple FI
expressions with a DW_OP_LLVM_fragment; which should violate internal
constraints in DbgVariable.

llvm-svn: 298518

7 years agoMerge changes from r298466 into Xcode project
Tim Hammerquist [Wed, 22 Mar 2017 16:47:14 +0000 (16:47 +0000)]
Merge changes from r298466 into Xcode project

rdar://problem/31197116

llvm-svn: 298517

7 years ago[OpenMP] Allow multiple weak symbols to be loaded from the fat binary
George Rokos [Wed, 22 Mar 2017 16:43:40 +0000 (16:43 +0000)]
[OpenMP] Allow multiple weak symbols to be loaded from the fat binary

For compatibility with Fortran.

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

llvm-svn: 298516

7 years ago[OpenMP] CUDA plugin: add include directory for libelf
George Rokos [Wed, 22 Mar 2017 16:41:46 +0000 (16:41 +0000)]
[OpenMP] CUDA plugin: add include directory for libelf

Allow the user to manually specify where libelf is installed.

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

llvm-svn: 298515

7 years agoMake the home_directory test a little more resilient.
Zachary Turner [Wed, 22 Mar 2017 16:30:06 +0000 (16:30 +0000)]
Make the home_directory test a little more resilient.

It's possible (albeit strange) for $HOME to intentionally
point somewhere other than the user's home directory as
reported by the password database.  Our test shouldn't fail
in this case.  This patch updates the test to pull directly
from the password database before unsetting $HOME, rather
than comparing the return value of home_directory() to the
original value of the environment variable.

llvm-svn: 298514

7 years agoMake home_directory look in the password database in addition to $HOME.
Zachary Turner [Wed, 22 Mar 2017 15:24:59 +0000 (15:24 +0000)]
Make home_directory look in the password database in addition to $HOME.

This is something of an edge case, but when the $HOME environment
variable is not set, we can still look in the password database
to get the current user's home directory.

Added a test for this by getting the value of $HOME, then unsetting
it, then calling home_directory() and verifying that it succeeds
and that the value is the same as what we originally read from
the environment.

llvm-svn: 298513

7 years ago[ARM] t2_so_imm_neg had a subtle bug in the conversion, and could trigger UB by negat...
Artyom Skrobov [Wed, 22 Mar 2017 15:09:30 +0000 (15:09 +0000)]
[ARM] t2_so_imm_neg had a subtle bug in the conversion, and could trigger UB by negating (int)-2147483648. By pure luck, none of the pre-existing tests triggered this; so I'm adding one.

Summary: Thanks to Vitaly Buka for helping catch this.

Reviewers: rengolin, jmolloy, efriedma, vitalybuka

Subscribers: llvm-commits, aemerson

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

llvm-svn: 298512

7 years ago[X86][MMX] Add tests for _mm_set*_* intrinsics
Simon Pilgrim [Wed, 22 Mar 2017 14:55:43 +0000 (14:55 +0000)]
[X86][MMX] Add tests for _mm_set*_* intrinsics

llvm-svn: 298511

7 years agoIntroduce another level of metadata to distinguish non-aliasing accesses
Roman Gareev [Wed, 22 Mar 2017 14:25:24 +0000 (14:25 +0000)]
Introduce another level of metadata to distinguish non-aliasing accesses

Introduce another level of alias metadata to distinguish the individual
non-aliasing accesses that have inter iteration alias-free base pointers
marked with "Inter iteration alias-free" mark nodes. It can be used to,
for example, distinguish different stores (loads) produced by unrolling of
the innermost loops and, subsequently, sink (hoist) them by LICM.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D30606

llvm-svn: 298510

7 years agoRevert "Delete the remainder of platform specific code in FileSpec."
Pavel Labath [Wed, 22 Mar 2017 14:04:43 +0000 (14:04 +0000)]
Revert "Delete the remainder of platform specific code in FileSpec."

This reverts commit r298465 as it breaks
TestLLVM.TestHomeDirectory.test_tilde_home_directory.

llvm-svn: 298509

7 years agoAdd default typo to .tbss.*
Rafael Espindola [Wed, 22 Mar 2017 14:04:19 +0000 (14:04 +0000)]
Add default typo to .tbss.*

This matches gas behavior and is part of pr31888.

llvm-svn: 298508

7 years agoMap the new load to the base pointer of the invariant load hoisted load
Roman Gareev [Wed, 22 Mar 2017 13:57:53 +0000 (13:57 +0000)]
Map the new load to the base pointer of the invariant load hoisted load

Map the new load to the base pointer of the invariant load hoisted load
to be able to find the alias information for it.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D30605

llvm-svn: 298507

7 years agoSet the default type for .bss.foo.
Rafael Espindola [Wed, 22 Mar 2017 13:57:16 +0000 (13:57 +0000)]
Set the default type for .bss.foo.

This matches gas and is part of pr31888.

llvm-svn: 298506

7 years agoProduce INIT_ARRAY for sections named .init_array.*
Rafael Espindola [Wed, 22 Mar 2017 13:35:41 +0000 (13:35 +0000)]
Produce INIT_ARRAY for sections named .init_array.*

These sections are merged together by the linker, so they should have
the same time.

llvm-svn: 298505

7 years agoRevert "Correct class-template deprecation behavior"
Martin Bohme [Wed, 22 Mar 2017 13:34:37 +0000 (13:34 +0000)]
Revert "Correct class-template deprecation behavior"

This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).

llvm-svn: 298504

7 years agoRevert "iFix Test deprecation behavior in C89 mode as a result of r298410"
Martin Bohme [Wed, 22 Mar 2017 13:33:03 +0000 (13:33 +0000)]
Revert "iFix Test deprecation behavior in C89 mode as a result of r298410"

This reverts commit r298433. (Required to revert r298410, see comments
there.)

llvm-svn: 298503

7 years ago[AMDGPU][MC] Fix for Bug 28204 + LIT tests
Dmitry Preobrazhensky [Wed, 22 Mar 2017 13:31:01 +0000 (13:31 +0000)]
[AMDGPU][MC] Fix for Bug 28204 + LIT tests

Fixed v_mad_i64_i32/u64_u32 encoding

Reviewers: artem.tamazov

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

llvm-svn: 298502