OSDN Git Service

android-x86/external-llvm.git
7 years ago[cmake] Declare LLVM_CMAKE_PATH for use in subprojects
Michal Gorny [Wed, 19 Oct 2016 12:18:34 +0000 (12:18 +0000)]
[cmake] Declare LLVM_CMAKE_PATH for use in subprojects

Declare the LLVM_CMAKE_PATH to the source directory location of CMake
files, in order to make it possible to easily use them in subprojects.
Such a variable is already declared in most of LLVM projects
(and inconsistently mixed with direct source tree references), including
Clang, LLDB, compiler-rt, libcxx... Declaring it inside main LLVM tree
makes it possible to avoid having to declare fallback values or use
conditionals in those projects.

It should be noted that in some of the subprojects LLVM_CMAKE_PATH is
used to reference generated LLVMConfig.cmake file. However, these
references are conditional to stand-alone builds and explicitly
including this file is unnecessary in combined builds.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284581 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Thumb-1] Synthesize TBB/TBH instructions to make use of compressed jump tables
James Molloy [Wed, 19 Oct 2016 12:06:49 +0000 (12:06 +0000)]
[Thumb-1] Synthesize TBB/TBH instructions to make use of compressed jump tables

The TBB and TBH instructions in Thumb-2 allow jump tables to be compressed into sequences of bytes or shorts respectively. These instructions do not exist in Thumb-1, however it is possible to synthesize them out of a sequence of other instructions.

It turns out this sequence is so short that it's almost never a lose for performance and is ALWAYS a significant win for code size.

TBB example:
Before: lsls r0, r0, #2    After: add  r0, pc
        adr  r1, .LJTI0_0         ldrb r0, [r0, #6]
        ldr  r0, [r0, r1]         lsls r0, r0, #1
        mov  pc, r0               add  pc, r0
  => No change in prologue code size or dynamic instruction count. Jump table shrunk by a factor of 4.

The only case that can increase dynamic instruction count is the TBH case:

Before: lsls r0, r4, #2    After: lsls r4, r4, #1
        adr  r1, .LJTI0_0         add  r4, pc
        ldr  r0, [r0, r1]         ldrh r4, [r4, #6]
        mov  pc, r0               lsls r4, r4, #1
                                  add  pc, r4
  => 1 more instruction in prologue. Jump table shrunk by a factor of 2.

So there is an argument that this should be disabled when optimizing for performance (and a TBH needs to be generated). I'm not so sure about that in practice, because on small cores with Thumb-1 performance is often tied to code size. But I'm willing to turn it off when optimizing for performance if people want (also note that TBHs are fairly rare in practice!)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284580 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] Just call isConstOrConstSplat directly. NFCI.
Simon Pilgrim [Wed, 19 Oct 2016 11:28:15 +0000 (11:28 +0000)]
[DAGCombiner] Just call isConstOrConstSplat directly. NFCI.

This will get the same ConstantSDNode scalar or vector splat value as the current separate dyn_cast<ConstantSDNode> / isVector() approach.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284578 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix line endings
Simon Pilgrim [Wed, 19 Oct 2016 11:16:58 +0000 (11:16 +0000)]
Fix line endings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284576 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombine] Generalize distributeTruncateThroughAnd to work with any non-opaque...
Simon Pilgrim [Wed, 19 Oct 2016 08:57:37 +0000 (08:57 +0000)]
[DAGCombine] Generalize distributeTruncateThroughAnd to work with any non-opaque constant or constant vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284574 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert of r284571 because of failing tests.
Sjoerd Meijer [Wed, 19 Oct 2016 07:45:48 +0000 (07:45 +0000)]
Revert of r284571 because of failing tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284572 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoChecking FP function attribute values and adding more build attribute tests.
Sjoerd Meijer [Wed, 19 Oct 2016 07:25:06 +0000 (07:25 +0000)]
Checking FP function attribute values and adding more build attribute tests.

This renames the function for checking FP function attribute values and also
adds more build attribute tests (which are in separate files because build
attributes are set per file).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284571 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDenseSet: Appease msc18 to define derived constructors explicitly.
NAKAMURA Takumi [Wed, 19 Oct 2016 05:43:17 +0000 (05:43 +0000)]
DenseSet: Appease msc18 to define derived constructors explicitly.

msc18 doesn't recognize "using BaseT::BaseT;"

  llvm\include\llvm/ADT/DenseSet.h(213) : error C2875: using-declaration causes a multiple declaration of 'BaseT'
          llvm\include\llvm/ADT/DenseSet.h(214) : see reference to class template instantiation 'llvm::DenseSet<ValueT,ValueInfoT>' being compiled
  llvm\include\llvm/ADT/DenseSet.h(231) : error C2875: using-declaration causes a multiple declaration of 'BaseT'
          llvm\include\llvm/ADT/DenseSet.h(232) : see reference to class template instantiation 'llvm::SmallDenseSet<ValueT,InlineBuckets,ValueInfoT>' being compiled

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284570 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Teach isel lowering that a subvector broadcast being inserted into both...
Craig Topper [Wed, 19 Oct 2016 04:44:17 +0000 (04:44 +0000)]
[AVX-512] Teach isel lowering that a subvector broadcast being inserted into both halves of a 512-bit vector can be combined into a larger subvector broadcast.

Summary:
This allows us to create broadcasts of 128-bit vector loads into 512-bit vectors.

New patterns added to support 8-bit and 16-bit vector types and v2f64/v2i64->v8f64/v8i64 without DQI instructions.

There also fallback patterns when the load can't be folded. These patterns are a little complex as we first need to insert the lower 128-bits into the second 128-bits using a zmm subvector insert instruction. We need to use a zmm insert in case VLX isn't available. Then use another zmm sub vector insert to take those 256-bits and insert them into the upper bits. Since we used a zmm insert to create the 256-bits we also need to do a extract_subreg to get just the lower 256-bits to pass to the second insert.

The outer insert for the fallback patterns should have its type correct because eventually we should also supported masked operations here too. So we need a DQI and a NoDQI version of the v16f32/v16i32 patterns.

Reviewers: RKSimon, delena, igorb

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284567 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate the section.ll to fix non-x86 failure.
Dehao Chen [Wed, 19 Oct 2016 03:53:41 +0000 (03:53 +0000)]
Update the section.ll to fix non-x86 failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284566 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r284545 again as the regression in ppc still exists. There is bug in MBPI...
Dehao Chen [Wed, 19 Oct 2016 01:18:25 +0000 (01:18 +0000)]
Revert r284545 again as the regression in ppc still exists. There is bug in MBPI exposed by th patch.

Also update the section.ll to fix non-x86 failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284563 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan] Replace std::to_string with llvm::to_string
Vitaly Buka [Wed, 19 Oct 2016 00:16:56 +0000 (00:16 +0000)]
[asan] Replace std::to_string with llvm::to_string

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284557 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] extend -print_coverage to also print uncovered lines, functions, and...
Kostya Serebryany [Wed, 19 Oct 2016 00:12:03 +0000 (00:12 +0000)]
[libFuzzer] extend -print_coverage to also print uncovered lines, functions, and files.

Example of output:
COVERAGE:
COVERED: in DSO2(int) /pathto/DSO2.cpp:6
COVERED: in DSO2(int) /pathto/DSO2.cpp:8
COVERED: in DSO1(int) /pathto/DSO1.cpp:6
COVERED: in DSO1(int) /pathto/DSO1.cpp:8
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:16
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:19
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:25
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:26
MODULE_WITH_COVERAGE: /pathto/libLLVMFuzzer-DSO1.so
UNCOVERED_LINE: in DSO1(int) /pathto/DSO1.cpp:9
UNCOVERED_FUNC: in Uncovered1()
MODULE_WITH_COVERAGE: /pathto/libLLVMFuzzer-DSO2.so
UNCOVERED_LINE: in DSO2(int) /pathto/DSO2.cpp:9
UNCOVERED_FUNC: in Uncovered2()
MODULE_WITH_COVERAGE: /pathto/LLVMFuzzer-DSOTest
UNCOVERED_LINE: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:21
UNCOVERED_LINE: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:27
UNCOVERED_FILE: /pathto/DSOTestExtra.cpp

Several things are not perfect here:
* we are using objdump+awk instead of sancov because sancov does not support DSOs yet.
* this breaks in the presence of ASAN_OPTIONS=strip_path_prefix=...
  (need to implement another API to get the module name by PC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284554 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan] Simplify calculation of stack frame layout extraction calculation of stack...
Vitaly Buka [Tue, 18 Oct 2016 23:29:52 +0000 (23:29 +0000)]
[asan] Simplify calculation of stack frame layout extraction calculation of stack description into separate function.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284547 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan] Append line number to variable name if line is available and in the same file...
Vitaly Buka [Tue, 18 Oct 2016 23:29:41 +0000 (23:29 +0000)]
[asan] Append line number to variable name if line is available and in the same file as the function.

PR30498

Reviewers: eugenis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284546 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUsing branch probability to guide critical edge splitting.
Dehao Chen [Tue, 18 Oct 2016 23:24:02 +0000 (23:24 +0000)]
Using branch probability to guide critical edge splitting.

Summary:
The original heuristic to break critical edge during machine sink is relatively conservertive: when there is only one instruction sinkable to the critical edge, it is likely that the machine sink pass will not break the critical edge. This leads to many speculative instructions executed at runtime. However, with profile info, we could model the splitting benefits: if the critical edge has 50% taken rate, it would always be beneficial to split the critical edge to avoid the speculated runtime instructions. This patch uses profile to guide critical edge splitting in machine sink pass.

The performance impact on speccpu2006 on Intel sandybridge machines:

spec/2006/fp/C++/444.namd                  25.3  +0.26%
spec/2006/fp/C++/447.dealII               45.96  -0.10%
spec/2006/fp/C++/450.soplex               41.97  +1.49%
spec/2006/fp/C++/453.povray               36.83  -0.96%
spec/2006/fp/C/433.milc                   23.81  +0.32%
spec/2006/fp/C/470.lbm                    41.17  +0.34%
spec/2006/fp/C/482.sphinx3                48.13  +0.69%
spec/2006/int/C++/471.omnetpp             22.45  +3.25%
spec/2006/int/C++/473.astar               21.35  -2.06%
spec/2006/int/C++/483.xalancbmk           36.02  -2.39%
spec/2006/int/C/400.perlbench              33.7  -0.17%
spec/2006/int/C/401.bzip2                  22.9  +0.52%
spec/2006/int/C/403.gcc                   32.42  -0.54%
spec/2006/int/C/429.mcf                   39.59  +0.19%
spec/2006/int/C/445.gobmk                 26.98  -0.00%
spec/2006/int/C/456.hmmer                 24.52  -0.18%
spec/2006/int/C/458.sjeng                 28.26  +0.02%
spec/2006/int/C/462.libquantum            55.44  +3.74%
spec/2006/int/C/464.h264ref               46.67  -0.39%

geometric mean                                   +0.20%

Manually checked 473 and 471 to verify the diff is in the noise range.

Reviewers: rengolin, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284545 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorevert r284541.
Dehao Chen [Tue, 18 Oct 2016 23:11:20 +0000 (23:11 +0000)]
revert r284541.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284544 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoConditionally eliminate library calls where the result value is not used
Rong Xu [Tue, 18 Oct 2016 21:36:27 +0000 (21:36 +0000)]
Conditionally eliminate library calls where the result value is not used

Summary:
This pass shrink-wraps a condition to some library calls where the call
result is not used. For example:
   sqrt(val);
 is transformed to
   if (val < 0)
     sqrt(val);
Even if the result of library call is not being used, the compiler cannot
safely delete the call because the function can set errno on error
conditions.
Note in many functions, the error condition solely depends on the incoming
parameter. In this optimization, we can generate the condition can lead to
the errno to shrink-wrap the call. Since the chances of hitting the error
condition is low, the runtime call is effectively eliminated.

These partially dead calls are usually results of C++ abstraction penalty
exposed by inlining. This optimization hits 108 times in 19 C/C++ programs
in SPEC2006.

Reviewers: hfinkel, mehdi_amini, davidxl

Subscribers: modocache, mgorny, mehdi_amini, xur, llvm-commits, beanz

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284542 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUsing branch probability to guide critical edge splitting.
Dehao Chen [Tue, 18 Oct 2016 21:36:11 +0000 (21:36 +0000)]
Using branch probability to guide critical edge splitting.

Summary:
The original heuristic to break critical edge during machine sink is relatively conservertive: when there is only one instruction sinkable to the critical edge, it is likely that the machine sink pass will not break the critical edge. This leads to many speculative instructions executed at runtime. However, with profile info, we could model the splitting benefits: if the critical edge has 50% taken rate, it would always be beneficial to split the critical edge to avoid the speculated runtime instructions. This patch uses profile to guide critical edge splitting in machine sink pass.

The performance impact on speccpu2006 on Intel sandybridge machines:

spec/2006/fp/C++/444.namd                  25.3  +0.26%
spec/2006/fp/C++/447.dealII               45.96  -0.10%
spec/2006/fp/C++/450.soplex               41.97  +1.49%
spec/2006/fp/C++/453.povray               36.83  -0.96%
spec/2006/fp/C/433.milc                   23.81  +0.32%
spec/2006/fp/C/470.lbm                    41.17  +0.34%
spec/2006/fp/C/482.sphinx3                48.13  +0.69%
spec/2006/int/C++/471.omnetpp             22.45  +3.25%
spec/2006/int/C++/473.astar               21.35  -2.06%
spec/2006/int/C++/483.xalancbmk           36.02  -2.39%
spec/2006/int/C/400.perlbench              33.7  -0.17%
spec/2006/int/C/401.bzip2                  22.9  +0.52%
spec/2006/int/C/403.gcc                   32.42  -0.54%
spec/2006/int/C/429.mcf                   39.59  +0.19%
spec/2006/int/C/445.gobmk                 26.98  -0.00%
spec/2006/int/C/456.hmmer                 24.52  -0.18%
spec/2006/int/C/458.sjeng                 28.26  +0.02%
spec/2006/int/C/462.libquantum            55.44  +3.74%
spec/2006/int/C/464.h264ref               46.67  -0.39%

geometric mean                                   +0.20%

Manually checked 473 and 471 to verify the diff is in the noise range.

Reviewers: rengolin, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284541 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodwarfdump: add space missing from the type unit header description
David Blaikie [Tue, 18 Oct 2016 21:18:43 +0000 (21:18 +0000)]
dwarfdump: add space missing from the type unit header description

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284540 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodwarfdump: Include the name in the unit description, even in non-summarized mode
David Blaikie [Tue, 18 Oct 2016 21:16:45 +0000 (21:16 +0000)]
dwarfdump: Include the name in the unit description, even in non-summarized mode

(accidentally removed this from my previous change when I was rejecting
some clang-format formatting... )

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284539 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd target for test to fix regression introduced by r284533.
Dehao Chen [Tue, 18 Oct 2016 21:13:31 +0000 (21:13 +0000)]
Add target for test to fix regression introduced by r284533.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284538 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodwarfdump: -summarize-types: print a short summary (unqualified type name, hash,...
David Blaikie [Tue, 18 Oct 2016 21:09:48 +0000 (21:09 +0000)]
dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents

This is just a quick utility handy for getting rough summaries of types
in a given object or dwo file. I've been using it to investigate the
amount of type info redundancy across a project build, for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284537 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprove ARM lowering for "icmp <2 x i64> eq".
Eli Friedman [Tue, 18 Oct 2016 21:03:40 +0000 (21:03 +0000)]
Improve ARM lowering for "icmp <2 x i64> eq".

The custom lowering is pretty straightforward: basically, just AND
together the two halves of a <4 x i32> compare.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284536 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GVN] Consistently use division instead of shift. NFCI.
Davide Italiano [Tue, 18 Oct 2016 21:02:27 +0000 (21:02 +0000)]
[GVN] Consistently use division instead of shift. NFCI.

This is in line with other places of GVN (e.g. load coercion
logic).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284535 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GVN] Remove dead code. NFC.
Davide Italiano [Tue, 18 Oct 2016 21:00:26 +0000 (21:00 +0000)]
[GVN] Remove dead code. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284534 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse profile info to set function section prefix to group hot/cold functions.
Dehao Chen [Tue, 18 Oct 2016 20:42:47 +0000 (20:42 +0000)]
Use profile info to set function section prefix to group hot/cold functions.

Summary:
The original implementation is in r261607, which was reverted in r269726 to accomendate the ProfileSummaryInfo analysis pass. The new implementation:
1. add a new metadata for function section prefix
2. query against ProfileSummaryInfo in CGP to set the correct section prefix for each function
3. output the section prefix set by CGP

Reviewers: davidxl, eraman

Subscribers: vsk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284533 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Fix test triplet
Evandro Menezes [Tue, 18 Oct 2016 20:41:30 +0000 (20:41 +0000)]
[AArch64] Fix test triplet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284532 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Avoid materializing 0.0 when generating FP SELECT
Evandro Menezes [Tue, 18 Oct 2016 20:37:35 +0000 (20:37 +0000)]
[AArch64] Avoid materializing 0.0 when generating FP SELECT

Transform `a == 0.0 ? 0.0 : x` to `a == 0.0 ? a : x` and `a != 0.0 ? x : 0.0`
to `a != 0.0 ? x : a` to avoid materializing 0.0 for FCSEL, since it does not
have to be materialized beforehand for FCMP, as it has a form that has 0.0
as an implicit operand.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284531 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoOne more additional error check for invalid Mach-O files for a
Kevin Enderby [Tue, 18 Oct 2016 20:24:12 +0000 (20:24 +0000)]
One more additional error check for invalid Mach-O files for a
load command that use the MachO:: linkedit_data_command
type but is not used in llvm libObject code but used in llvm tool code.

This is for the LC_CODE_SIGNATURE load command.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284529 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: translate the @llvm.objectsize intrinsic.
Tim Northover [Tue, 18 Oct 2016 20:03:51 +0000 (20:03 +0000)]
GlobalISel: translate the @llvm.objectsize intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284527 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: select small binary operations on AArch64.
Tim Northover [Tue, 18 Oct 2016 20:03:48 +0000 (20:03 +0000)]
GlobalISel: select small binary operations on AArch64.

AArch64 actually supports many 8-bit operations under the definition used by
GlobalISel: the designated information-carrying bits of a GPR32 get the right
value if you just use the normal 32-bit instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284526 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: translate memcpy intrinsics.
Tim Northover [Tue, 18 Oct 2016 20:03:45 +0000 (20:03 +0000)]
GlobalISel: translate memcpy intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284525 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove unused typedef
Mandeep Singh Grang [Tue, 18 Oct 2016 20:01:12 +0000 (20:01 +0000)]
Remove unused typedef

Summary: Unused: typedef SmallSetVector<RegionT *, 4> RegionSet

Reviewers: MatzeB, grosser

Subscribers: zinob

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284524 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: support floating-point constants on AArch64.
Tim Northover [Tue, 18 Oct 2016 19:47:57 +0000 (19:47 +0000)]
GlobalISel: support floating-point constants on AArch64.

Patch from Ahmed Bougacha.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284523 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Handle block live-ins with lane masks in HexagonBlockRanges
Krzysztof Parzyszek [Tue, 18 Oct 2016 19:47:20 +0000 (19:47 +0000)]
[Hexagon] Handle block live-ins with lane masks in HexagonBlockRanges

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284522 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReduce global namespace pollution. NFC.
Benjamin Kramer [Tue, 18 Oct 2016 19:39:31 +0000 (19:39 +0000)]
Reduce global namespace pollution. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284521 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[esan] Remove global variable.
Benjamin Kramer [Tue, 18 Oct 2016 19:39:23 +0000 (19:39 +0000)]
[esan] Remove global variable.

It's not thread safe and completely unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284520 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Added vector lshr/shl combine tests
Simon Pilgrim [Tue, 18 Oct 2016 19:28:12 +0000 (19:28 +0000)]
[X86][SSE] Added vector lshr/shl combine tests

This doesn't cover all combines in DAGCombiner::visitSRL/visitSHL yet, but identifies several cases where we fail to combine vectors (or non-splatted) vectors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284518 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InterleavedAccessPass] Remove global variable.
Benjamin Kramer [Tue, 18 Oct 2016 18:59:58 +0000 (18:59 +0000)]
[InterleavedAccessPass] Remove global variable.

This is a threading hazard and rightfully complained about by tsan. No
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284515 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] detect leaks after every run when executing fixed inputs (./fuzzer -runs...
Kostya Serebryany [Tue, 18 Oct 2016 18:38:08 +0000 (18:38 +0000)]
[libFuzzer] detect leaks after every run when executing fixed inputs (./fuzzer -runs=1000000 my-file)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284514 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorevert r284495: [Target] remove TargetRecip class
Sanjay Patel [Tue, 18 Oct 2016 18:36:49 +0000 (18:36 +0000)]
revert r284495: [Target] remove TargetRecip class

There's something wrong with the StringRef usage while parsing the attribute string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284513 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[sancov] add __sanitizer_cov_trace_pc_guard to the supported coverage points
Kostya Serebryany [Tue, 18 Oct 2016 18:11:42 +0000 (18:11 +0000)]
[sancov] add __sanitizer_cov_trace_pc_guard to the supported coverage points

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284509 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] reshuffle the code for -exit_on_src_pos and -exit_on_item
Kostya Serebryany [Tue, 18 Oct 2016 18:06:05 +0000 (18:06 +0000)]
[libFuzzer] reshuffle the code for -exit_on_src_pos and -exit_on_item

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284508 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan] Rename test file as the poisoning is not "experimental"
Vitaly Buka [Tue, 18 Oct 2016 18:05:06 +0000 (18:05 +0000)]
[asan] Rename test file as the poisoning is not "experimental"

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284507 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan] Combine check-prefixes in stack-poisoning test
Vitaly Buka [Tue, 18 Oct 2016 18:05:04 +0000 (18:05 +0000)]
[asan] Combine check-prefixes in stack-poisoning test

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284506 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[asan] Make -asan-experimental-poisoning the only behavior
Vitaly Buka [Tue, 18 Oct 2016 18:04:59 +0000 (18:04 +0000)]
[asan] Make -asan-experimental-poisoning the only behavior

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284505 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNext set of additional error checks for invalid Mach-O files for the
Kevin Enderby [Tue, 18 Oct 2016 17:54:17 +0000 (17:54 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::routines_command and
and MachO::routines_command_64 types but are not used in llvm
libObject code but used in llvm tool code.

This includes the LC_ROUTINES and LC_ROUTINES_64
load commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284504 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Remove CachedHash<T>.
Justin Lebar [Tue, 18 Oct 2016 17:50:39 +0000 (17:50 +0000)]
[ADT] Remove CachedHash<T>.

Nobody is using it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284503 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] Make CompareValueComplexity a little bit smarter
Sanjoy Das [Tue, 18 Oct 2016 17:45:16 +0000 (17:45 +0000)]
[SCEV] Make CompareValueComplexity a little bit smarter

This helps canonicalization in some cases.

Thanks to Pankaj Chawla for the investigation and the test case!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284501 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] Extract out a helper function; NFC
Sanjoy Das [Tue, 18 Oct 2016 17:45:13 +0000 (17:45 +0000)]
[SCEV] Extract out a helper function; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284500 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Added vector ashr combine tests
Simon Pilgrim [Tue, 18 Oct 2016 17:31:07 +0000 (17:31 +0000)]
[X86][SSE] Added vector ashr combine tests

This doesn't cover all combines in DAGCombiner::visitSRA yet, but identifies several cases where we fail to combine vectors (or non-splatted) vectors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284498 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[docs] Increase minimum supported GCC version for building LLVM to 4.8
Teresa Johnson [Tue, 18 Oct 2016 17:17:37 +0000 (17:17 +0000)]
[docs] Increase minimum supported GCC version for building LLVM to 4.8

Summary:
The RFC proposal sent to increase the minimum required GCC version
to 4.8 received a lot of support. See the following thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105955.html,

This patch implements that by updating the docs. I believe the
references to libstdc++ 4.7 issues can be removed as well, please
let me know if that is not the case or if they should be updated
a different way.

Reviewers: rengolin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284497 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Target] remove TargetRecip class; move reciprocal estimate isel functionality to...
Sanjay Patel [Tue, 18 Oct 2016 17:05:05 +0000 (17:05 +0000)]
[Target] remove TargetRecip class; move reciprocal estimate isel functionality to TargetLowering

This is a follow-up to D24816 - where we changed reciprocal estimates to be function attributes
rather than TargetOptions.

This patch is intended to be a structural, but not functional change. By moving all of the
TargetRecip functionality into TargetLowering, we can remove all of the reciprocal estimate
state, shield the callers from the string format implementation, and simplify/localize the
logic needed for a target to enable this.

If a function has a "reciprocal-estimates" attribute, those settings may override the target's
default reciprocal preferences for whatever operation and data type we're trying to optimize.
If there's no attribute string or specific setting for the op/type pair, just use the target
default settings.

As noted earlier, a better solution would be to move the reciprocal estimate settings to IR
instructions and SDNodes rather than function attributes, but that's a multi-step job that
requires infrastructure improvements. I intend to work on that, but it's not clear how long
it will take to get all the pieces in place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284495 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAGCombiner] Add splatted vector support to (udiv x, (shl pow2, y)) -> x >>u (log2...
Simon Pilgrim [Tue, 18 Oct 2016 16:36:00 +0000 (16:36 +0000)]
[DAGCombiner] Add splatted vector support to (udiv x, (shl pow2, y)) -> x >>u (log2(pow2)+y)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284491 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDisable fatal errors in the Verifier instantiated by bugpoint's crash
Adrian Prantl [Tue, 18 Oct 2016 16:24:43 +0000 (16:24 +0000)]
Disable fatal errors in the Verifier instantiated by bugpoint's crash
debugger.

When bugpoint hacks at a testcase it may at one point create illegal
debug info metadata that won't even pass the Verifier. A bugpoint
*driver* built with assertions should not assert on it, but reject the
malformed intermediate step and continue to do its job.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284490 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512] Add mask/maskz writemask support to constant pool shuffle decode commentx
Simon Pilgrim [Tue, 18 Oct 2016 15:45:37 +0000 (15:45 +0000)]
[X86][AVX512] Add mask/maskz writemask support to constant pool shuffle decode commentx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284488 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips][ias] Handle more complicated expressions for memory operands
Simon Dardis [Tue, 18 Oct 2016 15:17:17 +0000 (15:17 +0000)]
[mips][ias] Handle more complicated expressions for memory operands

This patch teaches ias for mips to handle expressions such as
(8*4)+(8*31)($sp). Such expression typically occur from the expansion
of multiple macro definitions.

This partially resolves PR/30383.

Thanks to Sean Bruno for reporting the issue!

Reviewers: zoran.jovanovic, vkalintiris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284485 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Fix sync instruction definition
Simon Dardis [Tue, 18 Oct 2016 14:42:13 +0000 (14:42 +0000)]
[mips] Fix sync instruction definition

The 'sync' instruction for MIPS was defined in MIPS-II as taking no operands.
MIPS32 extended the define of 'sync' as taking an optional unsigned 5 bit
immediate.

This patch correct the definition of sync so that it is accepted with an
operand of 0 or no operand for MIPS-II to MIPS-V, and a 5 bit unsigned
immediate for MIPS32 and later revisions.

Additionally a clear error is given when the MIPS32 version of sync is
used when targeting pre MIPS32.

This partially resolves PR/30714.

Thanks to Daniel Sanders for reporting this issue!

Reveiwers: vkalintiris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284483 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDebugInfo: change alignment type from uint64_t to uint32_t to save space.
Victor Leschuk [Tue, 18 Oct 2016 14:31:22 +0000 (14:31 +0000)]
DebugInfo: change alignment type from uint64_t to uint32_t to save space.
In futher patches we shall have alignment field added to DIVariable family
and switching from uint64_t to uint32_t will save 4 bytes per variable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284482 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Macro expansion for ld, sd for O32
Simon Dardis [Tue, 18 Oct 2016 14:28:00 +0000 (14:28 +0000)]
[mips] Macro expansion for ld, sd for O32

ld and sd when assembled for the O32 ABI expand to a pair of 32 bit word loads
or stores using the specified source or destination register and the next
register.

This patch does not add support for the cases where the offset is greater than
a 16 bit signed immediate as that would lead to a wrong/misleading error
message as the assembler would report "instruction requires a CPU feature
not currently enabled" for ld & sd for MIPS64 when their offset is not a signed
16 bit number.

This fixes PR/29159.

Thanks to Sean Bruno for reporting this issue!

Reviewers: vkalintiris, seanbruno, zoran.jovanovic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284481 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks
Michael Zuckerman [Tue, 18 Oct 2016 13:52:39 +0000 (13:52 +0000)]
[x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks

Committing on behalf of Coby Tayree: After check-all and LGTM

Desc:

AVX512 allows dest operand to be followed by an op-mask register specifier ('{k<num>}', which in turn may be followed by a merging/zeroing specifier ('{z}')
 Currently, the following forms are allowed:
 {k<num>}
 {k<num>}{z}

This patch allows the following forms:
 {z}{k<num>}

and ignores the next form:
 {z}

Justification would be quite simple - GCC

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284479 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoStrip trailing whitespace (NFCI)
Simon Pilgrim [Tue, 18 Oct 2016 13:44:00 +0000 (13:44 +0000)]
Strip trailing whitespace (NFCI)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284478 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips][FastISel] Instantiate the MipsFastISel class only for targets that support...
Vasileios Kalintiris [Tue, 18 Oct 2016 13:05:42 +0000 (13:05 +0000)]
[mips][FastISel] Instantiate the MipsFastISel class only for targets that support FastISel.

Summary:
Instead of instantiating the MipsFastISel class and checking if the
target is supported in the overriden methods, we should perform that
check before creating the class. This allows us to enable FastISel *only*
for targets that truly support it, ie. MIPS32 to MIPS32R5.

Reviewers: sdardis

Subscribers: ehostunreach, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284475 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-readobj] - Teach readobj to print PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED...
George Rimar [Tue, 18 Oct 2016 10:54:56 +0000 (10:54 +0000)]
[llvm-readobj] - Teach readobj to print PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED headers.

These are OpenBSD specific program headers and
currently we support them in LLD.

Description of headers (just in case) available here:
http://man.openbsd.org/OpenBSD-current/man5/elf.5

OpenBSD commits were:
For PT_OPENBSD_RANDOMIZE:
https://github.com/openbsd/src/commit/c494713c450d98da3f2e1451ee8c7fb675a7c461
For PT_OPENBSD_WXNEEDED:
https://github.com/openbsd/src/commit/2a5a8fc7e30928c2cff57cfe5fb491c90d8478ad

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284471 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] More accurate calculation of max backedge count of some less-than loops
John Brawn [Tue, 18 Oct 2016 10:10:53 +0000 (10:10 +0000)]
[SCEV] More accurate calculation of max backedge count of some less-than loops

In loops that look something like
 i = n;
 do {
  ...
 } while(i++ < n+k);
where k is a constant, the maximum backedge count is k (in fact the backedge
count will be either 0 or k, depending on whether n+k wraps). More generally
for LHS < RHS if RHS-(LHS of first comparison) is a constant then the loop will
iterate either 0 or that constant number of times.

This allows for more loop unrolling with the recent upper bound loop unrolling
changes, and I'm working on a patch that will let loop unrolling additionally
make use of the loop being executed either 0 or k times (we need to retain the
loop comparison only on the first unrolled iteration).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284465 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Resubmit "Add support for advanced number formatting.""
Renato Golin [Tue, 18 Oct 2016 09:30:18 +0000 (09:30 +0000)]
Revert "Resubmit "Add support for advanced number formatting.""

This reverts commits 284436 and 284437 because they still break AArch64 bots:

Value of: format_number(-10, IntegerStyle::Integer, 1)
  Actual: "-0"
  Expected: "-10"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284462 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Added extra (mul x, (1 << c)) -> x << c style vector tests
Simon Pilgrim [Tue, 18 Oct 2016 09:29:13 +0000 (09:29 +0000)]
[X86][SSE] Added extra (mul x, (1 << c)) -> x << c style vector tests

vXi64 will benefit more from lowering to shifts than multiplies

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284461 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Assign cost of scaling for Cortex-R52
Javed Absar [Tue, 18 Oct 2016 09:08:54 +0000 (09:08 +0000)]
[ARM] Assign cost of scaling for Cortex-R52

This patch assigns cost of the scaling used in addressing for Cortex-R52.

On Cortex-R52 a negated register offset takes longer than a non-negated
register offset, in a register-offset addressing mode.

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

Reviewer: jmolloy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284460 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Add lowering to cvttpd2dq/cvttps2dq for sitofp v2f64/2f32 to 2i32
Simon Pilgrim [Tue, 18 Oct 2016 07:42:15 +0000 (07:42 +0000)]
[X86][SSE] Add lowering to cvttpd2dq/cvttps2dq for sitofp v2f64/2f32 to 2i32

As discussed on PR28461 we currently miss the chance to lower "fptosi <2 x double> %arg to <2 x i32>" to cvttpd2dq due to its use of illegal types.

This patch adds support for fptosi to 2i32 from both 2f64 and 2f32.

It also recognises that cvttpd2dq zeroes the upper 64-bits of the xmm result (similar to D23797) - we still don't do this for the cvttpd2dq/cvttps2dq intrinsics - this can be done in a future patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284459 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[XRay] Support for for tail calls for ARM no-Thumb
Dean Michael Berris [Tue, 18 Oct 2016 05:54:15 +0000 (05:54 +0000)]
[XRay] Support for for tail calls for ARM no-Thumb

This patch adds simplified support for tail calls on ARM with XRay instrumentation.

Known issue: compiled with generic flags: `-O3 -g -fxray-instrument -Wall
-std=c++14  -ffunction-sections -fdata-sections` (this list doesn't include my
specific flags like --target=armv7-linux-gnueabihf etc.), the following program

    #include <cstdio>
    #include <cassert>
    #include <xray/xray_interface.h>

    [[clang::xray_always_instrument]] void __attribute__ ((noinline)) fC() {
      std::printf("In fC()\n");
    }

    [[clang::xray_always_instrument]] void __attribute__ ((noinline)) fB() {
      std::printf("In fB()\n");
      fC();
    }

    [[clang::xray_always_instrument]] void __attribute__ ((noinline)) fA() {
      std::printf("In fA()\n");
      fB();
    }

    // Avoid infinite recursion in case the logging function is instrumented (so calls logging
    //   function again).
    [[clang::xray_never_instrument]] void simplyPrint(int32_t functionId, XRayEntryType xret)
    {
      printf("XRay: functionId=%d type=%d.\n", int(functionId), int(xret));
    }

    int main(int argc, char* argv[]) {
      __xray_set_handler(simplyPrint);

      printf("Patching...\n");
      __xray_patch();
      fA();

      printf("Unpatching...\n");
      __xray_unpatch();
      fA();

      return 0;
    }

gives the following output:

    Patching...
    XRay: functionId=3 type=0.
    In fA()
    XRay: functionId=3 type=1.
    XRay: functionId=2 type=0.
    In fB()
    XRay: functionId=2 type=1.
    XRay: functionId=1 type=0.
    XRay: functionId=1 type=1.
    In fC()
    Unpatching...
    In fA()
    In fB()
    In fC()

So for function fC() the exit sled seems to be called too much before function
exit: before printing In fC().

Debugging shows that the above happens because printf from fC is also called as
a tail call. So first the exit sled of fC is executed, and only then printf is
jumped into. So it seems we can't do anything about this with the current
approach (i.e. within the simplification described in
https://reviews.llvm.org/D23988 ).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284456 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Add test case to check shuffle decoding for masked vpermilps for r284450.
Craig Topper [Tue, 18 Oct 2016 05:44:04 +0000 (05:44 +0000)]
[AVX-512] Add test case to check shuffle decoding for masked vpermilps for r284450.

This is harder to do for vpermilpd as shuffle combining turns the constant vector into an immediate since all vpermilpd's inputs with constant vector can also be encoded with the immediate form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284455 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoObject: Add a missing return in ObjectFile::createObjectFile
Justin Bogner [Tue, 18 Oct 2016 05:17:23 +0000 (05:17 +0000)]
Object: Add a missing return in ObjectFile::createObjectFile

When Error was threaded through these APIs back in r265606 the
"return" was missed here, which triggers a warning if/when I add
LLVM_NODISCARD to the Error type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284454 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Fix DecodeVPERMVMask to handle cases where the constant pool entry has a differ...
Craig Topper [Tue, 18 Oct 2016 04:48:33 +0000 (04:48 +0000)]
[X86] Fix DecodeVPERMVMask to handle cases where the constant pool entry has a different type than the shuffle itself.

This is especially important for 32-bit targets with 64-bit shuffle elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284453 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoImprove tablegen gen-subtarget diagnostics for missing machine models.
Andrew Trick [Tue, 18 Oct 2016 04:17:44 +0000 (04:17 +0000)]
Improve tablegen gen-subtarget diagnostics for missing machine models.

-debug-only=subtarget-emitter prints a lot of machine model diagnostics.
This prunes the output so that the "No machine model for XXX on processor YYY"
only appears when there is definitely no machine model for that opcode.
Previously it was printing that error even if the opcode was covered by
a more general scheduling class.

<rdar://problem/15919845> [TableGen][CodeGenSchedule] Debug output does not help spotting the missing scheduling classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284452 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Fix DecodeVPERMV3Mask to handle cases where the constant pool entry has...
Craig Topper [Tue, 18 Oct 2016 04:00:32 +0000 (04:00 +0000)]
[AVX-512] Fix DecodeVPERMV3Mask to handle cases where the constant pool entry has a different type than the shuffle itself.

Summary: This is especially important for 32-bit targets with 64-bit shuffle elements.This is similar to how PSHUFB and VPERMIL handle the same problem.

Reviewers: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284451 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Add support for decoding shuffle mask from constant pool for masked VPERMIL...
Craig Topper [Tue, 18 Oct 2016 03:36:52 +0000 (03:36 +0000)]
[AVX-512] Add support for decoding shuffle mask from constant pool for masked VPERMILPS/PD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284450 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix differences in codegen between Linux and Windows toolchains
Mandeep Singh Grang [Tue, 18 Oct 2016 00:11:19 +0000 (00:11 +0000)]
Fix differences in codegen between Linux and Windows toolchains

Summary:
    There are differences in codegen between Linux and Windows due to:
    1. Using std::sort which uses quicksort which is a non-stable sort.

    2. Iterating over Set data structure where the iteration order is
       non deterministic.

Reviewers: arsenm, grosbach, junbuml, zinob, MatzeB

Subscribers: MatzeB, wdng

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284441 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRename HexStyle -> HexFormatStyle, and remove a constexpr.
Zachary Turner [Mon, 17 Oct 2016 23:08:47 +0000 (23:08 +0000)]
Rename HexStyle -> HexFormatStyle, and remove a constexpr.

This should fix the remaining broken builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284437 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoResubmit "Add support for advanced number formatting."
Zachary Turner [Mon, 17 Oct 2016 22:49:24 +0000 (22:49 +0000)]
Resubmit "Add support for advanced number formatting."

This resubmits commits 284425 and r284428, which were reverted
in r284429 due to some infinite recursion caused by an incorrect
selection of function overloads.  Reproduced the failure on Linux
using GCC 4.8.4, and confirmed that with the new patch the tests
path on GCC as well as MSVC.  So hopefully this fixes everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284436 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Mark .note section SHF_ALLOC so lld creates a segment for it
Konstantin Zhuravlyov [Mon, 17 Oct 2016 22:40:15 +0000 (22:40 +0000)]
[AMDGPU] Mark .note section SHF_ALLOC so lld creates a segment for it

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284435 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef.
Justin Lebar [Mon, 17 Oct 2016 22:24:36 +0000 (22:24 +0000)]
[ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef.

Summary:
Reclaiming the name 'CachedHashString' will let us add a type with that
name that owns its value.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284434 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Add an initializer_list constructor to {Small,}DenseSet.
Justin Lebar [Mon, 17 Oct 2016 22:24:32 +0000 (22:24 +0000)]
[ADT] Add an initializer_list constructor to {Small,}DenseSet.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284433 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Add SmallDenseSet.
Justin Lebar [Mon, 17 Oct 2016 22:24:28 +0000 (22:24 +0000)]
[ADT] Add SmallDenseSet.

Summary: This matches SmallDenseMap.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284432 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNext set of additional error checks for invalid Mach-O files for the
Kevin Enderby [Mon, 17 Oct 2016 22:09:25 +0000 (22:09 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::sub_framework_command,
MachO::sub_umbrella_command, MachO::sub_library_command
and MachO::sub_client_command types but are not used in llvm
libObject code but used in llvm tool code.

This includes the LC_SUB_FRAMEWORK, LC_SUB_UMBRELLA,
LC_SUB_LIBRARY and LC_SUB_CLIENT load commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284431 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert formatting changes.
Zachary Turner [Mon, 17 Oct 2016 21:25:41 +0000 (21:25 +0000)]
Revert formatting changes.

This reverts r288425 and r284428 as they are causing test crashes
on some systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284429 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTry to fix build after invalid pointer conversion.
Zachary Turner [Mon, 17 Oct 2016 21:14:27 +0000 (21:14 +0000)]
Try to fix build after invalid pointer conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284428 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoremove FIXME comment (fixed with r284424); NFC
Sanjay Patel [Mon, 17 Oct 2016 21:08:39 +0000 (21:08 +0000)]
remove FIXME comment (fixed with r284424); NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284427 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Add support for "advanced" number formatting.
Zachary Turner [Mon, 17 Oct 2016 20:57:45 +0000 (20:57 +0000)]
[Support] Add support for "advanced" number formatting.

raw_ostream has not afforded a lot of flexibility in terms of
how to format numbers when outputting.  Wrap this all up into
a set of low level helper functions that can be used to output
numbers with arbitrary precision, alignment, format, etc and
then update raw_ostream to use these functions.

This will be useful for upcoming improvements to llvm's string
formatting libraries, but are still useful independently.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284425 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] use isConstOrConstSplat in ComputeNumSignBits to optimize SRA
Sanjay Patel [Mon, 17 Oct 2016 20:41:39 +0000 (20:41 +0000)]
[DAG] use isConstOrConstSplat in ComputeNumSignBits to optimize SRA

The scalar version of this pattern was noted in:
https://reviews.llvm.org/D25485

and fixed with:
https://reviews.llvm.org/rL284395

More refactoring of the constant/splat helpers is needed and will happen in follow-up patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284424 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] make isConstOrConstSplat and isConstOrConstSplatFP more accessible; NFC
Sanjay Patel [Mon, 17 Oct 2016 20:26:46 +0000 (20:26 +0000)]
[DAG] make isConstOrConstSplat and isConstOrConstSplatFP more accessible; NFC

As noted in:
https://reviews.llvm.org/D25685

This is the next-to-smallest step needed to enable the ComputeNumSignBits fix in that patch.
In a minor attempt to keep some structure, we're pulling the FP helper over along with its
integer sibling, but clearly we can and should do more refactoring of the similar helper
functions in DAGCombiner and SelectionDAG to simplify and not duplicate functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284421 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[opt] Strip coverage if debug info is not present.
Davide Italiano [Mon, 17 Oct 2016 20:05:35 +0000 (20:05 +0000)]
[opt] Strip coverage if debug info is not present.

If -coverage is passed, but -g is not, clang populates the PassManager
pipeline with StripSymbols(debugOnly = true).
The stripSymbol pass therefore scans the list of named metadata,
drops !llvm.dbg.cu, but leaves !llvm.gcov and !0 (the compileUnit MD)
around. The verifier runs, and finds out that there's a CU not listed
in !llvm.dbg.cu (as it was previously dropped) -> crash.
When we strip debug info, so, check if there's coverage data,
and strip it as well, in order to avoid pending metadata left around.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284418 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIgnore debug info when making optimization decisions in SimplifyCFG.
Dehao Chen [Mon, 17 Oct 2016 19:28:44 +0000 (19:28 +0000)]
Ignore debug info when making optimization decisions in SimplifyCFG.

Summary: Debug info should *not* affect code generation. This patch properly handles debug info to make sure the generated code are the same with or without debug info.

Reviewers: davidxl, mzolotukhin, jmolloy

Subscribers: aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284415 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDelete dead code.
Rafael Espindola [Mon, 17 Oct 2016 19:25:42 +0000 (19:25 +0000)]
Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284414 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[doc] use double `` to prevent html output of merging double dash
Mehdi Amini [Mon, 17 Oct 2016 19:23:19 +0000 (19:23 +0000)]
[doc] use double `` to prevent html output of merging double dash

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284412 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit.
Michael LeMay [Mon, 17 Oct 2016 19:09:19 +0000 (19:09 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284411 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoHandle relocations to thumb functions when dynamic linking COFF modules
Walter Erquinigo [Mon, 17 Oct 2016 18:56:18 +0000 (18:56 +0000)]
Handle relocations to thumb functions when dynamic linking COFF modules

Summary:
This adds the necessary logic to support relocations to thumb functions in the COFF dynamic linker.
The jumps to function addresses are mostly blx, which requires the ISA selection bit when jumping to a thumb function.

Note: I'm determining if the relocation requires the ISA bit when creating the relocation entries and not when resolving the relocation. I have to do that because I need the ObjectFile and the actual Symbol, which are available only when creating the entries. It would require a gross refactor if I do it otherwise, but I'm okay with doing it if you think it's better.

Reviewers: peter.smith, compnerd

Subscribers: rengolin, sas

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284410 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReturn a StringRef instead of a Comdat*.
Rafael Espindola [Mon, 17 Oct 2016 18:51:02 +0000 (18:51 +0000)]
Return a StringRef instead of a Comdat*.

This is a small step in making this interface compatible with an
bitcode symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284408 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGlobalISel: support wider range of load/store sizes in AArch64.
Tim Northover [Mon, 17 Oct 2016 18:36:53 +0000 (18:36 +0000)]
GlobalISel: support wider range of load/store sizes in AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284406 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU/SI: LowerParameter() should be computing align based on memory type
Tom Stellard [Mon, 17 Oct 2016 16:56:19 +0000 (16:56 +0000)]
AMDGPU/SI: LowerParameter() should be computing align based on memory type

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284398 91177308-0d34-0410-b5e6-96231b3b80d8