1935 Commits

Author SHA1 Message Date
Simon Pilgrim
9e250a4782 [CostModel][X86] Add scalar sext/zext cost tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370684 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-02 21:02:51 +00:00
Alina Sbirlea
07dc5eb5e1 [MemorySSA] Rename all phi entries.
When renaming Phis incoming values, there may be multiple edges incoming
from the same block (switch). Rename all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370548 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 23:02:53 +00:00
Roman Lebedev
07c1e2bdfa [CostModel] Model all extractvalues as free.
Summary:
As disscussed in https://reviews.llvm.org/D65148#1606412,
`extractvalue` don't actually generate any code,
so we should treat them as free.

Reviewers: craig.topper, RKSimon, jnspaulsson, greened, asb, t.p.northover, jmolloy, dmgreen

Reviewed By: jmolloy

Subscribers: javed.absar, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370339 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 11:50:30 +00:00
Alina Sbirlea
82e7f2fc5f [MemorySSA] Fix insertUse.
Actually call the renamePass on inserted Phis.
Fixes PR42940.

Subscribers: llvm-commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369997 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 00:34:47 +00:00
Roland Froese
6c74fd7701 Recommit [PowerPC] Update P9 vector costs for insert/extract
Now that the v1i128 smin regression has been fixed, recommit the P9 cost
updates from D60160.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369952 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 19:26:08 +00:00
Johannes Doerfert
88c30ca9a2 [BasicAA] Use dereferenceability to reason about aliasing
Summary:
We already use the fact that an object with known size X does not alias
another objection of size Y > X before. With this commit, we use
dereferenceability information to determine a lower bound for Y and not
only rely on the user provided query size.

The result for @global_and_deref_arg_2() and @local_and_deref_ret_2()
in test/Analysis/BasicAA/dereferenceable.ll improved with this patch.

Reviewers: asbirlea, chandlerc, hfinkel, sanjoy

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369786 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 17:56:10 +00:00
Johannes Doerfert
7b27133646 [MustExec] Add a generic "must-be-executed-context" explorer
Given an instruction I, the MustBeExecutedContextExplorer allows to
easily traverse instructions that are guaranteed to be executed whenever
I is. For now, these instruction have to be statically "after" I, in
the same or different basic blocks.

This patch also adds a pass which prints the must-be-executed-context
for each instruction in a module. It is used to test the
MustBeExecutedContextExplorer, for now on the examples given in the
class comment of the MustBeExecutedIterator.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369765 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 15:17:27 +00:00
Craig Topper
3d187fdcb7 [X86] Lower the cost of v2i32->v2f64 sint_to_fp under vector widening legalization.
I don't really understand the costs we're using for fp_to_sint,
but prior to widening legalization we used 20 as the cost for this
via the v2i64->v2f64 entry. That number seems better than the 40
we got with widening legalization. So now we need either a
v2i32->v2f64 entry or a v4i32->v2f64 entry depending on whether
AVX is enabled or not since we skip the first SSE2 table look up
under AVX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369628 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 08:18:45 +00:00
Alina Sbirlea
f9146197d4 [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.
Summary:
Add a flag to the FunctionToLoopAdaptor that allows enabling MemorySSA only for the loop pass managers that are known to preserve it.

If an LPM is known to have only loop transforms that *all* preserve MemorySSA, then use MemorySSA if `EnableMSSALoopDependency` is set.
If an LPM has loop passes that do not preserve MemorySSA, then the flag passed is `false`, regardless of the value of `EnableMSSALoopDependency`.

When using a custom loop pass pipeline via `passes=...`, use keyword `loop` vs `loop-mssa` to use MemorySSA in that LPM. If a loop that does not preserve MemorySSA is added while using the `loop-mssa` keyword, that's an error.

Add the new `loop-mssa` keyword to a few tests where a difference occurs when enabling MemorySSA.

Reviewers: chandlerc

Subscribers: mehdi_amini, Prazek, george.burgess.iv, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369548 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 17:00:57 +00:00
Alina Sbirlea
6a813e0f3e [MemorySSA] Fix existing phis when inserting defs.
Summary:
When inserting a new Def, and inserting Phis in the IDF when needed,
also mark the already existing Phis in the IDF as non-optimized, since
these may need fixing as well.
In the test attached, there is a Phi in the IDF that happens to be
trivial, and is wrongfully removed by the call to getLastDef that
follows. This is a valid situation and the existing IDF Phis need to
marked as "may need fixing" as well.
Resolves PR43044.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369464 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 22:29:06 +00:00
Alina Sbirlea
40282b9a13 [MemorySSA] Rename uses when inserting memory uses.
Summary:
When inserting uses from outside the MemorySSA creation, we don't
normally need to rename uses, based on the assumption that there will be
no inserted Phis (if  Def existed that required a Phi, that Phi already
exists). However, when dealing with unreachable blocks, MemorySSA will
optimize away Phis whose incoming blocks are unreachable, and these Phis end
up being re-added when inserting a Use.
There are two potential solutions here:
1. Analyze the inserted Phis and clean them up if they are unneeded
(current method for cleaning up trivial phis does not cover this)
2. Leave the Phi in place and rename uses, the same way as whe inserting
defs.
This patch use approach 2.

Resolves first test in PR42940.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369291 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 18:57:40 +00:00
David Green
aca2a5b07f [ARM] MVE sext costs
This adds some sext costs for MVE, taken from the length of assembly sequences
that we currently generate.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369244 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 09:13:22 +00:00
David Green
2e3b080869 [ARM] MVE sext of a load is free
MVE also has some sext of loads, which will be free just as scalar
instructions are.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369118 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 15:13:37 +00:00
Benjamin Kramer
755506e11d Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata"
This reverts commit r369025. Crashes clang, test case is on the mailing
list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369096 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 10:59:18 +00:00
Florian Hahn
0b9143b20f [ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject.
Reviewers: nlopes, efriedma, hfinkel, sanjoy, aqjune, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369036 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 18:39:56 +00:00
Mark Lacey
c4ed7f707a [CallGraph] Refine call graph for indirect calls with !callees metadata
For indirect call sites having a small set of possible callees,
!callees metadata can be used to indicate what those callees are.
This patch updates the call graph and lazy call graph analyses so
that they consider this metadata when encountering call sites. For
the call graph, it adds a new external call graph node to the graph
for each unique !callees metadata node. A call graph edge connects
an indirect call site with the external node associated with the
!callees metadata that is attached to it. And there is an edge from
this external node to each of the callees indicated by the metadata.
Similarly, for the lazy call graph, the patch adds Ref edges from a
caller to the possible callees indicated by the metadata.

The primary purpose of the patch is to facilitate iterating over the
functions in a module such that all of the callees indicated by a
given !callees metadata node will be visited prior to the functions
containing call sites annotated by that node. This property is
required by optimizations performing a bottom-up traversal of the
SCC DAG. For example, the inliner can be made to inline through an
indirect call. If the call site is annotated with !callees metadata,
this patch ensures that the inliner will have visited all of the
callees prior to the caller, allowing it to reliably compute the
cost of inlining one or more of the potential callees.

Original patch by @mssimpso. I've made some small changes to get it
to apply, build, and pass tests on the top of tree, as well as
some minor tweaks to formatting and functionality.

Subscribers: mehdi_amini, hiraditya, llvm-commits, mssimpso

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369025 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 17:47:53 +00:00
Craig Topper
de920afcf3 [X86] Improve cost model for subvector extraction of less than 128-bit vectors
Now that we're using widening legalization. We need to improve our extract_subvector cost model for these types. This patch begins by modeling these as a subvector extract followed by a permute. I've left FIXMEs in the code for future improvements.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369022 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 17:29:42 +00:00
David Bolvansky
f6b0f6c007 [BuildLibCalls] Noalias annotation
Summary: I think this is better solution than annotating callsites in IC/SLC.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: MaskRay, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368875 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 16:50:06 +00:00
Craig Topper
50d3b49c52 [X86][CostModel] Adjust the costs of ZERO_EXTEND/SIGN_EXTEND with less than 128-bit inputs
Now that we legalize by widening, the element types here won't change. Previously these were modeled as the elements being widened and then the instruction might become an AND or SHL/ASHR pair. But now they'll become something like a ZERO_EXTEND_VECTOR_INREG/SIGN_EXTEND_VECTOR_INREG.

For AVX2, when the destination type is legal its clear the cost should be 1 since we have extend instructions that can produce 256 bit vectors from less than 128 bit vectors. I'm a little less sure about AVX1 costs, but I think the ones I changed were definitely too high, but they might still be too high.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368858 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 14:52:39 +00:00
Simon Pilgrim
adfa39d380 [X86] Add missing regular 512-bit vXi8 extract subvector cost model tests
These tests don't cover many cases where the subvectors don't start on aligned indices, but that can be added later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368839 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 12:36:23 +00:00
David Green
e752d08084 [ARM] Add MVE beats vector cost model
The MVE architecture has the idea of "beats", where a vector instruction can be
executed over several ticks of the architecture. This adds a similar system
into the Arm backend cost model, multiplying the cost of all vector
instructions by a factor.

This factor essentially becomes the expected difference between scalar code
and vector code, on average. MVE Vector instructions can also overlap so the a
true cost of them is often lower. But equally scalar instructions can in some
situations be dual issued, or have other optimisations such as unrolling or
make use of dsp instructions. The default is chosen as 2. This should not
prevent vectorisation is a most cases (as the vector instructions will still be
doing at least 4 times the work), but it will help prevent over vectorising in
cases where the benefits are less likely.

This adds things so far to the obvious places in ARMTargetTransformInfo, and
updates a few related costs like not treating float instructions as cost 2 just
because they are floats.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368733 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 18:12:08 +00:00
David Bolvansky
724a189534 [SimplifyLibCalls] Add noalias from known callsites
Summary:
Should be fine for memcpy, strcpy, strncpy.


Reviewers: jdoerfert, efriedma

Reviewed By: jdoerfert

Subscribers: uenoku, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368724 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 17:18:46 +00:00
Simon Pilgrim
0016b8457e [X86] Add some vXi8 extract subvector cost model tests
We don't have full 512-bit test coverage yet - but there's enough to help test D65892

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368716 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 16:44:40 +00:00
David Bolvansky
7ba7168c11 [SimplifyLibCalls] Add dereferenceable bytes from known callsites
Summary:
int mm(char *a, char *b) {
    return memcmp(a,b,16);
}

Currently:
define dso_local i32 @mm(i8* nocapture readonly %a, i8* nocapture readonly %b) local_unnamed_addr #1 {
entry:
  %call = tail call i32 @memcmp(i8* %a, i8* %b, i64 16)
  ret i32 %call
}

After patch:
define dso_local i32 @mm(i8* nocapture readonly %a, i8* nocapture readonly %b) local_unnamed_addr #1 {
entry:
  %call = tail call i32 @memcmp(i8* dereferenceable(16)  %a, i8* dereferenceable(16)  %b, i64 16)
  ret i32 %call
}




Reviewers: jdoerfert, efriedma

Reviewed By: jdoerfert

Subscribers: javed.absar, spatel, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368657 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 09:11:49 +00:00
Roman Lebedev
eb1f253790 [CostModel][X86][AArch64] Check all 3 cost kinds in aggregates.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368595 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 17:45:12 +00:00
David Green
a8d29d072c [ARM] sext of a load is free
This teaches the cost model that the sext or zext of a load is going to be
free.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368593 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 17:39:56 +00:00
David Green
28a7869cfd [ARM] MVE shuffle broadcast costs
A VDUP will perform a vector broadcast in a single instruction. Update the cost
model for MVE accordingly.

Code originally by David Sherwood.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368589 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 16:54:07 +00:00
David Green
b79014d80b [ARM] Put some of the TTI costmodel behind hasNeon calls.
This puts some of the calls in ARMTargetTransformInfo.cpp behind hasNeon()
checks, now that we have MVE, and updates all the tests accordingly.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368587 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 15:59:52 +00:00
David Green
d4c8890067 [ARM] Add or update a number of costmodel tests. NFC
This adds a number of cost model tests for ARM, useful for MVE. It also re-jigs
some of the existing tests to make them easier to update and read.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368586 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 15:40:27 +00:00
Roman Lebedev
9bf4dd36a3 [CostModel][X86][AArch64] Add some tests for extractvalue
In https://reviews.llvm.org/D65148 it is suggested that
it should have zero cost, always.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368548 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 09:24:33 +00:00
Whitney Tsang
561feff133 Title: Improve Loop Cache Analysis LIT tests.
Summary: Make LIT tests unsensitive to analysis output order.
Authored By: etiotto

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368450 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 16:18:22 +00:00
Whitney Tsang
b2f93fd3ba Title: Loop Cache Analysis
Summary: Implement a new analysis to estimate the number of cache lines
required by a loop nest.
The analysis is largely based on the following paper:

Compiler Optimizations for Improving Data Locality
By: Steve Carr, Katherine S. McKinley, Chau-Wen Tseng
http://www.cs.utexas.edu/users/mckinley/papers/asplos-1994.pdf
The analysis considers temporal reuse (accesses to the same memory
location) and spatial reuse (accesses to memory locations within a cache
line). For simplicity the analysis considers memory accesses in the
innermost loop in a loop nest, and thus determines the number of cache
lines used when the loop L in loop nest LN is placed in the innermost
position.

The result of the analysis can be used to drive several transformations.
As an example, loop interchange could use it determine which loops in a
perfect loop nest should be interchanged to maximize cache reuse.
Similarly, loop distribution could be enhanced to take into
consideration cache reuse between arrays when distributing a loop to
eliminate vectorization inhibiting dependencies.

The general approach taken to estimate the number of cache lines used by
the memory references in the inner loop of a loop nest is:

Partition memory references that exhibit temporal or spatial reuse into
reference groups.
For each loop L in the a loop nest LN: a. Compute the cost of the
reference group b. Compute the 'cache cost' of the loop nest by summing
up the reference groups costs
For further details of the algorithm please refer to the paper.
Authored By: etiotto
Reviewers: hfinkel, Meinersbur, jdoerfert, kbarton, bmahjour, anemet,
fhahn
Reviewed By: Meinersbur
Subscribers: reames, nemanjai, MaskRay, wuzish, Hahnfeld, xusx595,
venkataramanan.kumar.llvm, greened, dmgreen, steleman, fhahn, xblvaOO,
Whitney, mgorny, hiraditya, mgrang, jsji, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D63459

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368439 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 13:56:29 +00:00
Craig Topper
ea3fe92606 Recommit r368081 "[X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368185 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 16:42:47 +00:00
Craig Topper
9ef33c9301 Recommit r367901 "[X86] Enable -x86-experimental-vector-widening-legalization by default."
The assert that caused this to be reverted should be fixed now.

Original commit message:

This patch changes our defualt legalization behavior for 16, 32, and
64 bit vectors with i8/i16/i32/i64 scalar types from promotion to
widening. For example, v8i8 will now be widened to v16i8 instead of
promoted to v8i16. This keeps the elements widths the same and pads
with undef elements. We believe this is a better legalization strategy.
But it carries some issues due to the fragmented vector ISA. For
example, i8 shifts and multiplies get widened and then later have
to be promoted/split into vXi16 vectors.

This has the potential to cause regressions so we wanted to get
it in early in the 10.0 cycle so we have plenty of time to
address them.

Next steps will be to merge tests that explicitly test the command
line option. And then we can remove the option and its associated
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368183 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 16:24:26 +00:00
Mitch Phillips
7e7625f30a Revert "[X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors."
This reverts commit fc33e33776b7a7ce22e539f0ec2e3bfdb09ad361.

This commit depends on the rolled back commit rL367901, and thus needs
to be rolled back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368109 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 23:38:14 +00:00
Mitch Phillips
fcdae32ca1 Revert "[X86] Enable -x86-experimental-vector-widening-legalization by default."
This reverts commit 3de33245d2c992c9e0af60372043540b60f3a810.

This commit broke the MSan buildbots. See
https://reviews.llvm.org/rL367901 for more information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368107 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 23:00:43 +00:00
Craig Topper
49b912b85e [X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors.
With the switch to widening legalization, we need to a better
job of costing extractions of less than 128-bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368081 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 20:12:41 +00:00
Craig Topper
4b8ceeae63 [X86] Remove tests for -x86-experimental-vector-widening-legalization from test/Analysis/CostModel/X86/
This flag is now the default behavior so we don't need separate
tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368080 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 20:12:34 +00:00
Craig Topper
bd34ddf016 [X86] Enable -x86-experimental-vector-widening-legalization by default.
This patch changes our defualt legalization behavior for 16, 32, and
64 bit vectors with i8/i16/i32/i64 scalar types from promotion to
widening. For example, v8i8 will now be widened to v16i8 instead of
promoted to v8i16. This keeps the elements widths the same and pads
with undef elements. We believe this is a better legalization strategy.
But it carries some issues due to the fragmented vector ISA. For
example, i8 shifts and multiplies get widened and then later have
to be promoted/split into vXi16 vectors.

This has the potential to cause regressions so we wanted to get
it in early in the 10.0 cycle so we have plenty of time to
address them.

Next steps will be to merge tests that explicitly test the command
line option. And then we can remove the option and its associated
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367901 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 18:25:36 +00:00
Alina Sbirlea
d44a8316ba [MemorySSA] Add additional verification for phis.
Summary:
Verify that the incoming defs into phis are the last defs from the
respective incoming blocks.
When moving blocks, insertDef must RenameUses. Adding this verification
makes GVNHoist tests fail that uncovered this issue.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367451 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-31 17:41:04 +00:00
Alina Sbirlea
803bdc7051 [MemorySSA] Extend allowed behavior for simplified instructions.
Summary:
LoopRotate may simplify instructions, leading to the new instructions not having memory accesses created for them.
Allow this behavior, by allowing the new access to be null when the template is null, and looking upwards for the proper defined access when dealing with simplified instructions.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367352 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-30 20:10:33 +00:00
Hideto Ueno
204c769d62 [FunctionAttrs] Annotate "willreturn" for intrinsics
Summary:
In D62801, new function attribute `willreturn` was introduced. In short, a function with `willreturn` is guaranteed to come back to the call site(more precise definition is in LangRef).

In this patch, willreturn is annotated for LLVM intrinsics.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: jvesely, nhaehnle, sstefan1, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367184 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-28 06:09:56 +00:00
Ryan Taylor
c7a747a395 [IR][Verifier] Allow IntToPtrInst to be !dereferenceable
Summary:
Allow IntToPtrInst to carry !dereferenceable metadata tag.
This is valid since !dereferenceable can be only be applied to
pointer type values.

Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-23 17:19:56 +00:00
Peter Collingbourne
856544160d Fix pointer width in test from r366754.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366764 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 23:32:41 +00:00
Peter Collingbourne
c66809afeb Analysis: Don't look through aliases when simplifying GEPs.
It is not safe in general to replace an alias in a GEP with its aliasee
if the alias can be replaced with another definition (i.e. via strong/weak
resolution (linkonce_odr) or via symbol interposition (default visibility
in ELF)) while the aliasee cannot. An example of how this can go wrong is
in the included test case.

I was concerned that this might be a load-bearing misoptimization (it's
possible for us to use aliases to share vtables between base and derived
classes, and on Windows, vtable symbols will always be aliases in RTTI
mode, so this change could theoretically inhibit trivial devirtualization
in some cases), so I built Chromium for Linux and Windows with and without
this change. The file sizes of the resulting binaries were identical, so it
doesn't look like this is going to be a problem.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366754 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 22:13:46 +00:00
Chen Zheng
3afc24fa74 [SCEV] add no wrap flag for SCEVAddExpr.
Differential Revision: https://reviews.llvm.org/D64868


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366419 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-18 09:23:19 +00:00
Evgeniy Stepanov
4fca50d47d Basic codegen for MTE stack tagging.
Implement IR intrinsics for stack tagging. Generated code is very
unoptimized for now.

Two special intrinsics, llvm.aarch64.irg.sp and llvm.aarch64.tagp are
used to implement a tagged stack frame pointer in a virtual register.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366360 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 19:24:02 +00:00
Alina Sbirlea
cefa3d6eb6 [MemorySSA] Use SetVector to avoid nondeterminism.
Summary:
Use a SetVector for DeadBlockSet.
Resolves PR42574.

Reviewers: george.burgess.iv, uabelho, dblaikie

Subscribers: jlebar, Prazek, mgrang, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365970 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 22:30:30 +00:00
Ulrich Weigand
29e5bc5c35 [SystemZ] Add support for new cpu architecture - arch13
This patch series adds support for the next-generation arch13
CPU architecture to the SystemZ backend.

This includes:
- Basic support for the new processor and its features.
- Assembler/disassembler support for new instructions.
- CodeGen for new instructions, including new LLVM intrinsics.
- Scheduler description for the new processor.
- Detection of arch13 as host processor.

Note: No currently available Z system supports the arch13
architecture.  Once new systems become available, the
official system name will be added as supported -march name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365932 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 18:13:16 +00:00
Chen Zheng
977d7a6ed3 [SCEV] teach SCEV symbolical execution about overflow intrinsics folding.
Differential Revision: https://reviews.llvm.org/D64422


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365726 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-11 02:18:22 +00:00