platform/upstream/llvm.git
8 years ago[Coroutines] Part 7: Split coroutine into subfunctions
Gor Nishanov [Tue, 16 Aug 2016 18:04:14 +0000 (18:04 +0000)]
[Coroutines] Part 7: Split coroutine into subfunctions

Summary:
This patch adds simple coroutine splitting logic to CoroSplit pass.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
...
7. Split coroutine into subfunctions <= we are here
8. Coroutine Frame Building algorithm
9. Handle coroutine with unwinds
10+. The rest of the logic

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 278830

8 years ago[StreamExecutor] Add basic Stream operations
Jason Henline [Tue, 16 Aug 2016 17:58:31 +0000 (17:58 +0000)]
[StreamExecutor] Add basic Stream operations

Summary: Add the Stream class and a few of the operations it supports.

Reviewers: jlebar, tra

Subscribers: jprice, parallel_libs-commits

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

llvm-svn: 278829

8 years ago[InstCombine] add helper functions for foldICmpWithConstant; NFCI
Sanjay Patel [Tue, 16 Aug 2016 17:54:36 +0000 (17:54 +0000)]
[InstCombine] add helper functions for foldICmpWithConstant; NFCI

Besides breaking up a 700 line function to improve readability,
this sinks the 'FIXME: ConstantInt' check into each helper. So
now we can independently break that restriction within any of the
helper functions.

As much as possible, the code was only {cut/paste/clang-format}'ed
to minimize risk (no functional changes intended), so several more
readability improvements are still possible.

llvm-svn: 278828

8 years ago[ObjC] Warn on unguarded use of partial declaration
Erik Pilkington [Tue, 16 Aug 2016 17:44:11 +0000 (17:44 +0000)]
[ObjC] Warn on unguarded use of partial declaration

This commit adds a traversal of the AST after Sema of a function that diagnoses
unguarded references to declarations that are partially available (based on
availability attributes). This traversal is only done when we would otherwise
emit -Wpartial-availability.

This commit is part of a feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

llvm-svn: 278826

8 years ago[libFuzzer] refactoring around PCMap, NFC
Kostya Serebryany [Tue, 16 Aug 2016 17:37:13 +0000 (17:37 +0000)]
[libFuzzer] refactoring around PCMap, NFC

llvm-svn: 278825

8 years ago[mips] Enforce compact branch restrictions
Simon Dardis [Tue, 16 Aug 2016 17:16:11 +0000 (17:16 +0000)]
[mips] Enforce compact branch restrictions

Check both operands for use of the $zero register which cannot be used with
a compact branch instruction.

Reviewers: dsanders, vkalintris

Differential Review: https://reviews.llvm.org/D23547

llvm-svn: 278824

8 years ago[Hexagon] Clean up some miscellaneous V60 intrinsics a bit
Krzysztof Parzyszek [Tue, 16 Aug 2016 17:14:44 +0000 (17:14 +0000)]
[Hexagon] Clean up some miscellaneous V60 intrinsics a bit

llvm-svn: 278823

8 years agoWhen the inline spiller rematerializes an instruction, take the debug location from...
Wolfgang Pieb [Tue, 16 Aug 2016 17:12:50 +0000 (17:12 +0000)]
When the inline spiller rematerializes an instruction, take the debug location from the instruction
that immediately follows the rematerialization point.

Patch by Andrea DiBiagio.

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

llvm-svn: 278822

8 years agoRemove a stale comment from the test, NFC.
Wei Mi [Tue, 16 Aug 2016 16:57:15 +0000 (16:57 +0000)]
Remove a stale comment from the test, NFC.

llvm-svn: 278821

8 years agoMove the Decorator, ThreadNameWithParenthesis, and DescribeThread to asan_description...
Filipe Cabecinhas [Tue, 16 Aug 2016 16:38:46 +0000 (16:38 +0000)]
Move the Decorator, ThreadNameWithParenthesis, and DescribeThread to asan_descriptions.{h,cc}

Summary:
Replacement for part of D23518
Code refactoring to allow us to move some more DescribeAddressIf* functions to work by getting the structured information, and then printing it.

Reviewers: kcc, samsonov

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 278820

8 years agoELF: ignored option -G may be joined with its argument
Ed Maste [Tue, 16 Aug 2016 16:26:46 +0000 (16:26 +0000)]
ELF: ignored option -G may be joined with its argument

llvm-svn: 278819

8 years ago[Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag
Vitaly Buka [Tue, 16 Aug 2016 16:24:10 +0000 (16:24 +0000)]
[Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag

Summary: PR27453

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 278818

8 years ago[InstCombine] use m_APInt in foldICmpWithConstant; NFCI
Sanjay Patel [Tue, 16 Aug 2016 16:08:11 +0000 (16:08 +0000)]
[InstCombine] use m_APInt in foldICmpWithConstant; NFCI

There's some formatting and pointer deref ugliness here that I intend to fix in
subsequent patches. The overall goal is to refactor the obnoxiously long switch
and incrementally remove the restriction to scalar types (allow folds for vector
splats). This patch introduces the use of m_APInt which means the RHSV reference
is now a pointer (and may have matched a vector splat), but the check of 'RHS'
remains, so vector folds are disallowed and no functional change is intended.

llvm-svn: 278816

8 years agoRemove most instances of REQUIRES: shell from the tools/extra tests
Reid Kleckner [Tue, 16 Aug 2016 16:07:46 +0000 (16:07 +0000)]
Remove most instances of REQUIRES: shell from the tools/extra tests

None of these tests actually require bash, they just have quoting bugs
when paths contain backslashes and colons. Fix them with the "%/T" lit
substitution variants.

llvm-svn: 278815

8 years agoRevert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"
Reid Kleckner [Tue, 16 Aug 2016 16:04:14 +0000 (16:04 +0000)]
Revert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"

This reverts commit r278783.  It breaks usage of _xgetbv on Windows.

llvm-svn: 278814

8 years ago[Hexagon] Standardize vector predicate load/store pseudo instructions
Krzysztof Parzyszek [Tue, 16 Aug 2016 15:43:54 +0000 (15:43 +0000)]
[Hexagon] Standardize vector predicate load/store pseudo instructions

- Remove unused instructions: LDriq_pred_vec_V6, STriq_pred_vec_V6, and
  the 128B counterparts.
- Rename:
    LDriq_pred_V6         PS_vloadrq_ai
    LDriq_pred_V6_128B    PS_vloadrq_ai_128B
    STriq_pred_V6         PS_vstorerq_ai
    STriq_pred_V6_128B    PS_vstorerq_ai_128B

llvm-svn: 278813

8 years agoReduce the number of allocations required for AST attributes. In test cases, the...
Aaron Ballman [Tue, 16 Aug 2016 14:48:39 +0000 (14:48 +0000)]
Reduce the number of allocations required for AST attributes. In test cases, the max resident memory changed from 65760k to 64476k which is 1.9% improvement. Allocations in grow_pod changed from 8847 to 4872 according to tcmalloc heap profiler. Overall running time remained the same.

Patch by Eugene Kosov

llvm-svn: 278812

8 years agoReorder stderr redirection in test command.
Samuel Antao [Tue, 16 Aug 2016 14:38:39 +0000 (14:38 +0000)]
Reorder stderr redirection in test command.

llvm-svn: 278811

8 years ago[AArch64][GlobalISel] Select G_MUL.
Ahmed Bougacha [Tue, 16 Aug 2016 14:37:46 +0000 (14:37 +0000)]
[AArch64][GlobalISel] Select G_MUL.

llvm-svn: 278810

8 years ago[GlobalISel] Fix G_MUL comment. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:37:43 +0000 (14:37 +0000)]
[GlobalISel] Fix G_MUL comment. NFC.

llvm-svn: 278809

8 years ago[AArch64][GlobalISel] Factor out unsupported binop check. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:37:40 +0000 (14:37 +0000)]
[AArch64][GlobalISel] Factor out unsupported binop check. NFC.

We're going to need it for G_MUL, and, if other targets end up using
something similar, we can easily put it in the generic selector.

llvm-svn: 278808

8 years ago[ADCE] Modify data structures to support removing control flow
David Callahan [Tue, 16 Aug 2016 14:31:51 +0000 (14:31 +0000)]
[ADCE] Modify data structures to support removing control flow

Summary:
This is part of a serious of patches to evolve ADCE.cpp to support
removing of unnecessary control flow.

This patch changes the data structures to hold liveness information to
support the additional information we will eventually need. In
particular we now have a notion of basic blocks being live because
they contain a live operations. This will eventually feed into control
dependence analysis of which branches are live. We cater to getting
from instructions to associated block information and from blocks to
information about their terminators.

This patch also changes the structure of the main loop of the
algorithm so that it alternates propagating liveness between
instructions and usign control dependence information to mark branches
live.

We force all terminators live for now until we add code to handlinge
removing control flow in a later patch.

No changes to effective behavior with this patch

Previous patches:

D23065 [ADCE] Refactor anticipating new functionality (NFC)
D23102 [ADCE] Refactoring for new functionality (NFC)

Reviewers: nadav, majnemer, mehdi_amini

Subscribers: freik, twoh, llvm-commits

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

llvm-svn: 278807

8 years agoAdd empty --gcc-toolchain empty to cuda-detect test.
Samuel Antao [Tue, 16 Aug 2016 14:31:39 +0000 (14:31 +0000)]
Add empty --gcc-toolchain empty to cuda-detect test.

Unless we overload the default gcc toolchain with an empty string
the system root used in the tests will be ignored if the user builds
clang  with a custom gcc toolchain.

llvm-svn: 278806

8 years ago[Pipeliner] Fix an asssert due to invalid Phi in the epilog
Brendon Cahoon [Tue, 16 Aug 2016 14:29:24 +0000 (14:29 +0000)]
[Pipeliner] Fix an asssert due to invalid Phi in the epilog

The pipeliner was generating an invalid Phi name for an operand
in the epilog block, which caused an assert in the live variable
analysis pass. The fix is to the code that generates new Phis
in the epilog block. In this case, there is an existing Phi that
needs to be reused rather than creating a new Phi instruction.

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

llvm-svn: 278805

8 years ago[AArch64][GlobalISel] Select (variable) shifts.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:47 +0000 (14:02 +0000)]
[AArch64][GlobalISel] Select (variable) shifts.

For now, no support for immediates.

llvm-svn: 278804

8 years ago[AArch64][GlobalISel] Robustize select tests. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:44 +0000 (14:02 +0000)]
[AArch64][GlobalISel] Robustize select tests. NFC.

Using the same register means nothing was checking for operand order.

llvm-svn: 278803

8 years ago[AArch64][GlobalISel] Select p0 G_FRAME_INDEX.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:42 +0000 (14:02 +0000)]
[AArch64][GlobalISel] Select p0 G_FRAME_INDEX.

And mark it as legal.

llvm-svn: 278802

8 years ago[GlobalISel] Mention pointers in LowLevelType.h. NFC.
Ahmed Bougacha [Tue, 16 Aug 2016 14:02:36 +0000 (14:02 +0000)]
[GlobalISel] Mention pointers in LowLevelType.h. NFC.

llvm-svn: 278801

8 years agoRevert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
Francis Ricci [Tue, 16 Aug 2016 13:58:56 +0000 (13:58 +0000)]
Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"

This reverts commit cd5fa595648378f38cdad8b07e18433639c28a9c.

llvm-svn: 278800

8 years ago[x86] Refactor a PowerPC specific ctlz/srl transformation (NFC).
Pierre Gousseau [Tue, 16 Aug 2016 13:53:53 +0000 (13:53 +0000)]
[x86] Refactor a PowerPC specific ctlz/srl transformation (NFC).

Following the discussion on D22038, this refactors a PowerPC specific setcc -> srl(ctlz) transformation so it can be used by other targets.

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

llvm-svn: 278799

8 years ago[X86][AVX] Fixed typo in zero element insertion
Simon Pilgrim [Tue, 16 Aug 2016 13:33:33 +0000 (13:33 +0000)]
[X86][AVX] Fixed typo in zero element insertion

llvm-svn: 278798

8 years ago[ELF] - Do not exit if -v is specified.
George Rimar [Tue, 16 Aug 2016 13:25:53 +0000 (13:25 +0000)]
[ELF] - Do not exit if -v is specified.

Previously lld showed version number and returned,
that is different from ld and PR28999.

Patch fixed that.

llvm-svn: 278797

8 years ago[Hexagon] Improve test to check for @PCREL, only run llc, not opt -> llc.
Ron Lieberman [Tue, 16 Aug 2016 13:10:09 +0000 (13:10 +0000)]
[Hexagon] Improve test to check for @PCREL, only run llc, not opt -> llc.

llvm-svn: 278796

8 years ago[MemorySanitizer] [MIPS] Changed memory mapping to support pie executable.
Sagar Thakur [Tue, 16 Aug 2016 12:55:38 +0000 (12:55 +0000)]
[MemorySanitizer] [MIPS] Changed memory mapping to support pie executable.

Reviewed by eugenis
Differential: D22994

llvm-svn: 278795

8 years ago[X86][SSE] Add support for combining v2f64 target shuffles to VZEXT_MOVL byte rotations
Simon Pilgrim [Tue, 16 Aug 2016 12:52:06 +0000 (12:52 +0000)]
[X86][SSE] Add support for combining v2f64 target shuffles to VZEXT_MOVL byte rotations

The combine was only matching v2i64 as it assumed lowering to MOVQ - but we have v2f64 patterns that match in a similar fashion

llvm-svn: 278794

8 years ago[MSAN][MIPS] Changed memory mapping to support pie executable.
Sagar Thakur [Tue, 16 Aug 2016 12:49:54 +0000 (12:49 +0000)]
[MSAN][MIPS] Changed memory mapping to support pie executable.

Reviewed by eugenis
Differential: D22993

llvm-svn: 278793

8 years ago[ScopInfo] Make scalars used by PHIs in non-affine regions available
Tobias Grosser [Tue, 16 Aug 2016 11:44:48 +0000 (11:44 +0000)]
[ScopInfo] Make scalars used by PHIs in non-affine regions available

Normally this is ensured when adding PHI nodes, but as PHI node dependences
do not need to be added in case all incoming blocks are within the same
non-affine region, this was missed.

This corrects an issue visible in LNT's sqlite3, in case invariant load hoisting
was disabled.

llvm-svn: 278792

8 years ago[clang-tidy] readability-implicit-bool-cast forgets to store its options.
Haojian Wu [Tue, 16 Aug 2016 11:15:05 +0000 (11:15 +0000)]
[clang-tidy] readability-implicit-bool-cast forgets to store its options.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 278791

8 years ago[X86][AVX512BW] Updated tests to demonstrate AVX512BW's inability to vectorize v64i8...
Simon Pilgrim [Tue, 16 Aug 2016 11:05:47 +0000 (11:05 +0000)]
[X86][AVX512BW] Updated tests to demonstrate AVX512BW's inability to vectorize v64i8 shifts

llvm-svn: 278790

8 years agoCorrect the upper bound for a CBZ/CBNZ branch target.
Prakhar Bahuguna [Tue, 16 Aug 2016 10:41:56 +0000 (10:41 +0000)]
Correct the upper bound for a CBZ/CBNZ branch target.

Summary:
Fix for the upper bound check that was causing a build failure.

Reviewers: olista01, rengolin, t.p.northover

Subscribers: llvm-commits

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

llvm-svn: 278789

8 years ago[Thumb] Validate branch target for CBZ/CBNZ instructions.
Prakhar Bahuguna [Tue, 16 Aug 2016 10:41:52 +0000 (10:41 +0000)]
[Thumb] Validate branch target for CBZ/CBNZ instructions.

Summary:
The assembler currently does not check the branch target for CBZ/CBNZ
instructions, which only permit branching forwards with a positive offset. This
adds validation for the branch target to ensure negative PC-relative offsets are
not encoded into the instruction, whether specified as a literal or as an
assembler symbol.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, rengolin

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

llvm-svn: 278788

8 years ago[X86][SSE] Add support for combining target shuffles to PALIGNR byte rotations
Simon Pilgrim [Tue, 16 Aug 2016 10:03:23 +0000 (10:03 +0000)]
[X86][SSE] Add support for combining target shuffles to PALIGNR byte rotations

llvm-svn: 278787

8 years agoLeft shifts of negative values are defined if -fwrapv is set
James Molloy [Tue, 16 Aug 2016 09:45:36 +0000 (09:45 +0000)]
Left shifts of negative values are defined if -fwrapv is set

This means we shouldn't emit ubsan detection code or warn.
Fixes PR25552.

llvm-svn: 278786

8 years agoRemove GetThreadSuffixSupported from GDBRemoteCommunication **base** class
Pavel Labath [Tue, 16 Aug 2016 09:36:29 +0000 (09:36 +0000)]
Remove GetThreadSuffixSupported from GDBRemoteCommunication **base** class

Despite its comment, the function is only used in the Client class, and its presence was merely
complicating mock implementation in unit tests.

llvm-svn: 278785

8 years ago[AVR] Fix compile errors
Job Noorman [Tue, 16 Aug 2016 08:41:35 +0000 (08:41 +0000)]
[AVR] Fix compile errors

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

llvm-svn: 278784

8 years ago[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms
Marina Yatsina [Tue, 16 Aug 2016 08:13:36 +0000 (08:13 +0000)]
[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms

commit on behalf of guyblank

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

llvm-svn: 278783

8 years ago[X86] Add xgetbv/xsetbv intrinsics to non-windows platforms
Guy Blank [Tue, 16 Aug 2016 06:41:00 +0000 (06:41 +0000)]
[X86] Add xgetbv/xsetbv intrinsics to non-windows platforms

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

llvm-svn: 278782

8 years ago[ELF] Ignore .interp section in case linker script specifies PHDRS without PT_INTERP
Eugene Leviant [Tue, 16 Aug 2016 06:40:58 +0000 (06:40 +0000)]
[ELF] Ignore .interp section in case linker script specifies PHDRS without PT_INTERP

llvm-svn: 278781

8 years ago[clang-rename] fix broken build
Kirill Bobyrev [Tue, 16 Aug 2016 06:19:06 +0000 (06:19 +0000)]
[clang-rename] fix broken build

As Eric Fiselier pointed out, r278760 breaks build, because RecursiveASTVisitor
doesn't have a const overload. This patch is a quick fix.

llvm-svn: 278780

8 years ago[InstSimplify] Fold gep (gep V, C), (xor V, -1) to C-1
David Majnemer [Tue, 16 Aug 2016 06:13:46 +0000 (06:13 +0000)]
[InstSimplify] Fold gep (gep V, C), (xor V, -1) to C-1

llvm-svn: 278779

8 years agoFunctionImport: missed one occurence of ImportListForModule to rename (NFC)
Mehdi Amini [Tue, 16 Aug 2016 05:49:12 +0000 (05:49 +0000)]
FunctionImport: missed one occurence of ImportListForModule to rename (NFC)

llvm-svn: 278778

8 years agoFunctionImport: rename ImportsForModule to ImportList for consistency (NFC)
Mehdi Amini [Tue, 16 Aug 2016 05:47:12 +0000 (05:47 +0000)]
FunctionImport: rename ImportsForModule to ImportList for consistency (NFC)

llvm-svn: 278777

8 years ago[LTO] Simplify APIs and constify (NFC)
Mehdi Amini [Tue, 16 Aug 2016 05:46:05 +0000 (05:46 +0000)]
[LTO] Simplify APIs and constify (NFC)

Summary:
Multiple APIs were taking a StringMap for the ImportLists containing
the entries for for all the modules while operating on a single entry
for the current module. Instead we can pass the desired ModuleImport
directly. Also some of the APIs were not const, I believe just to be
able to use operator[] on the StringMap.

Reviewers: tejohnson

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 278776

8 years ago[TSan][MIPS] Implements setjmp assembly for MIPS64
Sagar Thakur [Tue, 16 Aug 2016 05:06:56 +0000 (05:06 +0000)]
[TSan][MIPS] Implements setjmp assembly for MIPS64

Reviewed by dvyukov
Differential: https://reviews.llvm.org/D23494

llvm-svn: 278775

8 years agoSymbol: add missing item in covered switch
Saleem Abdulrasool [Tue, 16 Aug 2016 04:12:36 +0000 (04:12 +0000)]
Symbol: add missing item in covered switch

RenderScript was missing from the covered switch.  Add it to avoid a warning of
the missing entry.  NFC.

llvm-svn: 278774

8 years agoDefault LIBCXXABI_LIBDIR_SUFFIX to LLVM_LIBDIR_SUFFIX
Eric Fiselier [Tue, 16 Aug 2016 03:44:55 +0000 (03:44 +0000)]
Default LIBCXXABI_LIBDIR_SUFFIX to LLVM_LIBDIR_SUFFIX

llvm-svn: 278773

8 years ago [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Francis Ricci [Tue, 16 Aug 2016 02:15:51 +0000 (02:15 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration

    Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

    Reviewers: samsonov, beanz, pcc, rnk

    Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 278772

8 years ago[ELF] Linkerscript: support hidden symbols assignments
Petr Hosek [Tue, 16 Aug 2016 01:11:16 +0000 (01:11 +0000)]
[ELF] Linkerscript: support hidden symbols assignments

This add support for HIDDEN command which can be used to define
a symbol that will be hidden and won't be exported.

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

llvm-svn: 278770

8 years agoRevert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
Francis Ricci [Tue, 16 Aug 2016 01:11:07 +0000 (01:11 +0000)]
Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"

This reverts commit 9528d86531b1289600e18c407b8e992d7fedb94f.

llvm-svn: 278769

8 years ago[InstCombine] add tests for missing vector icmp folds
Sanjay Patel [Tue, 16 Aug 2016 00:48:38 +0000 (00:48 +0000)]
[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278768

8 years ago[CUDA] Fix "declared here" note on deferred wrong-side errors.
Justin Lebar [Tue, 16 Aug 2016 00:48:21 +0000 (00:48 +0000)]
[CUDA] Fix "declared here" note on deferred wrong-side errors.

Previously we weren't deferring these "declared here" notes, which is
obviously wrong.

llvm-svn: 278767

8 years ago[LTO] Rename variables with meaningul names, i.e. more than one character (NFC)
Mehdi Amini [Tue, 16 Aug 2016 00:44:46 +0000 (00:44 +0000)]
[LTO] Rename variables with meaningul names, i.e. more than one character (NFC)

llvm-svn: 278766

8 years ago[InstCombine] add tests for missing vector icmp folds
Sanjay Patel [Tue, 16 Aug 2016 00:27:12 +0000 (00:27 +0000)]
[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278765

8 years ago[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Francis Ricci [Tue, 16 Aug 2016 00:16:47 +0000 (00:16 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration

Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

Reviewers: samsonov, beanz, pcc, rnk

Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 278764

8 years agoPR28978: If we need overload resolution for the move constructor of an
Richard Smith [Tue, 16 Aug 2016 00:13:47 +0000 (00:13 +0000)]
PR28978: If we need overload resolution for the move constructor of an
anonymous union member of a class, we need overload resolution for the move
constructor of the class itself too; we can't rely on Sema to do the right
thing for us for anonymous union types.

llvm-svn: 278763

8 years ago[AMDGPU] Give enum an explicit 64-bit type to fix MSVC 2013 failures
Reid Kleckner [Mon, 15 Aug 2016 23:54:44 +0000 (23:54 +0000)]
[AMDGPU] Give enum an explicit 64-bit type to fix MSVC 2013 failures

Recall that MSVC always gives enums the type 'int', nothing else.  MSVC
2015 does not appear to have this problem anymore.

Clang-cl -Wmicrosoft-enum-value flags this, FWIW, so now I have a true
positive for my warning. :)

llvm-svn: 278762

8 years ago[ThinLTO] Fix temp file dumping, enable via llvm-lto and test it
Teresa Johnson [Mon, 15 Aug 2016 23:24:57 +0000 (23:24 +0000)]
[ThinLTO] Fix temp file dumping, enable via llvm-lto and test it

Summary:
Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine
needs to be passed directly as an argument, or a copy saved into a
std::string.

It doesn't seem there are any consumers of this, so I added a new option
to llvm-lto to enable saving of temp files during ThinLTO, and augmented
a test to use it to check post-import but pre-opt bitcode.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 278761

8 years ago[clang-rename] cleanup `auto` usages
Kirill Bobyrev [Mon, 15 Aug 2016 23:20:05 +0000 (23:20 +0000)]
[clang-rename] cleanup `auto` usages

As Alexander pointed out, LLVM Coding Standards are more conservative about
using auto, i.e. it should be used in the following situations:

* When the type is obvious, i.e. explicitly mentioned in the same expression.
For example `if (const clang::FieldDecl *FieldDecl = Initializer->getMember())`.
* When the type is totally non-obvious and one iterates over something. For
example
`for (const auto &CurrDecl : Context.getTranslationUnitDecl()->decls())`.

Otherwise the type should be explicitly stated.

Reviewers: alexfh

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

llvm-svn: 278760

8 years ago[CUDA] Raise an error if a wrong-side call is codegen'ed.
Justin Lebar [Mon, 15 Aug 2016 23:00:49 +0000 (23:00 +0000)]
[CUDA] Raise an error if a wrong-side call is codegen'ed.

Summary:
Some function calls in CUDA are allowed to appear in
semantically-correct programs but are an error if they're ever
codegen'ed.  Specifically, a host+device function may call a host
function, but it's an error if such a function is ever codegen'ed in
device mode (and vice versa).

Previously, clang made no attempt to catch these errors.  For the most
part, they would be caught by ptxas, and reported as "call to unknown
function 'foo'".

Now we catch these errors and report them the same as we report other
illegal calls (e.g. a call from a host function to a device function).

This has a small change in error-message behavior for calls that were
previously disallowed (e.g. calls from a host to a device function).
Previously, we'd catch disallowed calls fairly early, before doing
additional semantic checking e.g. of the call's arguments.  Now we catch
these illegal calls at the very end of our semantic checks, so we'll
only emit a "illegal CUDA call" error if the call is otherwise
well-formed.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

llvm-svn: 278759

8 years agoDon't use %llc_dwarf with -mtriple, they don't combine
Reid Kleckner [Mon, 15 Aug 2016 22:54:26 +0000 (22:54 +0000)]
Don't use %llc_dwarf with -mtriple, they don't combine

llvm-svn: 278758

8 years ago[InstCombine] add tests for missing vector icmp folds
Sanjay Patel [Mon, 15 Aug 2016 22:43:52 +0000 (22:43 +0000)]
[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278757

8 years agoLinker: Avoid some ridiculous indentation by using a temporary. NFC
Justin Bogner [Mon, 15 Aug 2016 22:41:42 +0000 (22:41 +0000)]
Linker: Avoid some ridiculous indentation by using a temporary. NFC

This was indented really awkwardly, and clang-format didn't seem to
know how to do any better. Avoid the issue with a temporary variable.

llvm-svn: 278756

8 years agoAdding the triple for test comitted with r278703.
Wolfgang Pieb [Mon, 15 Aug 2016 22:39:39 +0000 (22:39 +0000)]
Adding the triple for test comitted with r278703.

llvm-svn: 278755

8 years ago[sancov] extracting AArch64 test to a separate file.
Mike Aizatsky [Mon, 15 Aug 2016 22:30:37 +0000 (22:30 +0000)]
[sancov] extracting AArch64 test to a separate file.

llvm-svn: 278754

8 years ago[ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs
Tim Shen [Mon, 15 Aug 2016 22:07:30 +0000 (22:07 +0000)]
[ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs

Summary: This is similiar to r278752, where I found that the std::iterator<...> base can be normal.

Reviewers: dblaikie

Subscribers: llvm-commits

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

llvm-svn: 278753

8 years ago[ADT] Change PostOrderIterator to use NodeRef. NFC.
Tim Shen [Mon, 15 Aug 2016 21:52:54 +0000 (21:52 +0000)]
[ADT] Change PostOrderIterator to use NodeRef. NFC.

Reviewers: dblaikie

Subscribers: mzolotukhin, llvm-commits

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

llvm-svn: 278752

8 years ago[InstCombine] add tests for missing vector icmp folds
Sanjay Patel [Mon, 15 Aug 2016 21:47:50 +0000 (21:47 +0000)]
[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278751

8 years agoFix typo in lowering for fp128 ueq.
Eli Friedman [Mon, 15 Aug 2016 21:46:19 +0000 (21:46 +0000)]
Fix typo in lowering for fp128 ueq.

Regression from r259791.

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

llvm-svn: 278750

8 years agoAMDGPU/R600: Convert buffer id to VTX_READ input
Jan Vesely [Mon, 15 Aug 2016 21:38:30 +0000 (21:38 +0000)]
AMDGPU/R600: Convert buffer id to VTX_READ input

Use patterns instead of multiple instructions
Add buffer id to asm string

https://reviews.llvm.org/D22650

llvm-svn: 278749

8 years agoReally fix the issue with 502957cc9cf805dc6093950e8cdcd0db4969d933. Windows %p and...
Hemant Kulkarni [Mon, 15 Aug 2016 21:38:23 +0000 (21:38 +0000)]
Really fix the issue with 502957cc9cf805dc6093950e8cdcd0db4969d933. Windows %p and FileCheck limitations makes the test linux only

llvm-svn: 278748

8 years ago[InstCombine] add tests for missing vector icmp folds
Sanjay Patel [Mon, 15 Aug 2016 21:37:24 +0000 (21:37 +0000)]
[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278747

8 years ago[ADT] Change PostOrderIterator to use NodeRef. NFC.
Tim Shen [Mon, 15 Aug 2016 21:27:56 +0000 (21:27 +0000)]
[ADT] Change PostOrderIterator to use NodeRef. NFC.

Summary: Corresponding LLVM change: D23522

Reviewers: dblaikie

Subscribers: cfe-commits

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

llvm-svn: 278746

8 years agolibcxx: Fix path.compare.pass expected result
Adhemerval Zanella [Mon, 15 Aug 2016 21:24:50 +0000 (21:24 +0000)]
libcxx: Fix path.compare.pass expected result

The expected 'filesystem::path::compare' result states that for different
path only result sign contains the information about passed arguments
(not its integer value).  This is due it uses the output of other compare
functions (basic_string_view and char_traits) without further handling and
char_traits uses memcmp for final buffer comparison.

However for GLIBC on AArch64 the code:

  int ret = memcmp ("b/a/c", "a/b/c", 1);

Results in '64' where for x86_64 it results in '1'.

This patch fixes the expected 'filesystem::path::compare' by normalizing
all the results before assert comparison.

llvm-svn: 278745

8 years agoGlobalISel: support loads and stores of strange types.
Tim Northover [Mon, 15 Aug 2016 21:13:17 +0000 (21:13 +0000)]
GlobalISel: support loads and stores of strange types.

Before we mischaracterized structs and i1 types as a scalar with size 0 in
various ways.

llvm-svn: 278744

8 years agoRemove unnecessary flag from new test
Teresa Johnson [Mon, 15 Aug 2016 21:07:57 +0000 (21:07 +0000)]
Remove unnecessary flag from new test

Remove -disable-inlining flag that snuck into the test I added for r278739.
It doesn't have an effect in ThinLTO mode (something that should be fixed),
but in any case the checks depend on inlining currently.

llvm-svn: 278743

8 years agoObjective-C diagnostics: isObjCNSObjectType should check through AttributedType.
Manman Ren [Mon, 15 Aug 2016 21:05:00 +0000 (21:05 +0000)]
Objective-C diagnostics: isObjCNSObjectType should check through AttributedType.

For the following example:
typedef __attribute__((NSObject)) CGColorRef ColorAttrRef;
@property (strong, nullable) ColorAttrRef color;
The property type should be ObjC NSObject type and the compiler should not emit
error: property with 'retain (or strong)' attribute must be of object type

rdar://problem/27747154

llvm-svn: 278742

8 years agoupdate tests to use FileCheck and exact checking
Sanjay Patel [Mon, 15 Aug 2016 21:02:25 +0000 (21:02 +0000)]
update tests to use FileCheck and exact checking

llvm-svn: 278741

8 years agoRevert "[ValueTracking] Improve ValueTracking on left shift with nsw flag"
Sanjoy Das [Mon, 15 Aug 2016 21:01:31 +0000 (21:01 +0000)]
Revert "[ValueTracking] Improve ValueTracking on left shift with nsw flag"

This reverts commit r278172.  It causes PR28946.

llvm-svn: 278740

8 years ago[ThinLTO] Remove functions resolved to available_externally from comdats
Teresa Johnson [Mon, 15 Aug 2016 21:00:04 +0000 (21:00 +0000)]
[ThinLTO] Remove functions resolved to available_externally from comdats

Summary:
thinLTOResolveWeakForLinkerModule needs to drop any preempted weak symbols
that were converted to available_externally from comdats, otherwise we
will get a verification failure (since available_externally is a
declaration for the linker, and no declarations can be in a comdat).

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 278739

8 years ago[ScopDetect] Do not assert in case of AddRecs with non-constant start expression
Tobias Grosser [Mon, 15 Aug 2016 20:59:30 +0000 (20:59 +0000)]
[ScopDetect] Do not assert in case of AddRecs with non-constant start expression

llvm-svn: 278738

8 years ago[InstCombine] add tests for missing vector icmp folds
Sanjay Patel [Mon, 15 Aug 2016 20:56:11 +0000 (20:56 +0000)]
[InstCombine] add tests for missing vector icmp folds

llvm-svn: 278737

8 years agoFix new ASAN failures
Eric Fiselier [Mon, 15 Aug 2016 20:50:01 +0000 (20:50 +0000)]
Fix new ASAN failures

llvm-svn: 278736

8 years agoAdd the notion of deferred diagnostics.
Justin Lebar [Mon, 15 Aug 2016 20:38:56 +0000 (20:38 +0000)]
Add the notion of deferred diagnostics.

Summary:
This patch lets you create diagnostics that are emitted if and only if a
particular FunctionDecl is codegen'ed.

This is necessary for CUDA, where some constructs -- e.g. calls from
host+device functions to host functions when compiling for device -- are
allowed to appear in semantically-correct programs, but only if they're
never codegen'ed.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 278735

8 years ago[CUDA] Include CUDA headers before anything else.
Justin Lebar [Mon, 15 Aug 2016 20:38:52 +0000 (20:38 +0000)]
[CUDA] Include CUDA headers before anything else.

Summary:
There's no point to --cuda-path if we then go and include /usr/include
first.  And if you install the right packages, Ubuntu will install (very
old) CUDA headers there.

Reviewers: tra

Subscribers: cfe-commits, Prazek

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

llvm-svn: 278734

8 years ago[CUDA] Fix CUDA install version parsing.
Justin Lebar [Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)]
[CUDA] Fix CUDA install version parsing.

Summary:
getAsInteger returns true on error.  Oops.

No test because the behavior at the moment is identical with or without
this change.

Reviewers: tra

Subscribers: cfe-commits, Prazek

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

llvm-svn: 278733

8 years agoFix a test that failed due to:
Hemant Kulkarni [Mon, 15 Aug 2016 20:36:16 +0000 (20:36 +0000)]
Fix a test that failed due to:
 https://llvm.org/svn/llvm-project/llvm/trunk@278725 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-svn: 278732

8 years agoEnhance SCEV to compute the trip count for some loops with unknown stride.
David L Kreitzer [Mon, 15 Aug 2016 20:21:41 +0000 (20:21 +0000)]
Enhance SCEV to compute the trip count for some loops with unknown stride.

Patch by Pankaj Chawla

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

llvm-svn: 278731

8 years agoStaticAnalyzer: Report found fields order in PaddingChecker
Saleem Abdulrasool [Mon, 15 Aug 2016 20:16:13 +0000 (20:16 +0000)]
StaticAnalyzer: Report found fields order in PaddingChecker

Report the found fields order in PaddingChecker.

Patch by Alexander Shaposhnikov!

llvm-svn: 278730

8 years ago[CMake] Apple stage1 doesn't need to set libcxx options
Chris Bieneman [Mon, 15 Aug 2016 20:15:22 +0000 (20:15 +0000)]
[CMake] Apple stage1 doesn't need to set libcxx options

LibCXX settings are configured in stage2 so we don't need them here.

llvm-svn: 278729

8 years ago[CMake] Renaming test variable to be consistent
Chris Bieneman [Mon, 15 Aug 2016 20:12:43 +0000 (20:12 +0000)]
[CMake] Renaming test variable to be consistent

Based on post-commit review by compnerd.

llvm-svn: 278728