Commit Graph

130125 Commits

Author SHA1 Message Date
Simon Pilgrim
c1307b1146 [X86] Added extra widening tests for and/xor/or bit operations
To make sure we're dealing with both cases of legal/illegal number of vector elements and legal/illegal vector element types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 10:58:52 +00:00
Simon Pilgrim
46e6ec4d54 [X86] Regenerated sdglue test checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 10:22:05 +00:00
Simon Pilgrim
6e01efbf2d [X86] Added widening tests for and/xor/or bit operations
Part of additional tests requested for D18944

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 10:16:27 +00:00
Andrey Turetskiy
26a9873b72 [X86] Restrict max long nop length for Lakemont.
Restrict the max length of long nops for Lakemont to 7. Experiments on MCU
benchmarks (Dhrystone, Coremark) show that this is the most optimal length.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 10:07:36 +00:00
Sanjoy Das
0a4c40265b [IndVars] Eliminate op.with.overflow when possible
Summary:
If we can prove that an op.with.overflow intrinsic does not overflow, we
can get rid of the intrinsic, and replace it with non-wrapping
arithmetic.

Reviewers: atrick, regehr

Subscribers: sanjoy, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 22:50:31 +00:00
Sanjoy Das
97ad447f43 [SCEV] See through op.with.overflow intrinsics
Summary:
This change teaches SCEV to see reduce `(extractvalue
0 (op.with.overflow X Y))` into `op X Y` (with a no-wrap tag if
possible).

Reviewers: atrick, regehr

Subscribers: mcrosier, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 22:50:26 +00:00
Mehdi Amini
2187597b34 Plumb the option to emit the ModuleHash in the bitcode through the bitcode writer APIs
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 21:07:19 +00:00
Simon Pilgrim
aef113a448 [X86][AVX512] Add vector integer division by constant tests
Added sdiv/srem and udiv/urem tests cases for 512 bit vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 17:14:26 +00:00
Simon Pilgrim
51c5e3db07 [X86][AVX512BW] Add support for v64i8 multiplies
Extend the existing lowering of vXi8 multiplies to support v64i8 on avx512bw targets.

I added the Lower512IntArith helper function to help with this - not sure how often this could be used in the future, but it seemed better than putting all that logic inside LowerMUL.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 17:02:48 +00:00
Elena Demikhovsky
9f62954aaa Loop vectorization with uniform load
Vectorization cost of uniform load wasn't correctly calculated.
As a result, a simple loop that loads a uniform value wasn't vectorized.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 16:53:19 +00:00
Teresa Johnson
a6346264ce [ThinLTO] Remove unused parameter (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 15:17:26 +00:00
Simon Pilgrim
4470d9b31b [X86][AVX512] Regenerated mask op tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 14:16:03 +00:00
Jeroen Ketema
828014932b [OCaml] Expose the LLVM diagnostic handler
Differential Revision: http://reviews.llvm.org/D18891


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 13:55:53 +00:00
Craig Topper
e6319e78de [X86] Use for loops over types to reduce code for setting up operation actions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 05:39:32 +00:00
Craig Topper
efe8e4444a [X86] Remove unnecessary setOperationAction for SRA v2i64/v4i64 when VLX is suppored. This is already done for SSE2/AVX2 which VLX implies. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 05:39:28 +00:00
Xinliang David Li
5cc3ce758d Fix asan test failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 05:31:29 +00:00
Xinliang David Li
6aa584fdaf [PGO] Fix deserialize bug
Raw function pointer collected by value
profile data may be from external functions
that are not instrumented. They won't have
mapping data to be used by the deserializer.
Force the value to be 0 in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 03:32:02 +00:00
Xinliang David Li
72c4075a5e Clean up test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-10 02:35:53 +00:00
Charles Davis
c15a907754 [CodeGen] Don't assume that fixed stack objects are aligned in a stack-realigned function.
Summary:
After we make the adjustment, we can assume that for local allocas, but
not for stack parameters, the return address, or any other fixed stack
object (which has a negative offset and therefore lies prior to the
adjusted SP).

Fixes PR26662.

Reviewers: hfinkel, qcolombet, rnk

Subscribers: rnk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 23:34:42 +00:00
Davide Italiano
7c0a10f790 [MC] support TLSDESC and TLSCALL / GNU2 tls dialect
Differential Revision:  http://reviews.llvm.org/D18885


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 20:32:33 +00:00
JF Bastien
d28179ee17 Fix hash_integer_value
Broken in D18938 because underlying_type only works for enums and not all stdlibs are sad when given a non-enum. Bots error out with 'only enumeration types have underlying types'.

There's probably a clever enable_if-ism that I can do with underlying_type and the actual integer value, but is_integral_or_enum also accepts implicit conversion so I need to ponder my life choices a bit before committing to template magic. A quick fix for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 20:25:02 +00:00
JF Bastien
0b0b58f2c4 is_integral_or_enum ❥ enum class ⇒ hashable enum class
Summary:
As discussed in D18775 making AtomicOrdering an enum class makes it non-hashable, which shouldn't be the case. Hashing.h defines hash_value for all is_integral_or_enum, but type_traits.h's definition of is_integral_or_enum only checks for *inplicit* conversion to integral types which leaves enum classes out and is very confusing because is_enum is true for enum classes.

This patch:
  - Adds a check for is_enum when determining is_integral_or_enum.
  - Explicitly converts the value parameter in hash_value to handle enum class hashing.

Note that the warning at the top of Hashing.h still applies: each execution of the program has a high probability of producing a different hash_code for a given input. Thus their values are not stable to save or persist, and should only be used during the execution for the construction of hashing datastructures.

Reviewers: dberlin, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 20:04:34 +00:00
Adrian Prantl
030f43a4df Drop debug info for DISubprograms that are not referenced by anything
This patch drops the debug info for all DISubprograms that are
(a) not attached to an llvm::Function and
(b) not indirectly reachable via inline scopes from any surviving Function and
(c) not reachable from a type (i.e.: member functions).

Background: I'm currently working on a patch to reverse the pointers
between DICompileUnit and DISubprogram (for more info check Duncan's RFC
on lazy-loading of debug info metadata
http://lists.llvm.org/pipermail/llvm-dev/2016-March/097419.html).
The idea is to remove the list of subprograms from DICompileUnit and
instead point to the owning compile unit from each DISubprogram.
After doing this all DISubprograms fulfilling the above criteria will be
implicitly dropped unless we go through an extra effort to preserve them.

http://reviews.llvm.org/D18477
<rdar://problem/25256815>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 18:10:22 +00:00
Sanjay Patel
b58a4e226b [x86] use BMI 'andn' for logic + compare ops
With BMI, we can use 'andn' to save an instruction when the result is only used in a compare.
This is related to one of the potential sequences to check 'isfinite' in:
https://llvm.org/bugs/show_bug.cgi?id=27164

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 16:02:52 +00:00
Simon Pilgrim
c710179bcb [X86][XOP] Support for VPPERM 2-input shuffle mask decoding
This patch adds support for decoding XOP VPPERM instruction when it represents a basic shuffle.

The mask decoding required the existing MCInstrLowering code to be updated to support binary shuffles - the implementation now matches what is done in X86InstrComments.cpp.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 14:51:26 +00:00
Craig Topper
a70c9d2763 [X86] Use for loops over types to reduce code for setting up operation actions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 06:31:02 +00:00
Craig Topper
799c5e4ce4 [X86] Remove calls to setOperationAction that set CTLZ_ZERO_UNDEF for some vector types to Expand. Expand is already set for all operations for all vector types earlier so this is redundant. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 05:53:48 +00:00
Sanjoy Das
5ff00d9679 Maintain calling convention when inling calls to llvm.deoptimize
The behavior here was buggy -- we'd forget the calling convention after
inlining a callsite calling llvm.deoptimize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-09 00:22:59 +00:00
Mike Aizatsky
5bb9d06dac [libfuzzer] defensive assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 23:32:24 +00:00
Chris Bieneman
908d3d5297 [CMake] Make llvm_ExternalProject always call the build action
This makes it so that when running 'ninja test-suite' from the top-level LLVM ninja build it *always* re-runs the ninja command in the test-suite directory.

This mechanism is required because the top-level ninja file doesn't have a view into the subdirectory dependency tree, so it can't know what, if anything, needs to be rebuilt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 22:46:04 +00:00
Adrian Prantl
48bb8b44d7 Support the Nodebug emission kind for DICompileUnits.
Sample-based profiling and optimization remarks currently remove
DICompileUnits from llvm.dbg.cu to suppress the emission of debug info
from them. This is somewhat of a hack and only borderline legal IR.

This patch uses the recently introduced NoDebug emission kind in
DICompileUnit to achieve the same result without breaking the Verifier.
A nice side-effect of this change is that it is now possible to combine
NoDebug and regular compile units under LTO.

http://reviews.llvm.org/D18808
<rdar://problem/25427165>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 22:43:03 +00:00
Sanjay Patel
7f8082cf9b fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 21:42:43 +00:00
Easwaran Raman
8a0abe782b Refactor Threshold computation. NFC.
This is part of changes reviewed in http://reviews.llvm.org/D17584.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 21:28:02 +00:00
Tim Shen
1a7750eecd [SSP] Remove llvm.stackprotectorcheck.
This is a cleanup patch for SSP support in LLVM. There is no functional change.
llvm.stackprotectorcheck is not needed, because SelectionDAG isn't
actually lowering it in SelectBasicBlock; rather, it adds check code in
FinishBasicBlock, ignoring the position where the intrinsic is inserted
(See FindSplitPointForStackProtector()).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 21:26:31 +00:00
Sanjay Patel
c2571ee1f1 [x86] show missed opportunities to use andn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 21:26:11 +00:00
Hans Wennborg
5451c707bc Rangeify a loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 20:46:09 +00:00
Hans Wennborg
7752b4e8a9 Remove some redundant variables from X86TargetLowering::LowerDYNAMIC_STACKALLOC
These are already defined, with the same values, a few lines up. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 20:46:00 +00:00
Kyle Butt
31fe4c9450 Codegen: Factor tail duplication into a utility class. NFC
This is in preparation for tail duplication during block placement. See D18226.
This needs to be a utility class for 2 reasons. No passes may run after block
placement, and also, tail-duplication affects subsequent layout decisions, so
it must be interleaved with placement, and can't be separated out into its own
pass. The original pass is still useful, and now runs by delegating to the
utility class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 20:35:01 +00:00
Sanjay Patel
d419844dd7 [x86] regenerate checks for BMI tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 20:29:39 +00:00
Evgeny Stupachenko
f9a07e70be test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 20:20:38 +00:00
James Y Knight
23084e86fb Add trailing colons to labels in a test.
This will avoid matching on the FILENAME if it happened to contain, say,
"f4" anywhere in the file path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 19:49:03 +00:00
Nirav Dave
53a6bdc93c Fix Load Control Dependence in MemCpy Generation
In Memcpy lowering we had missed a dependence from the load of the
operation to successor operations. This causes us to potentially
construct an in initial DAG with a memory dependence not fully
represented in the chain sub-DAG but rather require looking at the
entire DAG breaking alias analysis by allowing incorrect repositioning
of memory operations.

To work around this, r200033 changed DAGCombiner::GatherAllAliases to be
conservative if any possible issues to happen. Unfortunately this check
forbade many non-problematic situations as well. For example, it's
common for incoming argument lowering to add a non-aliasing load hanging
off of EntryNode. Then, if GatherAllAliases visited EntryNode, it would
find that other (unvisited) use of the EntryNode chain, and just give up
entirely. Furthermore, the check was incomplete: it would not actually
detect all such potentially problematic DAG constructions, because
GatherAllAliases did not guarantee to visit all chain nodes going up to
the root EntryNode. This is in general fine -- giving up early will just
miss a potential optimization, not generate incorrect results. But, for
this non-chain dependency detection code, it's possible that you could
have a load attached to a higher-up chain node than any which were
visited. If that load aliases your store, but the only dependency is
through the value operand of a non-aliasing store, it would've been
missed by this code, and potentially reordered.

With the dependence added, this check can be removed and Alias Analysis
can be much more aggressive. This fixes code quality regression in the
Consecutive Store Merge cleanup (D14834).

Test Change:

ppc64-align-long-double.ll now may see multiple serializations
of its stores

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 19:44:40 +00:00
Duncan P. N. Exon Smith
287cd84a21 ValueMapper: Extract llvm::RemapFunction from IRMover.cpp, NFC
Strip out the remapping parts of IRLinker::linkFunctionBody and put them
in ValueMapper.cpp under the name Mapper::remapFunction (with a
top-level entry-point llvm::RemapFunction).

This is a nice cleanup on its own since it puts the remapping code
together and shares a single Mapper context for the entire
IRLinker::linkFunctionBody Call.  Besides that, this will make it easier
to break the co-recursion between IRMover.cpp and ValueMapper.cpp in
follow ups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 19:26:32 +00:00
Duncan P. N. Exon Smith
16395b1e66 ValueMapper: Always use Mapper::mapValue from remapInstruction, NFCI
Use Mapper::mapValue instead of llvm::MapValue from
Mapper::remapInstruction when mapping an incoming block for a PHINode
(follow-up to r265832).  This will implicitly pass along the
Materializer argument, but when this code was added in r133513 there was
no Materializer argument.  I suspect this call to MapValue was just
missed in r182776 since it's not observable (basic blocks can't be
materialized, and they don't reference other values).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 19:17:13 +00:00
Duncan P. N. Exon Smith
6ead16629e ValueMapper: Roll RemapInstruction into Mapper, NFC
Add Mapper::remapInstruction, move the guts of llvm::RemapInstruction
into it, and use the same Mapper for most of the calls to MapValue and
MapMetadata.  There should be no functionality change here.

I left off the call to MapValue that wasn't passing in a Materializer
argument (for basic blocks of PHINodes).  It shouldn't change
functionality either, but I'm suspicious enough to commit separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 19:09:34 +00:00
Duncan P. N. Exon Smith
6900b64393 Linker: Always pass RF_IgnoreMissingLocals; NFC
This is a cleanup after clarifying the meaning of RF_IgnoreMissingLocals
in r265628 and truly limiting it to locals in r265768.

This should have no functionality change, since the only context that
the flag has an effect is when we could hit function-local Value and
Metadata, and we were already passing it in those contexts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 19:01:38 +00:00
Kevin B. Smith
99206081cf [X86] Fix PR23155 by turning on X86FixupBWInsts by default.
Differential Revision: http://reviews.llvm.org/D18866


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 18:58:29 +00:00
Duncan P. N. Exon Smith
81361659c5 ValueMapper: Don't memoize metadata when RF_NoModuleLevelChanges
Prevent the Metadata side-table in ValueMap from growing unnecessarily
when RF_NoModuleLevelChanges.  As a drive-by, make ValueMap::hasMD,
which apparently had no users until I used it here for testing, actually
compile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 18:49:36 +00:00
Duncan P. N. Exon Smith
ae29a03172 ValueMapper: Stop memoizing MDStrings
Stop adding MDString to the Metadata section of the ValueMap in
MapMetadata.  It blows up the size of the map for no benefit, since we
can always return quickly anyway.

There is a potential follow-up that I don't think I'll push on right
away, but maybe someone else is interested:  stop checking for a
pre-mapped MDString, and move the `isa<MDString>()` checks in
Mapper::mapSimpleMetadata and MDNodeMapper::getMappedOp in front of the
`VM.getMappedMD()` calls.  While this would preclude explicitly
remapping MDStrings it would probably be a little faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 18:47:02 +00:00
Sanjoy Das
8731336ad2 Propagate Undef in llvm.cos Intrinsic
Summary:
The llvm cos intrinsic currently does not propagate undef's. This change
transforms cos(undef) to null value or 0.

There are 2 test cases added as well.

Patch by Anna Thomas!

Reviewers: sanjoy

Subscribers: majnemer, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08 18:21:11 +00:00