1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

320 Commits

Author SHA1 Message Date
Chris Lattner
2596ac19b9 teach SCEV that the scale and addition of an inbounds gep don't NSW.
This fixes a FIXME in scev-aa.ll (allowing a new no-alias result) and
generally makes things more precise.

llvm-svn: 125449
2011-02-13 03:14:49 +00:00
Chris Lattner
fec8b6bd6d Per discussion with Dan G, inbounds geps *certainly* can have
unsigned overflow (e.g. "gep P, -1"), and while they can have
signed wrap in theoretical situations, modelling an AddRec as
not having signed wrap is going enough for any case we can 
think of today.  In the future if this isn't enough, we can
revisit this.  Modeling them as having NUW isn't causing any
known problems either FWIW.

llvm-svn: 125410
2011-02-11 21:43:33 +00:00
Dan Gohman
6f83adb763 Add another rdar number.
llvm-svn: 124125
2011-01-24 17:54:01 +00:00
Nick Lewycky
13a2b8281f Simplify some code with no functionality change. Make the test a lot more
robust against smarter optimizations, using the power of FileCheck.

llvm-svn: 124081
2011-01-23 20:06:05 +00:00
Nick Lewycky
2503c9f9c8 Use value ranges to fold ext(trunc) in SCEV when possible.
llvm-svn: 124062
2011-01-23 06:20:19 +00:00
Tobias Grosser
ea8985cc25 Implement requiredTransitive
The PassManager did not implement the transitivity of requiredTransitive. This
was unnoticed since 2006.

llvm-svn: 123942
2011-01-20 21:03:22 +00:00
Nick Lewycky
51c13384f5 Similarly, analyze truncate through multiply.
llvm-svn: 123842
2011-01-19 18:56:00 +00:00
Nick Lewycky
9867e58096 Add a missed SCEV fold that is required to continue analyzing the IR produced
by indvars through the scev expander.

trunc(add x, y) --> add(trunc x, y). Currently SCEV largely folds the other way
which is probably wrong, but preserved to minimize churn. Instcombine doesn't
do this fold either, demonstrating a missed optz'n opportunity on code doing
add+trunc+add.

llvm-svn: 123838
2011-01-19 16:59:46 +00:00
Nick Lewycky
5a538b62ca Add a missing SCEV simplification sext(zext x) --> zext x.
llvm-svn: 123832
2011-01-19 15:56:12 +00:00
Dan Gohman
df668227fb Teach BasicAA to return PartialAlias in cases where both pointers
are pointing to the same object, one pointer is accessing the entire
object, and the other is access has a non-zero size. This prevents
TBAA from kicking in and saying NoAlias in such cases.

llvm-svn: 123775
2011-01-18 21:16:06 +00:00
Eric Christopher
c6db56a31e Revert the testcase from the previous reverted commit.
llvm-svn: 123227
2011-01-11 09:20:44 +00:00
Chris Lattner
749f1eff13 add a testcase I missed in previous commit.
llvm-svn: 123143
2011-01-09 23:52:31 +00:00
Chris Lattner
57e9b35653 teach SCEV analysis of PHI nodes that PHI recurences formed
with GEP instructions are always NUW, because PHIs cannot wrap
the end of the address space.

llvm-svn: 123105
2011-01-09 02:28:48 +00:00
Chris Lattner
fa37cac39c reduce indentation. Print <nuw> and <nsw> when dumping SCEV AddRec's
that have the bit set.

llvm-svn: 123104
2011-01-09 02:16:18 +00:00
Chris Lattner
a7735a573d fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiom
exposed.  It turns out to be a latent bug in basicaa, scary.

llvm-svn: 122772
2011-01-03 21:03:33 +00:00
Chris Lattner
76b74870be filecheckize
llvm-svn: 122771
2011-01-03 21:01:26 +00:00
Dan Gohman
29a260015a -enable-tbaa is on by default now.
llvm-svn: 121945
2010-12-16 02:53:48 +00:00
Dan Gohman
e106936414 Make memcpyopt TBAA-aware.
llvm-svn: 121944
2010-12-16 02:51:19 +00:00
Duncan Sands
2699fb1072 Move Sub simplifications and additional Add simplifications out of
instcombine and into InstructionSimplify.

llvm-svn: 121861
2010-12-15 14:07:39 +00:00
Dan Gohman
b187cce266 Reapply r121520, PartialAlias implementation for BasicAA, now that
memdep is updated to handle it.

llvm-svn: 121725
2010-12-13 22:50:24 +00:00
Dan Gohman
18e2a55c07 Revert r121520, which may have introduced miscompilations.
llvm-svn: 121573
2010-12-10 21:48:28 +00:00
Dan Gohman
d1bf1d8013 Implement PartialAlias checking in BasicAA.
llvm-svn: 121520
2010-12-10 20:47:03 +00:00
Chris Lattner
191aa08db1 remove fixme comment too.
llvm-svn: 120493
2010-11-30 23:25:01 +00:00
Chris Lattner
eee2bb2ff0 check in *all* files. This is now handled by my previous DSE commit.
llvm-svn: 120492
2010-11-30 23:23:59 +00:00
NAKAMURA Takumi
fc880d67f7 test: Check the feature 'loadable_module' with load modules in %llvmshlibdir.
%llvmshlibdir should be 'bin' on Cygming.

llvm-svn: 120282
2010-11-29 07:58:32 +00:00
Dan Gohman
139b090e0e Delete unneeded ssp attributes.
llvm-svn: 118836
2010-11-11 21:08:46 +00:00
Dan Gohman
7c6a63aea3 TBAA-enable ArgumentPromotion.
llvm-svn: 118804
2010-11-11 18:09:32 +00:00
Dan Gohman
01ed16d764 Make Sink tbaa-aware.
llvm-svn: 118788
2010-11-11 16:21:47 +00:00
Dan Gohman
2ffc9c8de3 Add a testcase which demonstrates alias analysis pass precedence.
llvm-svn: 118755
2010-11-11 01:03:30 +00:00
Dan Gohman
aef3e95364 Fully invalidate cached results when a prior query's size or
type is insufficient for, or incompatible with, the current query.

llvm-svn: 118721
2010-11-10 21:45:11 +00:00
Dan Gohman
a42f6c32a3 Teach FunctionAttrs about the VAArg instruction.
llvm-svn: 118627
2010-11-09 20:17:38 +00:00
Dan Gohman
cee4cb4b0a Add a testcase for a call which BasicAA says only accesses memory through
its arguments and which TBAA says doesn't write to memory.

llvm-svn: 118439
2010-11-08 20:20:11 +00:00
Dan Gohman
c04ed6e5da Make FunctionAttrs TBAA-aware.
llvm-svn: 118417
2010-11-08 17:12:04 +00:00
Dan Gohman
753c9ce807 Teach memdep to use pointsToConstantMemory to determine that loads
from constant memory don't alias any stores.

llvm-svn: 117636
2010-10-29 01:14:04 +00:00
Dan Gohman
a592a0f539 Add a basic testcase for TBAA-aware DSE.
llvm-svn: 117632
2010-10-29 00:54:02 +00:00
Dan Gohman
afaaf2f56b Add some comments.
llvm-svn: 116957
2010-10-20 22:04:02 +00:00
Dan Gohman
6efd04961b Don't pass the raw invalid pointer used to represent conflicting
TBAA information to AliasAnalysis.

llvm-svn: 116751
2010-10-18 21:28:00 +00:00
Dan Gohman
ed8fc1b23f Add a basic testcase for TBAA-aware LICM.
llvm-svn: 116745
2010-10-18 21:00:09 +00:00
Dan Gohman
2427af80d1 Run tbaa before basicaa, since that's how it's expected to be used.
llvm-svn: 116731
2010-10-18 18:45:59 +00:00
Dan Gohman
7820328076 Make TypeBasedAliasAnalysis default to doing nothing, with a command-line
option to enable it.

llvm-svn: 116722
2010-10-18 18:17:47 +00:00
Dan Gohman
6aff5b94ff Make BasicAliasAnalysis a normal AliasAnalysis implementation which
does normal initialization and normal chaining. Change the default
AliasAnalysis implementation to NoAlias.

Update StandardCompileOpts.h and friends to explicitly request
BasicAliasAnalysis.

Update tests to explicitly request -basicaa.

llvm-svn: 116720
2010-10-18 18:04:47 +00:00
Dan Gohman
8dc9781a91 Add a simple testcase for tbaa.
llvm-svn: 116272
2010-10-11 23:54:13 +00:00
Benjamin Kramer
caacff25e4 Remove PointerTracking tests.
llvm-svn: 115072
2010-09-29 19:20:35 +00:00
Eli Friedman
b5aea103fc PR7959: Handle negative scales in GEPs correctly in BasicAA for non-64-bit
targets.

llvm-svn: 114015
2010-09-15 20:08:03 +00:00
Chris Lattner
238f46d92e remove some noise from tests.
llvm-svn: 112889
2010-09-02 22:35:33 +00:00
Michael J. Spencer
2f463fc492 Fix constant-over-index.ll test on windows.
llvm-svn: 112483
2010-08-30 15:08:02 +00:00
Chris Lattner
7663b66c31 refix PR1143 by making basicaa analyze zexts of indices aggresively,
which I broke with a recent patch.

llvm-svn: 111452
2010-08-18 23:09:49 +00:00
Chris Lattner
b4602679d7 fix a buggy test
llvm-svn: 111354
2010-08-18 04:55:12 +00:00
Chris Lattner
49d0f29752 fix PR7589: In brief:
gep P, (zext x) != gep P, (sext x)

DecomposeGEPExpression was getting this wrong, confusing
basicaa.

llvm-svn: 111352
2010-08-18 04:28:19 +00:00
Chris Lattner
6ac971a27f filecheckize and detrivialize.
llvm-svn: 111350
2010-08-18 04:25:43 +00:00