1979 Commits

Author SHA1 Message Date
Philip Reames
c624032000 [SCEV] Simplify umin/max of zext and sext of the same value
This is a common idiom which arises after induction variables are widened, and we have two or more exit conditions.  Interestingly, we don't have instcombine or instsimplify support for this either.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375349 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-19 17:23:02 +00:00
Philip Reames
8aca037140 [Test] Precommit test for D69006
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375190 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-17 23:32:35 +00:00
Daniil Fukalov
8fac8d9af4 [AMDGPU] Improve code size cost model
Summary:
Added estimation for zero size insertelement, extractelement
and llvm.fabs operators.
Updated inline/unroll parameters default values.

Reviewers: rampitec, arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375109 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-17 12:15:35 +00:00
Alina Sbirlea
caaecec384 [MemorySSA] Update for partial unswitch.
Update MSSA for blocks cloned when doing partial unswitching.
Enable additional testing with MSSA.
Resolves PR43641.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 23:52:39 +00:00
Philip Reames
dc1d7acad3 [Tests] Add a SCEV analysis test for llvm.widenable.condition
Mostly because we don't appear to have one and a prototype patch I just saw would have broken the example committed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374835 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 22:42:35 +00:00
Simon Pilgrim
7cb9be5d19 [CostModel][X86] Add CTLZ scalar costs
Add specific scalar costs for CTLZ instructions, we can't discriminate between CTLZ and CTLZ_ZERO_UNDEF so we have to assume the worst. Given how BSR is often a microcoded nightmare on some older targets we might still be underestimating it.

For targets supporting LZCNT (Intel Haswell+ or AMD Fam10+), we provide overrides that assume 1cy costs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374786 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 16:30:17 +00:00
Simon Pilgrim
13da61c8c4 [CostModel][X86] Add CTPOP scalar costs (PR43656)
Add specific scalar costs for ctpop instructions, these are based on the llvm-mca's SLM throughput numbers (the oldest model we have).

For targets supporting POPCNT, we provide overrides that assume 1cy costs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374775 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:07:43 +00:00
Simon Pilgrim
fb4c141673 [CostModel][X86] Improve sum reduction costs.
I can't see any notable differences in costs between SSE2 and SSE42 arches for FADD/ADD reduction, so I've lowered the target to just SSE2.

I've also added vXi8 sum reduction costs in line with the PSADBW codegen and discussions on PR42674.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374655 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-12 13:21:50 +00:00
Alina Sbirlea
be044e6e98 [MemorySSA] Update Phi simplification.
When simplifying a Phi to the unique value found incoming, check that
there wasn't a Phi already created to break a cycle. If so, remove it.
Resolves PR43541.

Some additional nits included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374471 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10 23:27:21 +00:00
Alina Sbirlea
c24f456857 [MemorySSA] Additional handling of unreachable blocks.
Summary:
Whenever we get the previous definition, the assumption is that the
recursion starts ina  reachable block.
If the recursion starts in an unreachable block, we may recurse
indefinitely. Handle this case by returning LoE if the block is
unreachable.

Resolves PR43426.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374447 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10 20:43:06 +00:00
Alina Sbirlea
83774c7e99 [MemorySSA] Make the use of moveAllAfterMergeBlocks consistent.
Summary:
The rule for the moveAllAfterMergeBlocks API si for all instructions
from `From` to have been moved to `To`, while keeping the CFG edges (and
block terminators) unchanged.
Update all the callsites for moveAllAfterMergeBlocks to follow this.

Pending follow-up: since the same behavior is needed everytime, merge
all callsites into one. The common denominator may be the call to
`MergeBlockIntoPredecessor`.

Resolves PR43569.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374177 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 15:54:24 +00:00
Simon Pilgrim
61fe65b495 [CostModel][X86] Add tests for insertelement to non-immediate vector element indices
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374161 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 12:36:34 +00:00
Simon Pilgrim
3a6057eae9 [CostModel][X86] Add tests for extractelement from non-immediate vector element indices
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374160 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 12:36:22 +00:00
Alina Sbirlea
3eabf91779 [MemorySSA] Don't hoist stores if interfering uses (as calls) exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373674 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 22:20:04 +00:00
Alina Sbirlea
c1679d6c22 [MemorySSA] Update Phi creation when inserting a Def.
MemoryPhis should be added in the IDF of the blocks newly gaining Defs.
This includes the blocks that gained a Phi and the block gaining a Def,
if the block did not have one before.
Resolves PR43427.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373505 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 18:42:33 +00:00
Bardia Mahjour
4c48a601af [DDG] Data Dependence Graph - Root Node
Summary:
This patch adds Root Node to the DDG. The purpose of the root node is to create a single entry node that allows graph walk iterators to iterate through all nodes of the graph, making sure that no node is left unvisited during a graph walk (eg. SCC or DFS). Once the DDG is fully constructed it will have exactly one root node. Every node in the graph is reachable from the root. The algorithm for connecting the root node is based on depth-first-search that keeps track of visited nodes to try to avoid creating unnecessary edges.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

Tag: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373386 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 19:32:42 +00:00
Alina Sbirlea
e536ca663f [MemorySSA] Check for unreachable blocks when getting last definition.
If a single predecessor is found, still check if the block is
unreachable. The test that found this had a self loop unreachable block.
Resolves PR43493.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373383 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 19:09:50 +00:00
Alina Sbirlea
0f17fd2cb2 [MemorySSA] Update last_access_in_block check.
The check for "was there an access in this block" should be: is the last
access in this block and is it not a newly inserted phi.
Resolves new test in PR43438.

Also fix a typo when simplifying trivial Phis to match the comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373380 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 18:34:39 +00:00
Evandro Menezes
f47f0208a1 [ConstantFolding] Fold constant calls to log2()
Somehow, folding calls to `log2()` with a constant was missing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373262 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 20:53:23 +00:00
Tim Northover
ba5b64ef71 Revert "[SCEV] add no wrap flag for SCEVAddExpr."
This reverts r366419 because the analysis performed is within the context of
the loop and it's only valid to add wrapping flags to "global" expressions if
they're always correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373184 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 07:46:52 +00:00
Simon Pilgrim
c55d5fc412 [CostModel][X86] Fix SLM <2 x i64> icmp costs
SLM is 2 x slower for <2 x i64> comparison ops than other vector types, we should account for this like we do for SLM <2 x i64> add/sub/mul costs.

This should remove some of the SLM codegen diffs in D43582

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372954 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 10:14:38 +00:00
Alina Sbirlea
88de695493 [MemorySSA] Avoid adding Phis in the presence of unreachable blocks.
Summary:
If a block has all incoming values with the same MemoryAccess (ignoring
incoming values from unreachable blocks), then use that incoming
MemoryAccess and do not create a Phi in the first place.

Revert IDF work-around added in rL372673; it should not be required unless
the Def inserted is the first in its block.

The patch also cleans up a series of tests, added during the many
iterations on insertDef.

The patch also fixes PR43438.
The same issue that occurs in insertDef with "adding phis, hence the IDF of
Phis is needed", can also occur in fixupDefs: the `getPreviousRecursive`
call only adds Phis walking on the predecessor edges, which means there
may be the case of a Phi added walking the CFG "backwards" which
triggers the needs for an additional Phi in successor blocks.
Such Phis are added during fixupDefs only in the presence of unreachable
blocks.
Hence this highlights the need to avoid adding Phis in blocks with
unreachable predecessors in the first place.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372932 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 23:24:39 +00:00
Alina Sbirlea
ff0b826927 [MemorySSA] Update Phi insertion.
Summary:
MemoryPhis may be needed following a Def insertion inthe IDF of all the
new accesses added (phis + potentially a def). Ensure this also  occurs when
only the new MemoryPhis are the defining accesses.

Note: The need for computing IDF here is because of new Phis added with
edges incoming from unreachable code, Phis that had previously been
simplified. The preferred solution is to not reintroduce such Phis.
This patch is the needed fix while working on the preferred solution.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372673 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-23 23:50:16 +00:00
Simon Pilgrim
3ff0f3bdeb [Cost][X86] Add more missing vector truncation costs
The AVX512 cases still need some work to correct recognise the PMOV truncation cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372514 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-22 16:46:15 +00:00
Simon Pilgrim
0a8c54aac9 [Cost][X86] Add v2i64 truncation costs
We are missing costs for a lot of truncation cases, I'm hoping to address all the 'zero cost' cases in trunc.ll

I thought this was a vector widening side effect, but even before this we had some interesting LV decisions (notably over indvars) being made due to these zero costs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372498 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-22 12:04:38 +00:00
Ulrich Weigand
3e44783bf7 [SystemZ] Support z15 processor name
The recently announced IBM z15 processor implements the architecture
already supported as "arch13" in LLVM.  This patch adds support for
"z15" as an alternate architecture name for arch13.

The patch also uses z15 in a number of places where we used arch13
as long as the official name was not yet announced.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372435 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-20 23:04:45 +00:00
Shoaib Meenai
fffd837fe1 [Analysis] Allow -scalar-evolution-max-iterations more than once
At present, `-scalar-evolution-max-iterations` is a `cl::Optional`
option, which means it demands to be passed exactly zero or one times.
Our build system makes it pretty tricky to guarantee this. We often
accidentally pass the flag more than once (but always with the same
value) which results in an error, after which compilation fails:

```
clang (LLVM option parsing): for the -scalar-evolution-max-iterations option: may only occur zero or one times!
```

It seems reasonable to allow -scalar-evolution-max-iterations to be
passed more than once. Quoting the [[ http://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed | documentation ]]:

> The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times.
> ...
> If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained.

Original patch by: Enrico Bern Hardy Tanuwidjaja <etanuwid@fb.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372346 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-19 18:21:32 +00:00
Bardia Mahjour
d23ee4dbce Data Dependence Graph Basics
Summary:
This is the first patch in a series of patches that will implement data dependence graph in LLVM. Many of the ideas used in this implementation are based on the following paper:
D. J. Kuck, R. H. Kuhn, D. A. Padua, B. Leasure, and M. Wolfe (1981). DEPENDENCE GRAPHS AND COMPILER OPTIMIZATIONS.
This patch contains support for a basic DDGs containing only atomic nodes (one node for each instruction). The edges are two fold: def-use edges and memory-dependence edges.
The implementation takes a list of basic-blocks and only considers dependencies among instructions in those basic blocks. Any dependencies coming into or going out of instructions that do not belong to those basic blocks are ignored.

The algorithm for building the graph involves the following steps in order:

  1. For each instruction in the range of basic blocks to consider, create an atomic node in the resulting graph.
  2. For each node in the graph establish def-use edges to/from other nodes in the graph.
  3. For each pair of nodes containing memory instruction(s) create memory edges between them. This part of the algorithm goes through the instructions in lexicographical order and creates edges in reverse order if the sink of the dependence occurs before the source of it.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur, fhahn, myhsu

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto

Tag: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372238 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-18 17:43:45 +00:00
Jay Foad
07b40ea39f [SDA] Don't stop divergence propagation at the IPD.
Summary:
This fixes B42473 and B42706.

This patch makes the SDA propagate branch divergence until the end of the RPO traversal. Before, the SyncDependenceAnalysis propagated divergence only until the IPD in rpo order. RPO is incompatible with post dominance in the presence of loops. This made the SDA crash because blocks were missed in the propagation.

Reviewers: foad, nhaehnle

Reviewed By: foad

Subscribers: jvesely, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372223 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-18 13:40:22 +00:00
Bardia Mahjour
5d588c84b7 Revert "Data Dependence Graph Basics"
This reverts commit c98ec60993a7aa65073692b62f6d728b36e68ccd, which broke the sphinx-docs build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372168 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 19:22:01 +00:00
Bardia Mahjour
11e505acf5 Data Dependence Graph Basics
Summary:
This is the first patch in a series of patches that will implement data dependence graph in LLVM. Many of the ideas used in this implementation are based on the following paper:
D. J. Kuck, R. H. Kuhn, D. A. Padua, B. Leasure, and M. Wolfe (1981). DEPENDENCE GRAPHS AND COMPILER OPTIMIZATIONS.
This patch contains support for a basic DDGs containing only atomic nodes (one node for each instruction). The edges are two fold: def-use edges and memory-dependence edges.
The implementation takes a list of basic-blocks and only considers dependencies among instructions in those basic blocks. Any dependencies coming into or going out of instructions that do not belong to those basic blocks are ignored.

The algorithm for building the graph involves the following steps in order:

  1. For each instruction in the range of basic blocks to consider, create an atomic node in the resulting graph.
  2. For each node in the graph establish def-use edges to/from other nodes in the graph.
  3. For each pair of nodes containing memory instruction(s) create memory edges between them. This part of the algorithm goes through the instructions in lexicographical order and creates edges in reverse order if the sink of the dependence occurs before the source of it.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur, fhahn, myhsu

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto

Tag: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372162 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 18:55:44 +00:00
Alina Sbirlea
b68c01e0d7 [MemorySSA] Fix phi insertion when inserting a def.
Summary:
When inserting a Def, the current algorithm is walking edges backward
and inserting new Phis where needed. There may be additional Phis needed
in the IDF of the newly inserted Def and Phis.
Adding Phis in the IDF of the Def was added ina  previous patch, but we
may also need other Phis in the IDF of the newly added Phis.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372138 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 16:33:35 +00:00
Alina Sbirlea
831fe3501a [MemorySSA] Update MSSA for non-conventional AA.
Summary:
Regularly when moving an instruction that may not read or write memory,
the instruction is not modelled in MSSA, so not action is necessary.
For a non-conventional AA pipeline, MSSA needs to explicitly check when
creating accesses, so as to not model instructions that may not read and
write memory.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372137 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 16:31:37 +00:00
David Bolvansky
077e4d5d58 [SimplifyLibCalls] Mark known arguments with nonnull
Reviewers: efriedma, jdoerfert

Reviewed By: jdoerfert

Subscribers: ychen, rsmith, joerg, aaron.ballman, lebedev.ri, uenoku, jdoerfert, hfinkel, javed.absar, spatel, dmgreen, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372091 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 09:32:52 +00:00
Bardia Mahjour
2211b90ac7 [NFC] Test commit access
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372033 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 20:44:15 +00:00
Philip Reames
3cd2be9b6d [SCEV] Add smin support to getRangeRef
We were failing to compute trip counts (both exact and maximum) for any loop which involved a comparison against either an umin or smin. It looks like this simply got missed when we added smin/umin to SCEV.  (Note: umin was submitted separately earlier today.  Turned out two folks hit this at the same time.)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371776 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:32:27 +00:00
Evandro Menezes
a53ef73293 [ConstantFolding] Expand folding of some library functions
Expanding the folding of `nearbyint()`, `rint()` and `trunc()` to library
functions, in addition to the current support for intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371774 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 21:23:22 +00:00
Florian Hahn
9e6356994a [SCEV] Support SCEVUMinExpr in getRangeRef.
This patch adds support for SCEVUMinExpr to getRangeRef,
similar to the support for SCEVUMaxExpr.

Reviewers: sanjoy.google, efriedma, reames, nikic

Reviewed By: sanjoy.google

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 20:03:32 +00:00
Philip Reames
9d92ef499f Precommit tests for D67514
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371762 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 19:34:27 +00:00
Alina Sbirlea
333387e4a8 [MemorySSA] Pass (for update) MSSAU when hoisting instructions.
Summary: Pass MSSAU to makeLoopInvariant in order to properly update MSSA.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, uabelho, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371748 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 17:12:51 +00:00
Alina Sbirlea
ad040616ee [MemorySSA] Do not create memoryaccesses for debug info intrinsics.
Summary:
Do not model debuginfo intrinsics in MemorySSA.
Regularly these are non-memory modifying instructions. With -disable-basicaa, they were being modelled as Defs.

Reviewers: george.burgess.iv

Subscribers: aprantl, Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371565 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 22:35:27 +00:00
Guozhi Wei
5423bd20ef [BPI] Adjust the probability for floating point unordered comparison
Since NaN is very rare in normal programs, so the probability for floating point unordered comparison should be extremely small. Current probability is 3/8, it is too large, this patch changes it to a tiny number.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371541 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 17:25:11 +00:00
Evandro Menezes
8d2dc0ac2f [ConstantFolding] Add new test cases for transcendentals (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371246 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 19:41:49 +00:00
Alina Sbirlea
8d22d2f1d4 [MemorySSA] Update MemorySSA when removing debug.value calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371084 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 16:25:24 +00:00
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