Commit Graph

143235 Commits

Author SHA1 Message Date
Davide Italiano
459fcccb97 [NewGVN] Strengthen a couple of assertions.
StoreCount >= 0 on `unsigned` is always true, otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291709 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:49:00 +00:00
Michael Kuperstein
5c32548237 Add test that verifies we don't peel loops in optsize functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:42:51 +00:00
Peter Collingbourne
799d7f0370 LowerTypeTests: Represent the memory region size with the constant size-1.
This means that we can use a shorter instruction sequence in the case where
the size is a power of two and on the boundary between two representations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:32:10 +00:00
Eli Friedman
1404fc08fc [SCEV] Make howFarToZero max backedge-taken count check for precondition.
Refines max backedge-taken count if a loop like
"for (int i = 0; i != n; ++i) { /* body */ }" is rotated.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:07:15 +00:00
Eli Friedman
08108a29e3 [SCEV] Make howFarToZero use a simpler formula for max backedge-taken count.
This is both easier to understand, and produces a tighter bound in certain
cases.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:55:48 +00:00
Peter Collingbourne
1d8008b2d3 Re-apply r291205, "LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.", with a fix for an off-by-one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:28:46 +00:00
Daniel Berlin
42f1f6e771 NewGVN: Fix PR31594, by tracking the store count of congruence
classes, and updating checking to allow for equivalence through
reachability.

(Sadly, the checking here is not perfect, and can't be made perfect,
so we'll have to disable it after we are satisfied with correctness.
Right now it is just "very unlikely" to happen.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:22:36 +00:00
Daniel Berlin
06963901ef NewGVN: Refactor performCongruenceFinding and split out congruence class moving
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:22:05 +00:00
Rong Xu
6d80fe73c6 Resubmit "[PGO] Turn off comdat renaming in IR PGO by default"
This patch resubmits the changes in r291588.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:19:41 +00:00
Kyle Butt
0aa7497cd7 Revert "CodeGen: Allow small copyable blocks to "break" the CFG."
This reverts commit ada6595a52.

This needs a simple probability check because there are some cases where it is
not profitable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:55:19 +00:00
David Blaikie
ae69f7de68 Make some operator bools explicit for sanity/safety.
There are a couple left in bool-like containers (BitVector, etc) where
the implicit conversions seem more suitable - though it might be worth
considering explicitifying those too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291694 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:47:16 +00:00
Eli Friedman
1f1e5c29c3 [ARM] More aggressive matching for vpadd and vpaddl.
The new matchers work after legalization to make them simpler, and to avoid
blocking other optimizations.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:33:38 +00:00
Michael Kuperstein
8672808b6b [SLP] Remove bogus assert.
The removed assert seems bogus - it's perfectly legal for the roots of the
vectorized subtrees to be equal even if the original scalar values aren't,
if the original scalars happen to be equivalent.

This fixes PR31599.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:23:57 +00:00
Davide Italiano
83229eeee3 [lib/Object] Unbreak build with -Werror (unused variable). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291691 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:05:27 +00:00
Simon Pilgrim
9056d415cb [X86][XOP] Add vpermil2ps target shuffle -> insertps combine test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 18:48:00 +00:00
Greg Clayton
a9a480efd1 Remove all variants of DWARFDie::getAttributeValueAs...() that had parameters that specified default values.
Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291686 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 17:43:37 +00:00
Tim Northover
8ae3333f34 GlobalISel: only print debug info with -debug. NFC.
Turns out DEBUG(...) has uses even inside NDEBUG checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 17:33:37 +00:00
Ivan Krasin
52a39de25f Revert rL291205 because it breaks Chrome tests under CFI.
Summary:
Revert LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.

This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

Original URL: https://reviews.llvm.org/D28341

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:54:04 +00:00
Hans Wennborg
bc6b23e676 build_llvm_package.bat: Add note about what SWIG version to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:42:31 +00:00
Simon Pilgrim
62a30b4d3b Remove trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:38:20 +00:00
Piotr Padlewski
8e9ce7830f [MemDep] NFC variable name change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291679 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:23:54 +00:00
Evgeny Astigeevich
de8188fb92 [ARM] Fix test CodeGen/ARM/fpcmp_ueq.ll broken by rL290616
Commit rL290616 (https://reviews.llvm.org/rL290616) changed a checking command
for the triple arm-apple-darwin in LLVM::CodeGen/ARM/fpcmp_ueq.ll. As a result
of the changes the test could fail for the valid generated code.

These changes fixes the test to check only instructions we would expect.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291678 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:23:28 +00:00
George Rimar
bdfaae10c4 [lib/Object] - Introduce Decompressor class.
Decompressor intention is to reduce duplication of code.
Currently LLD has own implementation of decompressor
for compressed debug sections.

This class helps to avoid it and share the code.
LLD patch for reusing it is D28106

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291675 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 15:26:41 +00:00
Jonas Paulsson
ac6bde281d [SystemZ] Improve isFoldableMemAccessOffset().
A store of an extracted element or a load which gets inserted into a vector,
will be combined into a vector load/store element instruction.

Therefore, isFoldableMemAccessOffset(), which is called by LSR, should
return false in these cases.

Reviewer: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291673 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 14:40:39 +00:00
Hal Finkel
a6e44bd635 Make processing @llvm.assume more efficient - Add affected values to the assumption cache
Here's my second try at making @llvm.assume processing more efficient. My
previous attempt, which leveraged operand bundles, r289755, didn't end up
working: it did make assume processing more efficient but eliminating the
assumption cache made ephemeral value computation too expensive. This is a
more-targeted change. We'll keep the assumption cache, but extend it to keep a
map of affected values (i.e. values about which an assumption might provide
some information) to the corresponding assumption intrinsics. This allows
ValueTracking and LVI to find assumptions relevant to the value being queried
without scanning all assumptions in the function. The fact that ValueTracking
started doing O(number of assumptions in the function) work, for every
known-bits query, has become prohibitively expensive in some cases.

As discussed during the review, this is a pragmatic fix that, longer term, will
likely be replaced by a more-principled solution (perhaps based on an extended
SSA form).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 13:24:24 +00:00
Elena Demikhovsky
7449a168da X86 CodeGen: Optimized pattern for truncate with unsigned saturation.
DAG patterns optimization: truncate + unsigned saturation supported by VPMOVUS* instructions in AVX-512.
And VPACKUS* instructions on SEE* targets.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291670 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 12:59:32 +00:00
Sam Kolton
e8d33c0464 [AMDGPU] Assembler: SDWA/DPP should not accept scalar registers and immediate operands
Reviewers: artem.tamazov, nhaustov, vpykhtin, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 11:46:30 +00:00
Simon Pilgrim
79fab99b86 Fix unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291666 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 10:40:33 +00:00
Simon Pilgrim
b237097a65 [X86][AVX512BW] Vectorize v64i8 vector shifts
Differential Revision: https://reviews.llvm.org/D28447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 10:36:51 +00:00
Simon Pilgrim
4f063324dc Fix line endings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291663 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 10:25:31 +00:00
Chandler Carruth
c68d25fb58 [PM] Separate the LoopAnalysisManager from the LoopPassManager and move
the latter to the Transforms library.

While the loop PM uses an analysis to form the IR units, the current
plan is to have the PM itself establish and enforce both loop simplified
form and LCSSA. This would be a layering violation in the analysis
library.

Fundamentally, the idea behind the loop PM is to *transform* loops in
addition to running passes over them, so it really seemed like the most
natural place to sink this was into the transforms library.

We can't just move *everything* because we also have loop analyses that
rely on a subset of the invariants. So this patch splits the the loop
infrastructure into the analysis management that has to be part of the
analysis library, and the transform-aware pass manager.

This also required splitting the loop analyses' printer passes out to
the transforms library, which makes sense to me as running these will
transform the code into LCSSA in theory.

I haven't split the unittest though because testing one component
without the other seems nearly intractable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:43:56 +00:00
Chandler Carruth
6b834bb9ba [PM] Take more drastic measures to work around MSVC's failure on this
code. If this doesn't work and I can't find someone to help who has MSVC
installed, I'll back everything out I guess. =[

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291661 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:20:24 +00:00
Elad Cohen
3cf3d0849d [X86] Fix PR30926 - Add patterns for (v)cvtsi2s{s,d} and (v)cvtsd2s{s,d}
The code emiited by Clang's intrinsics for (v)cvtsi2ss, (v)cvtsi2sd,
(v)cvtsd2ss and (v)cvtss2sd is lowered to a code sequence that includes
redundant (v)movss/(v)movsd instructions. This patch adds patterns for
optimizing these sequences.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:11:48 +00:00
Mohammed Agabaria
208cabd074 [X86] fixing failed test in commit: r291657
Missing Requires asserts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:03:11 +00:00
Mohammed Agabaria
9c6b24cc3a [X86] updating TTI costs for arithmetic instructions on X86\SLM arch.
updated instructions:
pmulld, pmullw, pmulhw, mulsd, mulps, mulpd, divss, divps, divsd, divpd, addpd and subpd.

special optimization case which replaces pmulld with pmullw\pmulhw\pshuf seq. 
In case if the real operands bitwidth <= 16.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291657 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 08:23:37 +00:00
Chandler Carruth
c3bb9ef6a2 [PM] Pull a lambda out of an argument into a named variable to try and
get a little more clarity about the nature of the issue MSVC is having
with this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 08:23:29 +00:00
Chandler Carruth
7e0a3f982c [PM] Another attempt to satisfy MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291655 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 07:53:12 +00:00
Chandler Carruth
6c0548a4fa [PM] Try to appease MSVC by explicitly disambiguating a member name as
a template.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291654 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 07:37:50 +00:00
Dean Michael Berris
14cdbca6b8 [XRay] Define the library for XRay trace logs
Summary:
In this change we move the definition of the log reading routines from
the tools directory in LLVM to {include/llvm,lib}/XRay. We improve the
documentation a little bit for the publicly accessible headers, and
adjust the top-matter. This also leads to some refactoring and cleanup
in the tooling code.

In particular, we do the following:

  - Rename the class from LogReader to Trace, as it better represents
    the logical set of records as opposed to a log.
  - Use file type detection instead of asking the user to say what
    format the input file is. This allows us to keep the interface
    simple and encapsulate the logic of loading the data appropriately.

In future changes we increase the API surface and write dedicated unit
tests for the XRay library.

Depends on D24376.

Reviewers: dblaikie, echristo

Subscribers: mehdi_amini, mgorny, llvm-commits, varno

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291652 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 06:39:09 +00:00
Chandler Carruth
d27a39a962 [PM] Rewrite the loop pass manager to use a worklist and augmented run
arguments much like the CGSCC pass manager.

This is a major redesign following the pattern establish for the CGSCC layer to
support updates to the set of loops during the traversal of the loop nest and
to support invalidation of analyses.

An additional significant burden in the loop PM is that so many passes require
access to a large number of function analyses. Manually ensuring these are
cached, available, and preserved has been a long-standing burden in LLVM even
with the help of the automatic scheduling in the old pass manager. And it made
the new pass manager extremely unweildy. With this design, we can package the
common analyses up while in a function pass and make them immediately available
to all the loop passes. While in some cases this is unnecessary, I think the
simplicity afforded is worth it.

This does not (yet) address loop simplified form or LCSSA form, but those are
the next things on my radar and I have a clear plan for them.

While the patch is very large, most of it is either mechanically updating loop
passes to the new API or the new testing for the loop PM. The code for it is
reasonably compact.

I have not yet updated all of the loop passes to correctly leverage the update
mechanisms demonstrated in the unittests. I'll do that in follow-up patches
along with improved FileCheck tests for those passes that ensure things work in
more realistic scenarios. In many cases, there isn't much we can do with these
until the loop simplified form and LCSSA form are in place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 06:23:21 +00:00
Craig Topper
bd496c74a2 Revert r291645 "[DAGCombiner] Teach DAG combiner to fold (vselect (N0 xor AllOnes), N1, N2) -> (vselect N0, N2, N1). Only do this if the target indicates its vector boolean type is ZeroOrNegativeOneBooleanContent."
Some test appears to be hanging on the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291650 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:59:25 +00:00
Adam Nemet
3d79242c98 [LICM] Report failing to hoist conditionally-executed loads
These are interesting again because the user may not be aware that this
is a common reason preventing LICM.

A const is removed from an instruction pointer declaration in order to
pass it to ORE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291649 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:49 +00:00
Adam Nemet
f5fda305e6 [LICM] Report failing to hoist a load with an invariant address
These are interesting because lack of precision in alias information
could be standing in the way of this optimization.

An example is the case in the test suite that I showed in the DevMeeting
talk:

http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/MultiSource/Benchmarks/FreeBench/distray/CMakeFiles/distray.dir/html/_org_test-suite_MultiSource_Benchmarks_FreeBench_distray_distray.c.html#L236

canSinkOrHoistInst is also used from LoopSink, which does not use
opt-remarks so we need to take ORE as an optional argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:45 +00:00
Adam Nemet
468290d338 Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:41 +00:00
Adam Nemet
a162766bd7 [LICM] Report successful hoist/sink/promotion
Differential Revision: https://reviews.llvm.org/D27938

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:35 +00:00
Craig Topper
f7b662a8a4 [DAGCombiner] Teach DAG combiner to fold (vselect (N0 xor AllOnes), N1, N2) -> (vselect N0, N2, N1). Only do this if the target indicates its vector boolean type is ZeroOrNegativeOneBooleanContent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:02:23 +00:00
Matt Arsenault
a40945ed88 DAGCombiner: Add hasOneUse checks to fadd/fma combine
Even with aggressive fusion enabled, this requires duplicating
the fmul, or increases an fadd to another fma which is not an
improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291642 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 02:02:12 +00:00
Eugene Zelenko
bdf370d28b [Target] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291641 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 01:45:03 +00:00
Hans Wennborg
5811c15d6b Re-commit r289955: [X86] Fold (setcc (cmp (atomic_load_add x, -C) C), COND) to (setcc (LADD x, -C), COND) (PR31367)
This was reverted because it would miscompile code where the cmp had
multiple uses. That was due to a deficiency in the existing code, which
was fixed in r291630 (see the PR for details).

This re-commit includes an extra test for the kind of code that got
miscompiled: @test_sub_1_setcc_jcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 01:36:57 +00:00
NAKAMURA Takumi
91424c3023 tools/llvm-xray: Avoid std::errc::protocol_* to appease mingw, like r285261.
They are oriented from winsock and mingw doesn't import them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291636 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 01:06:57 +00:00