Commit Graph

27 Commits

Author SHA1 Message Date
David Blaikie
7c9c6ed761 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 21:17:42 +00:00
Hans Wennborg
4d48c3f1aa LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()
If solveBlockValue() needs results from predecessors that are not already
computed, it returns false with the intention of resuming when the dependencies
have been resolved. However, the computation would never be resumed since an
'overdefined' result had been placed in the cache, preventing any further
computation.

The point of placing the 'overdefined' result in the cache seems to have been
to break cycles, but we can check for that when inserting work items in the
BlockValue stack instead. This makes the "stop and resume" mechanism of
solveBlockValue() work as intended, unlocking more analysis.

Using this patch shaves 120 KB off a 64-bit Chromium build on Linux.

I benchmarked compiling bzip2.c at -O2 but couldn't measure any difference in
compile time.

Tests by Jiangning Liu from r215343 / PR21238, Pete Cooper, and me.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222768 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 17:23:05 +00:00
Daniel Dunbar
24ec2e5a72 [tests] Cleanup initialization of test suffixes.
- Instead of setting the suffixes in a bunch of places, just set one master
   list in the top-level config. We now only modify the suffix list in a few
   suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).

 - Aside from removing the need for a bunch of lit.local.cfg files, this enables
   4 tests that were inadvertently being skipped (one in
   Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
   CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
   XFAILED).

 - This commit also fixes a bunch of config files to use config.root instead of
   older copy-pasted code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 00:37:11 +00:00
Stephen Lin
39f4e8d9cc Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change.
This update was done with the following bash script:

  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186268 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-14 01:42:54 +00:00
Stephen Lin
0dfc166487 Add newlines at end of test files, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186263 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-13 22:00:58 +00:00
Benjamin Kramer
e8aa36a4af CVP: If we have a PHI with an incoming select, try to skip the select.
This is a common pattern with dyn_cast and similar constructs, when the
PHI no longer depends on the select it can often be turned into a simpler
construct or even get hoisted out of the loop.

PR15340.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175995 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-24 15:34:43 +00:00
Benjamin Kramer
bd4b21ea41 Fix invalid IR in test, missing incoming value for PHI node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175994 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-24 15:34:29 +00:00
Benjamin Kramer
8be16fe703 CorrelatedPropagation: BasicBlock::removePredecessor can simplify PHI nodes. If the it's the condition of a SwitchInst, reload it.
Fixes PR13972.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164818 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28 10:42:50 +00:00
Nuno Lopes
e50487796d make LazyValueInfo analyze the default case of switch statements (we know that in the default branch the value cannot be any of the switch cases)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159353 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28 16:13:37 +00:00
Nuno Lopes
e441394784 make LVI::getEdgeValue() always intersect the constraints of the edge with the range of the block. Previously it was only performing the intersection for a few cases, thus losing precision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159320 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28 01:16:18 +00:00
Nuno Lopes
90255a8517 allow LazyValueInfo::getEdgeValue() to reason about multiple edges from the same switch instruction by doing union of ranges (which may still be conservative, but it's more aggressive than before)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-18 21:02:10 +00:00
Nuno Lopes
7397b2c751 add test case for bugfix in r157032
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-18 17:44:58 +00:00
Duncan Sands
6f1d799415 Eliminate switch cases that can never match, for example removes all
negative switch cases if the branch condition is known to be positive.
Inspired by a recent improvement to GCC's VRP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152405 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-09 13:45:18 +00:00
Benjamin Kramer
8979e5f372 LVI: Recognize the form instcombine canonicalizes range checks into when forming constant ranges.
This could probably be made a lot smarter, but this is a common case and doesn't require LVI to scan a lot
of code. With this change CVP can optimize away the "shift == 0" case in Hashing.h that only gets hit when
"shift" is in a range not containing 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 15:34:43 +00:00
Eli Bendersky
0f0c411079 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 06:28:33 +00:00
Nick Lewycky
33d84007b5 Test for lazy value info's ability to prove the absense of NULLs in pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123601 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 21:57:20 +00:00
Owen Anderson
86e8a700f5 Fix PR8790, another instance where unreachable code can cause instruction simplification to fail,
this case involve a select that simplifies to itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 00:55:35 +00:00
Owen Anderson
b20955f319 Update testcase since we're no longer doing the constant forwarding inline with correlated value propagation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 21:18:23 +00:00
Owen Anderson
b86f57c606 Add missing RUN line to this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 18:46:23 +00:00
Owen Anderson
c2ce21ad51 It is possible, under specific circumstances involving ptrtoint ConstantExpr's, for LVI to end up trying to merge
a Constant into a ConstantRange.  Handle this conservatively for now, rather than asserting.  The testcase is
more complex that I would like, but the manifestation of the problem is sensitive to iteration orders and the state of the
LVI cache, and I have not been able to reproduce it with manually constructed or simplified cases.

Fixes PR8162.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 18:28:33 +00:00
Owen Anderson
4b91c3ac96 Fix PR8161, in which an unreachable loop causes recursive instruction simplification to try
to replace an instruction with itself.  Add a predicate to the simplifier to prevent this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 17:42:36 +00:00
Owen Anderson
597dad35b8 Propagate non-local comparisons. Fixes PR1757.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:47:08 +00:00
Owen Anderson
1593dd6779 Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent.  This fixes PR4855.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:08:37 +00:00
Owen Anderson
ba4d0a005c Add PR number to test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 16:58:25 +00:00
Owen Anderson
df0b94bcea Fix typo. I accidentally edited the wrong file before my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 19:52:06 +00:00
Owen Anderson
66048c2169 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:23:58 +00:00
Owen Anderson
8320006473 Rename test directory to reflect new pass name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 07:50:31 +00:00