OSDN Git Service

android-x86/external-llvm.git
6 years agoRemove checks for debug info intrinsics in use lists, NFC
Reid Kleckner [Mon, 14 Aug 2017 22:10:54 +0000 (22:10 +0000)]
Remove checks for debug info intrinsics in use lists, NFC

These haven't done anything since debug info intrinsics stopped
appearing in Value use lists in 2014.

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

6 years ago[MIPS] Implement support for -mstack-alignment.
John Baldwin [Mon, 14 Aug 2017 21:49:38 +0000 (21:49 +0000)]
[MIPS] Implement support for -mstack-alignment.

Summary:
This is modeled on the implementation for x86 which stores the command line
option in a 'StackAlignOverride' field in MipsSubtarget and then uses this
to compute a 'stackAlignment' value in
MipsSubtarget::initializeSubtargetDependencies.

The stackAlignment() method in MipsSubTarget is renamed to getStackAlignment()
and returns the computed 'stackAlignment'.

Reviewers: sdardis

Reviewed By: sdardis

Subscribers: llvm-commits, arichardson

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

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

6 years agoRecommit r310869, "[InstSimplify][InstCombine] Modify the interface of decomposeBitTe...
Craig Topper [Mon, 14 Aug 2017 21:39:51 +0000 (21:39 +0000)]
Recommit r310869, "[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify"

This recommits r310869, with the moved files and no extra changes.

Original commit message:

This addresses a fixme in InstSimplify about using decomposeBitTest. This also fixes InstSimplify to handle ugt and ult compares too.

I've modified the interface a little to return only the APInt version of the mask that InstSimplify needs. InstCombine now has a small wrapper routine to create a Constant out of it. I've also dropped the returning of 0 since InstSimplify doesn't need that. So InstCombine creates a zero constant itself.

I also had to make decomposeBitTest support vectors since InstSimplify needs that.

As InstSimplify can't use something from the Transforms library, I've moved the CmpInstAnalysis code to the Analysis library.

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

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

6 years ago[InlineCost] Refactor the checks for different analyses to be a bit more
Chandler Carruth [Mon, 14 Aug 2017 21:25:00 +0000 (21:25 +0000)]
[InlineCost] Refactor the checks for different analyses to be a bit more
localized to the code that uses those analyses.

Technically, this can change behavior as we no longer require the
existence of the ProfileSummaryInfo analysis to use local profile
information via BFI. We didn't actually require the PSI to have an
interesting profile though, so this only really impacts the behavior in
non-default pass pipelines.

IMO, this makes it substantially less surprising how everything works --
before an analysis that wasn't actually used had to exist to trigger
*any* profile aware inlining. I think the new organization makes it more
obvious where various checks for profile signals happen.

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

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

6 years agoAdd strictfp attribute to prevent unwanted optimizations of libm calls
Andrew Kaylor [Mon, 14 Aug 2017 21:15:13 +0000 (21:15 +0000)]
Add strictfp attribute to prevent unwanted optimizations of libm calls

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

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

6 years ago[libFuzzer] try to use less RAM while processing the initial corpus
Kostya Serebryany [Mon, 14 Aug 2017 20:34:35 +0000 (20:34 +0000)]
[libFuzzer] try to use less RAM while processing the initial corpus

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

6 years ago[libFuzzer] explicitly use -fsanitize-coverage=trace-pc-guard in test/dump_coverage...
Kostya Serebryany [Mon, 14 Aug 2017 19:55:23 +0000 (19:55 +0000)]
[libFuzzer] explicitly use -fsanitize-coverage=trace-pc-guard in test/dump_coverage.test; mark print_coverage/dump_coverage as To-be-deprecated

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

6 years agoIPRA: Allow target to enable IPRA by default
Matt Arsenault [Mon, 14 Aug 2017 19:54:47 +0000 (19:54 +0000)]
IPRA: Allow target to enable IPRA by default

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

6 years agoIPRA: Run RegUsageInfoPropagate much later
Matt Arsenault [Mon, 14 Aug 2017 19:54:45 +0000 (19:54 +0000)]
IPRA: Run RegUsageInfoPropagate much later

This was running immediately after isel, before
isel pseudos were even expanded which is really
unreasonable. Move this to before pre-reglloc
passes in case some other pre-regalloc pass wants to
use the updated regmask info.

Fixes one of the reasons IPRA doesn't do anything on
AMDGPU currently. Tests will be included with future
patch after a few more are fixed.

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

6 years agoRevert r310869 "[InstSimplify][InstCombine] Modify the interface of decomposeBitTestI...
Craig Topper [Mon, 14 Aug 2017 19:09:32 +0000 (19:09 +0000)]
Revert r310869 "[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify"

Failed to add the two files that moved. And then added an extra change I didn't mean to while trying to fix that. Reverting everything.

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

6 years agoRevert r310870 "[InstCombine][InstSimplify] 'git add' two files that moved in r310869."
Craig Topper [Mon, 14 Aug 2017 19:09:28 +0000 (19:09 +0000)]
Revert r310870 "[InstCombine][InstSimplify] 'git add' two files that moved in r310869."

An extra change crept in here.

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

6 years ago[InstCombine][InstSimplify] 'git add' two files that moved in r310869.
Craig Topper [Mon, 14 Aug 2017 19:01:32 +0000 (19:01 +0000)]
[InstCombine][InstSimplify] 'git add' two files that moved in r310869.

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

6 years ago[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use...
Craig Topper [Mon, 14 Aug 2017 18:49:42 +0000 (18:49 +0000)]
[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify

This addresses a fixme in InstSimplify about using decomposeBitTest. This also fixes InstSimplify to handle ugt and ult compares too.

I've modified the interface a little to return only the APInt version of the mask that InstSimplify needs. InstCombine now has a small wrapper routine to create a Constant out of it. I've also dropped the returning of 0 since InstSimplify doesn't need that. So InstCombine creates a zero constant itself.

I also had to make decomposeBitTest support vectors since InstSimplify needs that.

As InstSimplify can't use something from the Transforms library, I've moved the CmpInstAnalysis code to the Analysis library.

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

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

6 years ago[InstSimplify] Add some tests cases for selects with bittests hidden in ugt/ult/uge...
Craig Topper [Mon, 14 Aug 2017 18:49:39 +0000 (18:49 +0000)]
[InstSimplify] Add some tests cases for selects with bittests hidden in ugt/ult/uge/ule compares. NFC

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

6 years ago[PowerPC] Add codegen for VSX word extract convert to FP
Lei Huang [Mon, 14 Aug 2017 18:09:29 +0000 (18:09 +0000)]
[PowerPC] Add codegen for VSX word extract convert to FP

Add codegen for VSX word extract conversion from signed/unsigned to single/double
precision.

For UINT_TO_FP:
Extract word unsigned and convert to float was implemented in https://reviews.llvm.org/D20239.
Here we will add the missing extract integer and conversion to double. This
utilizes the new P9 instruction xxextractuw to extracting an integer element
when the result will be converted to double thereby saving 2 direct moves
(VSR <-> GPR).

For SINT_TO_FP:
We will implement the following sequence which will also reduce the number of
instructions by saving 2 direct moves.

v4i32->f32:
        xxspltw
        xvcvsxwsp
        xscvspdpn

v4i32->f64:
        xxspltw
        xvcvsxwdp

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

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

6 years ago[GISel]: Add some helper constructors to MIRBuilder
Aditya Nandakumar [Mon, 14 Aug 2017 17:25:11 +0000 (17:25 +0000)]
[GISel]: Add some helper constructors to MIRBuilder

https://reviews.llvm.org/D36636

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

6 years ago[ValueTracking] Don't delete assumes of side-effectful instructions
Hal Finkel [Mon, 14 Aug 2017 17:11:43 +0000 (17:11 +0000)]
[ValueTracking] Don't delete assumes of side-effectful instructions

ValueTracking has to strike a balance when attempting to propagate information
backwards from assumes, because if the information is trivially propagated
backwards, it can appear to LLVM that the assumption is known to be true, and
therefore can be removed.

This is sound (because an assumption has no semantic effect except for causing
UB), but prevents the assume from allowing further optimizations.

The isEphemeralValueOf check exists to try and prevent this issue by not
removing the source of an assumption. This tries to make it a little bit more
general to handle the case of side-effectful instructions, such as in

  %0 = call i1 @get_val()
  %1 = xor i1 %0, true
  call void @llvm.assume(i1 %1)

Patch by Ariel Ben-Yehuda, thanks!

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

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

6 years agoRevert "Reland "[mips][mt][6/7] Add support for mftr, mttr instructions.""
Simon Dardis [Mon, 14 Aug 2017 16:20:33 +0000 (16:20 +0000)]
Revert "Reland "[mips][mt][6/7] Add support for mftr, mttr instructions.""

This reverts r310834. It didn't pacify the buildbot, FileCheck is still
crashing.

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

6 years ago[x86] fold the mask op on 8- and 16-bit rotates
Sanjay Patel [Mon, 14 Aug 2017 15:55:43 +0000 (15:55 +0000)]
[x86] fold the mask op on 8- and 16-bit rotates

Ref the post-commit thread for r310770:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170807/478507.html

The motivating cases as 'C' source examples can look like this:

unsigned char rotate_right_8(unsigned char v, int shift) {
  // shift &= 7;
  v = ( v >> shift ) | ( v << ( 8 - shift ) );
  return v;
}

https://godbolt.org/g/K6rc1A

Notice that the source doesn't contain UB-safe masked shift amounts, but instcombine created those
in order to produce narrow rotate patterns. This should be the last step needed to resolve PR34046:
https://bugs.llvm.org/show_bug.cgi?id=34046

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

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

6 years ago[SLPVectorizer] Schedule bundle with different opcodes.
Dinar Temirbulatov [Mon, 14 Aug 2017 15:40:16 +0000 (15:40 +0000)]
[SLPVectorizer] Schedule bundle with different opcodes.

This change let us schedule a bundle with different opcodes in it, for example : [ load, add, add, add ]

Reviewers: mkuper, RKSimon, ABataev, mzolotukhin, spatel, filcab

Subscribers: llvm-commits, rengolin

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

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

6 years ago[X86] Fix a place that was mishandling X86ISD::UMUL.
Craig Topper [Mon, 14 Aug 2017 15:32:40 +0000 (15:32 +0000)]
[X86] Fix a place that was mishandling X86ISD::UMUL.

According to the X86ISelLowering.h, UMUL results are low, high, and flags. But this place was treating result 1 or 2 as flags.

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

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

6 years ago[X86] Remove flag setting ISD nodes from computeKnownBitsForTargetNode
Craig Topper [Mon, 14 Aug 2017 15:28:49 +0000 (15:28 +0000)]
[X86] Remove flag setting ISD nodes from computeKnownBitsForTargetNode

Summary:
The flag result is an i32 type. But its only really used for connectivity. I don't think anything even assumes a particular format. We don't ever do any real operations on it. So known bits don't help us optimize anything.

My main motivation is that the UMUL behavior is actually wrong. I was going to fix this in D36654, but then realized there was just no reason for it to be here.

Reviewers: RKSimon, zvi, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[AVX512] Make the itinerary parameter actually pass through the the AVX512_maskable_c...
Craig Topper [Mon, 14 Aug 2017 15:28:48 +0000 (15:28 +0000)]
[AVX512] Make the itinerary parameter actually pass through the the AVX512_maskable_common multiclass

Summary: This looks to have been disconnected about 3 years ago in r219358.

Reviewers: gadi.haber, RKSimon, zvi

Reviewed By: gadi.haber

Subscribers: llvm-commits

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

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

6 years ago[AVX512] Remove leftover code for when i1 was a legal type from the fast isel load...
Craig Topper [Mon, 14 Aug 2017 15:28:47 +0000 (15:28 +0000)]
[AVX512] Remove leftover code for when i1 was a legal type from the fast isel load/store code.

Summary:
I don't think we need this code anymore. It only existed because i1 used to be legal.

There's probably more unneeded code in fast isel still.

Reviewers: guyblank, zvi

Reviewed By: guyblank

Subscribers: llvm-commits

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

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

6 years ago[BDCE] reduce scope of an assert (PR34179)
Sanjay Patel [Mon, 14 Aug 2017 15:13:46 +0000 (15:13 +0000)]
[BDCE] reduce scope of an assert (PR34179)

The assert was added with r310779 and is usually correct,
but as the test shows, not always. The 'volatile' on the
load is needed to expose the faulty path because without
it, DemandedBits would return that the load is just dead
rather than not demanded, and so we wouldn't hit the
bogus assert.

Also, since the lambda is just a single-line now, get rid
of it and inline the DB.isAllOnesValue() calls.

This should fix (prevent execution of a faulty assert):
https://bugs.llvm.org/show_bug.cgi?id=34179

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

6 years agoReland "[mips][mt][6/7] Add support for mftr, mttr instructions."
Simon Dardis [Mon, 14 Aug 2017 12:28:00 +0000 (12:28 +0000)]
Reland "[mips][mt][6/7] Add support for mftr, mttr instructions."

This adjusts the tests to hopfully pacify the llvm-clang-x86_64-expensive-checks-win
buildbot.

Unlike many other instructions, these instructions have aliases which
take coprocessor registers, gpr register, accumulator (and dsp accumulator)
registers, floating point registers, floating point control registers and
coprocessor 2 data and control operands.

For the moment, these aliases are treated as pseudo instructions which are
expanded into the underlying instruction. As a result, disassembling these
instructions shows the underlying instruction and not the alias.

Reviewers: slthakur, atanasyan

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

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

6 years ago[DAGCombine] Do not try to deduplicate commutative operations if both operand are...
Amaury Sechet [Mon, 14 Aug 2017 11:44:03 +0000 (11:44 +0000)]
[DAGCombine] Do not try to deduplicate commutative operations if both operand are the same.

Summary: It is creating useless work as the commuted nodes is the same as the node we are working on in that case.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

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

6 years ago[SelectionDAG] combine vextract (v1iX extract_subvector(vNiX, Idx))
Elad Cohen [Mon, 14 Aug 2017 10:49:45 +0000 (10:49 +0000)]
[SelectionDAG] combine vextract (v1iX extract_subvector(vNiX, Idx))
into vextract(vNiX,Idx) when creating vextract with getNode().
This case appeared in AVX512 after fixing pr33349 in r310552.

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

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

6 years ago[llvm-cov] Add an option which maps the location of source directories on another...
Sean Eveson [Mon, 14 Aug 2017 10:20:12 +0000 (10:20 +0000)]
[llvm-cov] Add an option which maps the location of source directories on another machine to your local copies

Summary:
This patch adds the -path-equivalence option (example: llvm-cov show -path-equivalence=/origin/path,/local/path) which maps the source code path from one machine to another when using `llvm-cov show`. This is similar to the -filename-equivalence option, but doesn't require you to specify all the source files on the command line.

This allows you to generate the coverage data on one machine (e.g. in a CI system), and then use llvm-cov on another machine where you have the same code base on a different path.

Reviewers: vsk

Reviewed By: vsk

Subscribers: llvm-commits

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

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

6 years agoMachineInstr: Reason locally about some memory objects before going to AA.
Balaram Makam [Mon, 14 Aug 2017 09:41:40 +0000 (09:41 +0000)]
MachineInstr: Reason locally about some memory objects before going to AA.

This addresses a FIXME in MachineInstr::mayAlias.

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

6 years ago[LoopUnroll] Enable option to peel remainder loop
Sam Parker [Mon, 14 Aug 2017 09:25:26 +0000 (09:25 +0000)]
[LoopUnroll] Enable option to peel remainder loop

On some targets, the penalty of executing runtime unrolling checks
and then not the unrolled loop can be significantly detrimental to
performance. This results in the need to be more conservative with
the unroll count, keeping a trip count of 2 reduces the overhead as
well as increasing the chance of the unrolled body being executed. But
being conservative leaves performance gains on the table.

This patch enables the unrolling of the remainder loop introduced by
runtime unrolling. This can help reduce the overhead of misunrolled
loops because the cost of non-taken branches is much less than the
cost of the backedge that would normally be executed in the remainder
loop. This allows larger unroll factors to be used without suffering
performance loses with smaller iteration counts.

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

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

6 years ago[AArch64] Remove unused MC function
Sam Parker [Mon, 14 Aug 2017 09:16:13 +0000 (09:16 +0000)]
[AArch64] Remove unused MC function

An unused function warning was raised in
https://bugs.llvm.org/show_bug.cgi?id=34178.

The offending function, in AArch64MCCodeEmitter.cpp, was committed by
me last week.

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

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

6 years agoRevert "[DAGCombiner] Extending pattern detection for vector shuffle (REAPPLIED)"
Elad Cohen [Mon, 14 Aug 2017 09:06:00 +0000 (09:06 +0000)]
Revert "[DAGCombiner] Extending pattern detection for vector shuffle (REAPPLIED)"

This reverts commit r310782.

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

6 years ago[ValueTracking] Revert r310583 which enabled functionality that still is
Chandler Carruth [Mon, 14 Aug 2017 07:03:24 +0000 (07:03 +0000)]
[ValueTracking] Revert r310583 which enabled functionality that still is
causing compile time issues.

Moreover, the patch *deleted* the flag in addition to changing the
default, and links to a code review that doesn't even discuss the flag
and just has an update to a Clang test case.

I've followed up on the commit thread to ask for numbers on compile time
at this point, leaving the flag in place until things stabilize, and
pointing at specific code that seems to exhibit excessive compile time
with this patch.

Original commit message for r310583:
"""
[ValueTracking] Enabling ValueTracking patch by default (recommit). Part 2.

The original patch was an improvement to IR ValueTracking on
non-negative integers. It has been checked in to trunk (D18777,
r284022). But was disabled by default due to performance regressions.
Perf impact has improved. The patch would be enabled by default.
""""

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

6 years ago[AVX-512] Add hasSideEffects = 0 to the 8-bit and 16-bit register broadcasts.
Craig Topper [Mon, 14 Aug 2017 05:09:34 +0000 (05:09 +0000)]
[AVX-512] Add hasSideEffects = 0 to the 8-bit and 16-bit register broadcasts.

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

6 years ago[X86] Remove unused argument from the vextract_for_size multiclass. NFC
Craig Topper [Mon, 14 Aug 2017 05:09:33 +0000 (05:09 +0000)]
[X86] Remove unused argument from the vextract_for_size multiclass. NFC

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

6 years ago[AVX512] Remove comment I should have removed in r310808. NFC
Craig Topper [Mon, 14 Aug 2017 05:09:31 +0000 (05:09 +0000)]
[AVX512] Remove comment I should have removed in r310808. NFC

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

6 years ago[opt-viewer] Listify `dict_items` for Py3 indexing
Brian Gesiak [Mon, 14 Aug 2017 04:16:43 +0000 (04:16 +0000)]
[opt-viewer] Listify `dict_items` for Py3 indexing

Summary:
In Python 2, calling `dict.items()` returns an indexable `list`, whereas
on Python 3 it returns a set-like `dict_items` object, which cannot be
indexed. Explicitly onvert the `dict_items` object so that it can be
indexed when using Python 3.

In combination with D36622, D36623, and D36624, this change allows
`opt-viewer.py` to exit successfully when run with Python 3.4.

Test Plan:
Run `opt-viewer.py` using Python 3.4 and confirm it does not encounter a
runtime error when when indexing into `dict.items()`.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

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

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

6 years ago[PowerPC] Revert r310346 (and followups r310356 & r310424) which
Chandler Carruth [Mon, 14 Aug 2017 03:41:00 +0000 (03:41 +0000)]
[PowerPC] Revert r310346 (and followups r310356 & r310424) which
introduce a miscompile bug.

There appears to be a bug where the generated code to extract the sign
bit doesn't work correctly for 32-bit inputs. I've replied to the
original commit pointing out the problem. I think I see by inspection
(and reading the manual for PPC) how to fix this, but I can't be 100%
confident and I also don't know what the best way to test this is.
Currently it seems nearly impossible to get the backend to hit this code
path, but the patch autohr is likely in a better position to craft such
test cases than I am, and based on where the bug is it should be easily
done.

Original commit message for r310346:
"""
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETLE/SETGE

Adds handling for SETLE/SETGE comparisons on i32 values. Furthermore, it
adds the handling for the special case where RHS == 0.

Differential Revision: https://reviews.llvm.org/D34048
"""

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

6 years ago[AVX512] Simplify the instruction defintion for VEXTRACT. NFCI
Craig Topper [Mon, 14 Aug 2017 01:53:10 +0000 (01:53 +0000)]
[AVX512] Simplify the instruction defintion for VEXTRACT. NFCI

The comment about why we couldn't use avx512_maskable appears to have been incorrect.

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

6 years ago[ARM] Tidy-up Cortex-A15 DPR-SPR optimizer implementation
Javed Absar [Mon, 14 Aug 2017 01:38:01 +0000 (01:38 +0000)]
[ARM] Tidy-up Cortex-A15 DPR-SPR optimizer implementation

Modernise the code with range-loops etc

Reviewed by: @fhahn, @rovka
Differential Revision: https://reviews.llvm.org/D36502

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

6 years ago[InstCombine] Simplify and inline FoldOrWithConstants/FoldXorWithConstants
Craig Topper [Mon, 14 Aug 2017 00:04:21 +0000 (00:04 +0000)]
[InstCombine] Simplify and inline FoldOrWithConstants/FoldXorWithConstants

Summary:
These functions were overly complicated. The body of this function was rechecking for an And operation to find the constant, but we already knew we were looking at two Ands ORed together and the pieces are in variables. We already had earlier nearby code that checked for ConstantInts. So just inline the remaining parts into the earlier code.

Next step is to use m_APInt instead of ConstantInt.

Reviewers: spatel, efriedma, davide, majnemer

Reviewed By: spatel

Subscribers: zzheng, llvm-commits

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

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

6 years ago[X86][BMI] Add BEXTR demanded bits test cases (PR34042)
Simon Pilgrim [Sun, 13 Aug 2017 20:35:38 +0000 (20:35 +0000)]
[X86][BMI] Add BEXTR demanded bits test cases (PR34042)

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

6 years ago[X86] Fix typo from r310794. Index = 0 should have been Index == 0.
Craig Topper [Sun, 13 Aug 2017 20:21:12 +0000 (20:21 +0000)]
[X86] Fix typo from r310794. Index = 0 should have been Index == 0.

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

6 years ago[X86] Remove unused pattern fragment that referenced MVT::i1. NFC
Craig Topper [Sun, 13 Aug 2017 20:04:05 +0000 (20:04 +0000)]
[X86] Remove unused pattern fragment that referenced MVT::i1. NFC

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

6 years ago[COFF, ARM64] Use '//' as comment character in assembly files in GNU environments
Martin Storsjo [Sun, 13 Aug 2017 19:42:05 +0000 (19:42 +0000)]
[COFF, ARM64] Use '//' as comment character in assembly files in GNU environments

This allows using semicolons for bundling up more than one
statement per line. This is used within the mingw-w64 project in some
assembly files that contain code for multiple architectures.

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

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

6 years agoRemove RISCV from LLVM_ALL_TARGETS in CMakeLists.txt
Alex Bradbury [Sun, 13 Aug 2017 18:49:33 +0000 (18:49 +0000)]
Remove RISCV from LLVM_ALL_TARGETS in CMakeLists.txt

It was mistakenly added to that list in D23560 (committed in rL285712). RISCV
is an experimental backend and should never have been in that list, I
mistakenly interpreted LLVM_ALL_TARGETS as a list of all targets rather than
targets to build by default. Unfortunately, because of this the RISCV backend
has been building by default when it shouldn't be.

This commet adds a description comment, which should help to avoid such
mistakes in the future.

See my message to llvm-dev for more information and analysis
<http://lists.llvm.org/pipermail/llvm-dev/2017-August/116347.html>.

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

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

6 years ago[AVX512] Correct isExtractSubvectorCheap so that it will return the correct answers...
Craig Topper [Sun, 13 Aug 2017 17:40:02 +0000 (17:40 +0000)]
[AVX512] Correct isExtractSubvectorCheap so that it will return the correct answers for extracting 128-bits from a 512-bit vector and for mask registers.

Previously it would not return true for extracting either of the upper quarters of a 512-bit registers.

For mask registers we support extracting anything from index 0. And otherwise we only support extracting the upper half of a register.

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

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

6 years ago[X86][ARM][TargetLowering] Add SrcVT to isExtractSubvectorCheap
Craig Topper [Sun, 13 Aug 2017 17:29:07 +0000 (17:29 +0000)]
[X86][ARM][TargetLowering] Add SrcVT to isExtractSubvectorCheap

Summary:
Without the SrcVT its hard to know what is really being asked for. For example if your target has 128, 256, and 512 bit vectors. Maybe extracting 128 from 256 is cheap, but maybe extracting 128 from 512 is not.

For x86 we do support extracting a quarter of a 512-bit register. But for i1 vectors we don't have isel patterns for extracting arbitrary pieces. So we need this to have a correct implementation of isExtractSubvectorCheap for mask vectors.

Reviewers: RKSimon, zvi, efriedma

Reviewed By: RKSimon

Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits

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

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

6 years ago[X86][SandyBridge] Additional updates to the SNB instructions scheduling information
Gadi Haber [Sun, 13 Aug 2017 13:59:24 +0000 (13:59 +0000)]
[X86][SandyBridge] Additional updates to the SNB instructions scheduling information

This is a continuation patch for commit r307529 which completely replaces the scheduling information for the SandyBridge architecture target by modifying the file X86SchedSandyBridge.td located under the X86 Target (see also https://reviews.llvm.org/D35019).

In this patch we added the scheduling information of additional SNB instructions that were missing from the patch commit r307529, fixed the scheduling of several resource groups that include only port0 instead of port05 (i.e., port0 OR port5) and fixed several incorrect instructions' scheduling in the r307529 commit.

The patch also includes the X87 instructions which were missing in previous patch commit r307529 as reported in bugzilla bug 34080.

Reviewers: zvi, RKSimon, chandlerc, igorb, m_zuckerman, craig.topper, aymanmus, dim

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

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

6 years ago[X86][AVX512] Added additional shuffle+trunc test case.
Simon Pilgrim [Sun, 13 Aug 2017 12:30:36 +0000 (12:30 +0000)]
[X86][AVX512] Added additional shuffle+trunc test case.

An existing test should have covered this but a typo caused it to fail. I've kept both as the codegen for the typo case needs addressing as well.

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

6 years ago[X86][TBM] Add tests showing failure to fold RFLAGS result into TBM instructions.
Simon Pilgrim [Sun, 13 Aug 2017 12:16:00 +0000 (12:16 +0000)]
[X86][TBM] Add tests showing failure to fold RFLAGS result into TBM instructions.

And fails to select TBM instructions at all.

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

6 years ago[X86][AsmParser][AVX512] Error appropriately when K0 is tried as a write-mask
Coby Tayree [Sun, 13 Aug 2017 12:03:00 +0000 (12:03 +0000)]
[X86][AsmParser][AVX512] Error appropriately when K0 is tried as a write-mask

K0 isn't expected as a write-mask, so provide a detailed error here, instead of the more generic one (invalid op for insn)
Conforms with gas

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

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

6 years ago[X86][TBM] Regenerate bextri intrinsics tests. NFCI.
Simon Pilgrim [Sun, 13 Aug 2017 11:56:15 +0000 (11:56 +0000)]
[X86][TBM] Regenerate bextri intrinsics tests. NFCI.

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

6 years ago[X86][AVX512] Add combine for TESTM
Guy Blank [Sun, 13 Aug 2017 08:03:37 +0000 (08:03 +0000)]
[X86][AVX512] Add combine for TESTM

Add an X86 combine for TESTM when one of the operands is a BUILD_VECTOR(0,0,...).

TESTM op0, BUILD_VECTOR(0,0,...) -> BUILD_VECTOR(0,0,...)
TESTM BUILD_VECTOR(0,0,...), op1 -> BUILD_VECTOR(0,0,...)

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

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

6 years ago[X86] Early out of combineInsertSubvector for mask vectors.
Craig Topper [Sat, 12 Aug 2017 22:33:58 +0000 (22:33 +0000)]
[X86] Early out of combineInsertSubvector for mask vectors.

The combines here shouldn't be done for mask vectors, but it wasn't clear anything was preventing that.

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

6 years ago[X86] Fix bad comment. NFC
Craig Topper [Sat, 12 Aug 2017 22:33:57 +0000 (22:33 +0000)]
[X86] Fix bad comment. NFC

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

6 years ago[X86] When handling addcarry intrinsic, create the flag result with the correct type...
Craig Topper [Sat, 12 Aug 2017 20:19:44 +0000 (20:19 +0000)]
[X86] When handling addcarry intrinsic, create the flag result with the correct type so we don't crash if we use a memory instruction

Summary:
Previously we were creating the flag result with MVT::Other which is interpretted as a Chain node. If we used a memory form of the instruction we would end up with a copyToReg that consumed the chain result of the adcx instruction instead of the flag result.

Pretty sure we should be using MVT::i32 here, that's what we do other places we create these node types.

We should probably consider this for 5.0 as well.

Reviewers: RKSimon, zvi, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[DAGCombiner] Extending pattern detection for vector shuffle (REAPPLIED)
Simon Pilgrim [Sat, 12 Aug 2017 17:43:25 +0000 (17:43 +0000)]
[DAGCombiner] Extending pattern detection for vector shuffle (REAPPLIED)

If all the operands of a BUILD_VECTOR extract elements from same vector then split the vector efficiently based on the maximum vector access index.

Reapplied with fix to only work with simple value types.

Committed on behalf of @jbhateja (Jatin Bhateja)

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

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

6 years ago[Triple] Add isThumb and isARM functions.
Florian Hahn [Sat, 12 Aug 2017 17:40:18 +0000 (17:40 +0000)]
[Triple] Add isThumb and isARM functions.

Summary:
isThumb returns true for Thumb triples (little and big endian), isARM
returns true for ARM triples (little and big endian).
There are a few more checks using arm/thumb that are not covered by
those functions, e.g. that the architecture is either ARM or Thumb
(little endian) or ARM/Thumb little endian only.

Reviewers: javed.absar, rengolin, kristof.beyls, t.p.northover

Reviewed By: rengolin

Subscribers: llvm-commits, aemerson

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

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

6 years ago[X86] Regenerate merge store tests. NFCI.
Simon Pilgrim [Sat, 12 Aug 2017 17:27:35 +0000 (17:27 +0000)]
[X86] Regenerate merge store tests. NFCI.

Gives us a much better idea of what is going on than just relying on a few checks.

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

6 years ago[BDCE] clear poison generators after turning a value into zero (PR33695, PR34037)
Sanjay Patel [Sat, 12 Aug 2017 16:41:08 +0000 (16:41 +0000)]
[BDCE] clear poison generators after turning a value into zero (PR33695, PR34037)

nsw, nuw, and exact carry implicit assumptions about their operands, so we need
to clear those after trivializing a value. We decided there was no danger for
llvm.assume or metadata, so there's just a comment about that.

This fixes miscompiles as shown in:
https://bugs.llvm.org/show_bug.cgi?id=33695
https://bugs.llvm.org/show_bug.cgi?id=34037

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

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

6 years agoFix some minor typos in the llvm XRay exemple
Sylvestre Ledru [Sat, 12 Aug 2017 15:08:11 +0000 (15:08 +0000)]
Fix some minor typos in the llvm XRay exemple

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

6 years agoD36604: PR34148: Do not assume we can use a copy relocation for an `external_weak...
Richard Smith [Fri, 11 Aug 2017 23:52:28 +0000 (23:52 +0000)]
D36604: PR34148: Do not assume we can use a copy relocation for an `external_weak` global

An `external_weak` global may be intended to resolve as a null pointer if it's
not defined, so it doesn't make sense to use a copy relocation for it.

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

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

6 years ago[libFuzzer] experimental support for Clang's coverage (fprofile-instr-generate),...
Kostya Serebryany [Fri, 11 Aug 2017 23:03:22 +0000 (23:03 +0000)]
[libFuzzer] experimental support for Clang's coverage (fprofile-instr-generate), Linux-only

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

6 years ago[x86] add tests for rotate left/right with masked shifter; NFC
Sanjay Patel [Fri, 11 Aug 2017 22:38:40 +0000 (22:38 +0000)]
[x86] add tests for rotate left/right with masked shifter; NFC

As noted in the test comment, instcombine now produces the masked
shift value even when it's not included in the source, so we should
handle this.

Although the AMD/Intel docs don't say it explicitly, over-rotating
the narrow ops produces the same results. An existence proof that
this works as expected on all x86 comes from gcc 4.9 or later:
https://godbolt.org/g/K6rc1A

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

6 years ago[MIPS] Use ABI to determine stack alignment.
John Baldwin [Fri, 11 Aug 2017 22:07:56 +0000 (22:07 +0000)]
[MIPS] Use ABI to determine stack alignment.

Summary:
The stack alignment depends on the ABI (16 bytes for N32 and N64 and 8
bytes for O32), not the CPU type.

Reviewers: sdardis

Reviewed By: sdardis

Subscribers: atanasyan, arichardson, llvm-commits

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

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

6 years ago[x86] regenerate test checks, add 64-bit run; NFC
Sanjay Patel [Fri, 11 Aug 2017 22:05:33 +0000 (22:05 +0000)]
[x86] regenerate test checks, add 64-bit run; NFC

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

6 years ago[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Fri, 11 Aug 2017 21:30:02 +0000 (21:30 +0000)]
[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoFix some broken tests.
Zachary Turner [Fri, 11 Aug 2017 21:14:01 +0000 (21:14 +0000)]
Fix some broken tests.

These were pending in a separate patch but I forgot to squash them
before comitting, and this one didn't go through.

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

6 years ago[OptDiag] Updating Remarks in SampleProfile
Eli Friedman [Fri, 11 Aug 2017 21:12:04 +0000 (21:12 +0000)]
[OptDiag] Updating Remarks in SampleProfile

Updating remark API to newer OptimizationDiagnosticInfo API. This
allows remarks to show up in diagnostic yaml file, and enables use
of opt-viewer tool.

Hotness information for remarks (L505 and L751) do not display hotness
information, most likely due to profile information not being
propagated yet. Unsure if this is the desired outcome.

Patch by Tarun Rajendran.

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

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

6 years ago[X86] Don't use fsin/fcos/fsincos instructions ever
Craig Topper [Fri, 11 Aug 2017 20:55:29 +0000 (20:55 +0000)]
[X86] Don't use fsin/fcos/fsincos instructions ever

Summary:
Previously we would use these instructions if sse was disabled and fastmath was enabled.

As mentioned in D28335, this is a bad idea.

Reviewers: efriedma, scanon, DavidKreitzer

Reviewed By: DavidKreitzer

Subscribers: zvi, llvm-commits

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

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

6 years agoFix access to undefined weak symbols in pic code
Rafael Espindola [Fri, 11 Aug 2017 20:49:27 +0000 (20:49 +0000)]
Fix access to undefined weak symbols in pic code

When the access to a weak symbol is not a call, the access has to be
able to produce the value 0 at runtime.

We were sometimes producing code sequences where that was not possible
if the code was leaded more than 4g away from 0.

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

6 years agoOutput S_SECTION symbols to the Linker module.
Zachary Turner [Fri, 11 Aug 2017 20:46:28 +0000 (20:46 +0000)]
Output S_SECTION symbols to the Linker module.

PDBs need to contain 1 module for each object file/compiland,
and a special one synthesized by the linker.  This one contains
a symbol record for each output section in the executable with
its address information.  This patch adds such symbols to the
linker module.  Note that we also are supposed to add an
S_COFFGROUP symbol for what appears to be each input section that
contributes to each output section, but it's not entirely clear
how to generate these yet, so I'm leaving that for a separate
patch.

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

6 years agoAMDGPU: Start adding tail call support
Matt Arsenault [Fri, 11 Aug 2017 20:42:08 +0000 (20:42 +0000)]
AMDGPU: Start adding tail call support

Handle the sibling call cases.

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

6 years ago[libFuzzer] recommend Clang Coverage for coverage visualization
Kostya Serebryany [Fri, 11 Aug 2017 20:32:47 +0000 (20:32 +0000)]
[libFuzzer] recommend Clang Coverage for coverage visualization

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

6 years ago[libFuzzer] Re-enable coverage.test on Darwin.
George Karpenkov [Fri, 11 Aug 2017 20:30:52 +0000 (20:30 +0000)]
[libFuzzer] Re-enable coverage.test on Darwin.

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

6 years agoRevert r310716 (and r310735): [globalisel][tablegen] Support zero-instruction emission.
Daniel Sanders [Fri, 11 Aug 2017 19:19:21 +0000 (19:19 +0000)]
Revert r310716 (and r310735): [globalisel][tablegen] Support zero-instruction emission.

Two of the Windows bots are failing test\CodeGen\X86\GlobalISel\select-inc.mir
which should not have been affected by the change. Reverting while I investigate.

Also reverted r310735 because it builds on r310716.

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

6 years agoAdd documentation for llvm-pdbutil.
Zachary Turner [Fri, 11 Aug 2017 19:00:22 +0000 (19:00 +0000)]
Add documentation for llvm-pdbutil.

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

6 years ago[LLD/PDB] Write actual records to the globals stream.
Zachary Turner [Fri, 11 Aug 2017 19:00:03 +0000 (19:00 +0000)]
[LLD/PDB] Write actual records to the globals stream.

Previously we were writing an empty globals stream.  Windows
tools interpret this as "private symbols are not present in
this PDB", even when they are, so we need to fix this.  Regardless,
without it we don't have information about global variables, so
we need to fix it anyway.  This patch does that.

With this patch, the "lm" command in WinDbg correctly reports
that we have private symbols available, but the "dv" command
still refuses to display local variables.

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

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

6 years ago[mips] clang-format MipsSubtarget.cpp.
John Baldwin [Fri, 11 Aug 2017 18:35:19 +0000 (18:35 +0000)]
[mips] clang-format MipsSubtarget.cpp.

This only fixes a few things and serves as my initial test commit.

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

6 years ago[opt-viewer] Decode HTML bytes for Python 3
Brian Gesiak [Fri, 11 Aug 2017 18:05:26 +0000 (18:05 +0000)]
[opt-viewer] Decode HTML bytes for Python 3

Summary:
When using Python 3, `pygments.highlight()` returns a `bytes` object, not
a `str`, causing the call to `str.replace` on the following line to fail
with a runtime exception:
`TypeError: 'str' does not support the buffer interface`. Decode the
bytes into a string in order to fix the exception.

Test Plan:
Run `opt-viewer.py` with Python 3.4, and confirm no runtime error occurs
when calling `str.replace`.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

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

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

6 years ago[opt-viewer] Use Python 3-compatible iteritems
Brian Gesiak [Fri, 11 Aug 2017 18:02:07 +0000 (18:02 +0000)]
[opt-viewer] Use Python 3-compatible iteritems

Summary:
Replace a usage of a Python 2-specific `dict.iteritems()` with the
Python 3-compatible definition provided at the top of the same file.

Test Plan:
Run `opt-viewer.py` using Python 3 and confirm it no longer encounters a
runtime error when calling `dict.iteritems()`.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

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

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

6 years ago[opt-viewer] Use Python 3-compatible `intern()`
Brian Gesiak [Fri, 11 Aug 2017 17:56:57 +0000 (17:56 +0000)]
[opt-viewer] Use Python 3-compatible `intern()`

Summary:
In Python 2, `intern()` is a builtin function available to all programs.
In Python 3, it was moved into the `sys` module, available as
`sys.intern`. Import it such that, within `optrecord.py`, `intern()` is
available whether run using Python 2 or 3.

Test Plan:
Run `opt-viewer.py` using Python 3, confirm it no longer
encounters a runtime error when `intern()` is called.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

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

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

6 years ago[AMDGPU] Fix santizer error after last commit
Stanislav Mekhanoshin [Fri, 11 Aug 2017 17:54:43 +0000 (17:54 +0000)]
[AMDGPU] Fix santizer error after last commit

Removed useless assert.

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

6 years agoFix typo /NFC
Xinliang David Li [Fri, 11 Aug 2017 17:49:20 +0000 (17:49 +0000)]
Fix typo /NFC

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

6 years ago[globalisel][tablegen] Generate TypeObject table. NFC
Daniel Sanders [Fri, 11 Aug 2017 17:30:37 +0000 (17:30 +0000)]
[globalisel][tablegen] Generate TypeObject table. NFC

Summary:
Generate the type table from the types used by a target rather than hard-coding
the union of types used by all targets.

Depends on D36084

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

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

6 years agoUpdate libFuzzer documentation for -fsanitize=fuzzer-no-link flag
George Karpenkov [Fri, 11 Aug 2017 17:23:45 +0000 (17:23 +0000)]
Update libFuzzer documentation for -fsanitize=fuzzer-no-link flag

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

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

6 years ago[AMDGPU] Ported and adopted AMDLibCalls pass
Stanislav Mekhanoshin [Fri, 11 Aug 2017 16:42:09 +0000 (16:42 +0000)]
[AMDGPU] Ported and adopted AMDLibCalls pass

The pass does simplifications of well known AMD library calls.
If given -amdgpu-prelink option it works in a pre-link mode which
allows to reference new library functions which will be linked in
later.

In addition it also used to process traditional AMD option
-fuse-native which allows to replace some of the functions with
their fast native implementations from the library.

The necessary glue to pass the prelink option and translate
-fuse-native is to be added to the driver.

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

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

6 years agoOrc: PR33769: Don't rely on comparisons with default constructed iterators
David Blaikie [Fri, 11 Aug 2017 16:38:28 +0000 (16:38 +0000)]
Orc: PR33769: Don't rely on comparisons with default constructed iterators

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

6 years ago[AVX512] Remove and autoupgrade many of the broadcast intrinsics
Craig Topper [Fri, 11 Aug 2017 16:22:45 +0000 (16:22 +0000)]
[AVX512] Remove and autoupgrade many of the broadcast intrinsics

Summary:
This autoupgrades most of the broadcast intrinsics. They've been unused in clang for some time.

This leaves the 32x2 intrinsics because they are still used in clang.

Reviewers: RKSimon, zvi, igorb

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[x86] Enable some support for lowerVectorShuffleWithUndefHalf with AVX-512
Craig Topper [Fri, 11 Aug 2017 16:20:05 +0000 (16:20 +0000)]
[x86] Enable some support for lowerVectorShuffleWithUndefHalf with AVX-512

Summary:
This teaches 512-bit shuffles to detect unused halfs in order to reduce shuffle size.

We may need to refine the 512-bit exit point. I couldn't remember if we had good cross lane shuffles for 8/16 bit with AVX-512 or not.

I believe this is step towards being able to handle D36454 without a special case.

From here we need to improve our ability to combine extract_subvector with insert_subvector and other extract_subvectors. And we need to support narrowing binary operations where we don't demand all elements. This may be improvements to DAGCombiner::narrowExtractedVectorBinOp(by recognizing an insert_subvector in addition to concat) or we may need a target specific combiner.

Reviewers: RKSimon, zvi, delena, jbhateja

Reviewed By: RKSimon, jbhateja

Subscribers: llvm-commits

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

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

6 years ago[x86] use more shift or LEA for select-of-constants (2nd try)
Sanjay Patel [Fri, 11 Aug 2017 15:44:14 +0000 (15:44 +0000)]
[x86] use more shift or LEA for select-of-constants (2nd try)

The previous rev (r310208) failed to account for overflow when subtracting the
constants to see if they're suitable for shift/lea. This version add a check
for that and more test were added in r310490.

We can convert any select-of-constants to math ops:
http://rise4fun.com/Alive/d7d

For this patch, I'm enhancing an existing x86 transform that uses fake multiplies
(they always become shl/lea) to avoid cmov or branching. The current code misses
cases where we have a negative constant and a positive constant, so this is just
trying to plug that hole.

The DAGCombiner diff prevents us from hitting a terrible inefficiency: we can start
with a select in IR, create a select DAG node, convert it into a sext, convert it
back into a select, and then lower it to sext machine code.

Some notes about the test diffs:

1. 2010-08-04-MaskedSignedCompare.ll - We were creating control flow that didn't exist in the IR.
2. memcmp.ll - Choose -1 or 1 is the case that got me looking at this again. We could avoid the
   push/pop in some cases if we used 'movzbl %al' instead of an xor on a different reg? That's a
   post-DAG problem though.
3. mul-constant-result.ll - The trade-off between sbb+not vs. setne+neg could be addressed if
   that's a regression, but those would always be nearly equivalent.
4. pr22338.ll and sext-i1.ll - These tests have undef operands, so we don't actually care about these diffs.
5. sbb.ll - This shows a win for what is likely a common case: choose -1 or 0.
6. select.ll - There's another borderline case here: cmp+sbb+or vs. test+set+lea? Also, sbb+not vs. setae+neg shows up again.
7. select_const.ll - These are motivating cases for the enhancement; replace cmov with cheaper ops.

Assembly differences between movzbl and xor to avoid a partial reg stall are caused later by the X86 Fixup SetCC pass.

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

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

6 years ago[globalisel][tablegen] Support zero-instruction emission.
Daniel Sanders [Fri, 11 Aug 2017 15:40:32 +0000 (15:40 +0000)]
[globalisel][tablegen] Support zero-instruction emission.

Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.

Depends on D35833

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits

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

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

6 years ago[mips] Lift the assertion on the types that can be used with MipsGPRel
Simon Dardis [Fri, 11 Aug 2017 14:36:05 +0000 (14:36 +0000)]
[mips] Lift the assertion on the types that can be used with MipsGPRel

Post commit review of rL308619 highlighted the need for handling N64
with -fno-pic. Testing reveale a stale assert when generating a GP
relative addressing mode.

This patch removes that assert and adds the necessary patterns for
MIPS64 to perform gp relative addressing with -fno-pic
(and the implicit -mno-abicalls + -mgpopt).

Reviewers: atanasyan, nitesh.jain

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

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

6 years ago[cmake] Expose the dependencies of ExecutionEngine as PUBLIC
Michal Gorny [Fri, 11 Aug 2017 13:25:20 +0000 (13:25 +0000)]
[cmake] Expose the dependencies of ExecutionEngine as PUBLIC

Expose the dependencies of LLVMExecutionEngine library as PUBLIC rather
than PRIVATE when building a shared library. This is necessary because
the library is not contained but exposes API of other LLVM libraries via
its headers.

This causes other libraries to fail to link if the linker verifies for
correctness of -l flags (i.e. fails on indirect dependencies). This e.g.
happens when building LLDB against shared LLVM:

  lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'
  lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN4llvm18MCJITMemoryManagerE[_ZTVN4llvm18MCJITMemoryManagerE]+0x60): undefined reference to `llvm::RuntimeDyld::MemoryManager::anchor()'
  lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0x48): undefined reference to `llvm::RTDyldMemoryManager::deregisterEHFrames()'
  lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0x60): undefined reference to `llvm::RuntimeDyld::MemoryManager::anchor()'
  lib64/liblldbExpression.a(IRExecutionUnit.cpp.o):(.data.rel.ro._ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE[_ZTVN12lldb_private15IRExecutionUnit13MemoryManagerE]+0xd0): undefined reference to `llvm::JITSymbolResolver::anchor()'
  collect2: error: ld returned 1 exit status

Declaring the dependencies as PUBLIC guarantees that any package using
the ExecutionEngine library will also get explicit -l flags for
the dependent libraries guaranteeing that the symbols exposed in headers
could be resolved.

Patch originally written by NAKAMURA Takumi.

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

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

6 years agoImprove handling of insert_subvector of bitcast values
Nirav Dave [Fri, 11 Aug 2017 13:21:41 +0000 (13:21 +0000)]
Improve handling of insert_subvector of bitcast values

Fix insert_subvector / extract_subvector merges of bitcast values.

Reviewers: efriedma, craig.topper, RKSimon

Subscribers: RKSimon, llvm-commits

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

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

6 years ago[X86][DAG] Switch X86 Target to post-legalized store merge
Nirav Dave [Fri, 11 Aug 2017 13:21:35 +0000 (13:21 +0000)]
[X86][DAG] Switch X86 Target to post-legalized store merge

Move store merge to happen after intrinsic lowering to allow lowered
stores to be merged.

Some regressions due in MergeConsecutiveStores to missing
insert_subvector that are addressed in follow up patch.

Reviewers: craig.topper, efriedma, RKSimon

Subscribers: llvm-commits

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

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

6 years ago[AArch64] Enable ARMv8.3-A pointer authentication
Sam Parker [Fri, 11 Aug 2017 13:14:00 +0000 (13:14 +0000)]
[AArch64] Enable ARMv8.3-A pointer authentication

Add assembler and disassembler support for the ARMv8.3-A pointer
authentication instructions.

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

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

6 years ago[AArch64] Remove dotprod from base extension list
Sjoerd Meijer [Fri, 11 Aug 2017 13:12:49 +0000 (13:12 +0000)]
[AArch64] Remove dotprod from base extension list

Dot product is an optional ARMv8.2a extension; remove it from the ARMv8.2a base
extension list. This was introduced in commit r310480.

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

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