Commit Graph

258253 Commits

Author SHA1 Message Date
Zhaoshi Zheng e3c9070f06 Model ashr(shl(x, n), m) as mul(x, 2^(n-m)) when n > m
Given below case:

  %y = shl %x, n
  %z = ashr %y, m

when n = m, SCEV models it as sext(trunc(x)). This patch tries to handle
the case where n > m by using sext(mul(trunc(x), 2^(n-m)))) as the SCEV
expression.

llvm-svn: 298631
2017-03-23 18:06:09 +00:00
Zhaoshi Zheng f47c27513b revert test commit r298629
llvm-svn: 298630
2017-03-23 17:52:20 +00:00
Zhaoshi Zheng 49ae35580e test commit
llvm-svn: 298629
2017-03-23 17:38:47 +00:00
Eric Christopher cff8492492 Remove the subtarget argument from LowerFP_TO_INT since there's one
stored on X86TargetLowering.

llvm-svn: 298628
2017-03-23 17:35:08 +00:00
Eric Christopher a19a14b42f Remove unused X86Subtarget argument from getOnesVector.
llvm-svn: 298627
2017-03-23 17:35:06 +00:00
Adrian McCarthy 3c0328e011 Somehow this still breaks because of ANSI color codes in test output on Linux.
Reverting until I can figure out the root cause.

Revert "Re-land:  Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"

This reverts commit f461a70cc376f0f91c8b4917be79479cc86330a5.

llvm-svn: 298626
2017-03-23 17:18:50 +00:00
Adrian McCarthy e4e5a2b13e Fix build break after r298623
Use the -color-output option explicitly to eliminate the ANSI color codes in
pdb-native-summary.test.  (The default should have done this.)

llvm-svn: 298625
2017-03-23 16:57:53 +00:00
Pirama Arumuga Nainar bc26482717 [ARM] Fix computeKnownBits for ARMISD::CMOV
Summary:
The true and false operands for the CMOV are operands 0 and 1.
ARMISelLowering.cpp::computeKnownBits was looking at operands 1 and 2
instead.  This can cause CMOV instructions to be incorrectly folded into
BFI if value set by the CMOV is another CMOV, whose known bits are
computed incorrectly.

This patch fixes the issue and adds a test case.

Reviewers: kristof.beyls, jmolloy

Subscribers: llvm-commits, aemerson, srhines, rengolin

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

llvm-svn: 298624
2017-03-23 16:47:47 +00:00
Adrian McCarthy 997a15c3c3 Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]
The new test should pass on all platforms now that llvm-pdbdump has the
`-color-output` option.

This moves exe symbol-specific method implementations out of NativeRawSymbol
into a concrete subclass. Also adds implementations for hasCTypes and
hasPrivateSymbols and a simple test to ensure the native reader can access
the summary information for the executable from the PDB.

Original Differential Revision: https://reviews.llvm.org/D31059

llvm-svn: 298623
2017-03-23 16:45:20 +00:00
Argyrios Kyrtzidis a9876cafe2 [index] When indexing system headers make sure to report important reference relations
Even if we exclude plain reference occurrences, we should include relation-based references, like the 'base' one.

rdar://31010737

llvm-svn: 298622
2017-03-23 16:34:47 +00:00
Marek Kurdej 92ecb51fae [clang-tidy] Fix treating non-space whitespaces in checks list.
Summary:
This furtherly improves r295303: [clang-tidy] Ignore spaces between globs in the Checks option.
Trims all whitespaces and not only spaces and correctly computes the offset of the checks list (taking the size before trimming).

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: cfe-commits, JDevlieghere

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

llvm-svn: 298621
2017-03-23 16:32:06 +00:00
Matthew Simpson 4e7b71bc86 [LV] Vectorize GEPs
This patch adds support for vectorizing GEPs. Previously, we only generated
vector GEPs on-demand when creating gather or scatter operations. All GEPs from
the original loop were scalarized by default, and if a pointer was to be stored
to memory, we would have to build up the pointer vector with insertelement
instructions.

With this patch, we will vectorize all GEPs that haven't already been marked
for scalarization.

The patch refines collectLoopScalars to more exactly identify the scalar GEPs.
The function now more closely resembles collectLoopUniforms. And the patch
moves vector GEP creation out of vectorizeMemoryInstruction and into the main
vectorization loop. The vector GEPs needed for gather and scatter operations
will have already been generated before vectoring the memory accesses.

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

llvm-svn: 298620
2017-03-23 16:29:58 +00:00
Alexander Kornienko eaada5c91e [clang-tidy] Don't use groups in the big regexy filter
Fixes https://bugs.llvm.org/show_bug.cgi?id=27641.

llvm-svn: 298619
2017-03-23 16:29:39 +00:00
Marshall Clow 315cd1fec9 Update the algorithm tests to not use the (deprecated) function binders. No functional change.
llvm-svn: 298618
2017-03-23 16:13:50 +00:00
Michael Kruse c3e9c1442d [ScopInfo] Introduce ScopStmt::contains(BB*). NFC.
Provide an common way for testing if a statement contains something
for region and block statements. First user is
RegionGenerator::addOperandToPHI.

Suggested-by: Tobias Grosser <tobias@grosser.es>
llvm-svn: 298617
2017-03-23 16:12:21 +00:00
Simon Pilgrim 1c048ab6ba [X86][SSE] Extract elements from narrower shuffle masks.
Add support for widening narrow shuffle masks so we can directly extract from the relevant input vector of the shuffle.

llvm-svn: 298616
2017-03-23 16:09:34 +00:00
Matthew Simpson 1fb4064531 [LV] Delete unneeded scalar GEP creation code
The code for generating scalar base pointers in vectorizeMemoryInstruction is
not needed. We currently scalarize all GEPs and maintain the scalarized values
in VectorLoopValueMap. The GEP cloning in this unneeded code is the same as
that in scalarizeInstruction. The test cases that changed as a result of this
patch changed because we were able to reuse the scalarized GEP that we
previously generated instead of cloning a new one.

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

llvm-svn: 298615
2017-03-23 16:07:21 +00:00
Tim Shen ce26a45f7c [PPC] Add generated tests for all atomic operations
Summary: Add tests for all atomic operations for powerpc64le, so that all changes can be easily examined.

Reviewers: kbarton, hfinkel, echristo

Subscribers: mehdi_amini, nemanjai, llvm-commits

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

llvm-svn: 298614
2017-03-23 16:02:47 +00:00
Alex Shlyapnikov 86abf9aeb3 Bypass potential libc's sysconf interceptors
Summary:
sysconf(_SC_PAGESIZE) is called very early during sanitizer init and
any instrumented code (sysconf() wrapper/interceptor will likely be
instrumented) calling back to sanitizer before init is done will
most surely crash.

2nd attempt, now with glibc version checks (D31092 was reverted).

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 298613
2017-03-23 15:57:58 +00:00
Derek Schuff 9a4e45a0ed [WebAssembly] Fix import type to be signed LEBs
This fix is a follow up a previous change with stored
value types as signed integers in memory.

In future, once the yaml<->wasm binary patche lands we
can add test coverage for this kind of thing.

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

Patch by Sam Clegg

llvm-svn: 298612
2017-03-23 15:46:47 +00:00
Sanjay Patel 8db22f9032 [x86] add memcmp tests, remove run
Add tests for vector lengths that could be handled without a libcall.

There's an explicit test for 'nobuiltin', so there's not much value
in a separate run that checks that same behavior over and over again.

llvm-svn: 298611
2017-03-23 15:38:22 +00:00
Adrian McCarthy 1aa207d451 Add option to control whether llvm-pdbdump outputs in color
Adds -color-output option to llvm-pdbdump pretty commands that lets the user
specify whether the output should have color. The default depends on whether
the output is going to a TTY (per prior discussion in
https://reviews.llvm.org/D31246).

This will enable tests that pipe llvm-pdbdump output to FileCheck to work
across platforms without regard to the differences in ANSI codes.

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

llvm-svn: 298610
2017-03-23 15:28:15 +00:00
Igor Breger a8ba572dcf [GlobalISel][X86] Support G_STORE/G_LOAD operation
Summary:
1. Support pointer type as function argumnet and return value
2. G_STORE/G_LOAD - set legal action for i8/i16/i32/i64/f32/f64/vec128
3. RegisterBank - support typeless operations like G_STORE/G_LOAD, for scalar use GPR bank.
4. Support instruction selection for G_LOAD/G_STORE

Reviewers: zvi, rovka, ab, qcolombet

Reviewed By: rovka

Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank

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

llvm-svn: 298609
2017-03-23 15:25:57 +00:00
Alexander Kornienko 5816a8bbb1 [clang-tidy] Fix diag message for catch-by-value
Summary:
```
catch (std::exception ex)
{
}
```

Was flagged with "catch handler catches a pointer value".

Reviewers: alexfh, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits, JDevlieghere

Patch by Florian Gross!

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

llvm-svn: 298608
2017-03-23 15:17:44 +00:00
Alexander Kornienko c3acd2e9c0 [clang-tidy] Catch trivially true statements like a != 1 || a != 3
Catch trivially true statements of the form a != 1 || a != 3. Statements like
these are likely errors. They are particularly easy to miss when handling enums:

enum State {
RUNNING,
STOPPED,
STARTING,
ENDING
}

...
if (state != RUNNING || state != STARTING)
...

Patch by Blaise Watson!

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

llvm-svn: 298607
2017-03-23 15:13:54 +00:00
Vassil Vassilev 11ad339127 Publish RAIIObjectsForParser.h for external usage.
Some clients (eg the cling interpreter) need to recover their parser from
errors.

Patch by Axel Naumann (D31190)!

llvm-svn: 298606
2017-03-23 15:11:07 +00:00
Paul Osmialowski 0788515cb1 GOMP compatibility: add missing OpenMP4.0 task deps handling code
Differential Revision: https://reviews.llvm.org/D31071

llvm-svn: 298605
2017-03-23 15:03:17 +00:00
Nirav Dave e9ca32ae52 [SDAG] Fix zeroExtend assertion error
Move CombineTo preventing deleted node from being returned in
visitZERO_EXTEND.

Fixes PR32284.

Reviewers: RKSimon, bogner

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 298604
2017-03-23 15:01:50 +00:00
Vassil Vassilev a2285ebd4f Do not polute the source directory.
When a python script is run, by default it creates the bytecode file if the directory is writable, and this ‘pollutes’ source folders.

From python's help:
-B Don’t write .py[co] files on import. See also PYTHONDONTWRITEBYTECODE.

Patch by Pere Mato (D30604)!

llvm-svn: 298603
2017-03-23 14:54:34 +00:00
Dehao Chen 53a0c082d2 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
2017-03-23 14:43:10 +00:00
Bruce Mitchener 50910bf842 [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
2017-03-23 14:39:23 +00:00
Marshall Clow c53e96cb07 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
2017-03-23 14:20:43 +00:00
Zvi Rackover db4b032205 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
2017-03-23 14:08:26 +00:00
Marshall Clow c53faf7bca One more file for the random_shuffle removal
llvm-svn: 298598
2017-03-23 13:44:06 +00:00
Marshall Clow 0f37a41029 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
2017-03-23 13:43:37 +00:00
Strahinja Petrovic f9fa62e576 [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
2017-03-23 13:40:07 +00:00
Tobias Grosser 1f7e7d3d93 Update to isl-0.18-402-ga30c537
This is a regular maintenance update.

llvm-svn: 298595
2017-03-23 13:38:24 +00:00
Simon Pilgrim 8a18299f20 [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
2017-03-23 13:33:03 +00:00
Strahinja Petrovic cac14b5334 [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
2017-03-23 13:19:04 +00:00
Simon Pilgrim d341290b5c [X86][SSE] Add computeNumSignBits test for sitofp of (extended) i64 extracted element
llvm-svn: 298592
2017-03-23 13:18:09 +00:00
Simon Atanasyan 6ab0d5b0d1 [ELF] Print two more MIPS targets "supported" by LLD
These targets are related to MIPS N32 ABI.

llvm-svn: 298591
2017-03-23 12:17:32 +00:00
Igor Breger 8a924bea78 [GlobalISel][X86] clang-format. NFC
llvm-svn: 298590
2017-03-23 12:13:29 +00:00
Alex Lorenz f937139530 Support attributes for Objective-C categories
rdar://31095315

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

llvm-svn: 298589
2017-03-23 11:44:25 +00:00
Alex Lorenz a8fbef44fe [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
2017-03-23 11:14:27 +00:00
Alex Lorenz 5ffe4e14f1 [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
2017-03-23 10:46:05 +00:00
Michael Zuckerman 85436ece89 [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
2017-03-23 09:57:01 +00:00
Bruce Mitchener ef4536c389 Fix warnings from clang build on macOS.
Reviewers: lldb-commits

Subscribers: lldb-commits

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

llvm-svn: 298585
2017-03-23 09:52:26 +00:00
Craig Topper 93683b6aff [ValueTracking] Use APInt::isNegative instead of using operator[BitWidth-1]. NFCI
llvm-svn: 298584
2017-03-23 07:06:42 +00:00
Craig Topper d73c6b4ef8 [ValueTracking] Use setAllBits/setSignBit/setLowBits/setHighBits. NFCI
llvm-svn: 298583
2017-03-23 07:06:39 +00:00
Marshall Clow 28f105d7a6 Silence a couple of 'unused variable' warnings in c++03 tests. No functional change
llvm-svn: 298582
2017-03-23 06:25:26 +00:00