Duncan Sands
8a0f486e36
Move the "gep undef" -> "undef" transform from instcombine to
...
InstructionSimplify.
llvm-svn: 119970
2010-11-22 13:42:49 +00:00
Benjamin Kramer
585dfa2b3d
Initialize MemDep's TD member so buildbots don't trip over an uninitialized pointer (TD is passed to PHITransAddr).
...
I wonder why this didn't explode earlier.
llvm-svn: 119944
2010-11-21 15:21:46 +00:00
Duncan Sands
cf4bceba49
Add a rather pointless InstructionSimplify transform, inspired by recent constant
...
folding improvements: if P points to a type of size zero, turn "gep P, N" into "P".
More generally, if a gep index type has size zero, instcombine could replace the
index with zero, but that is not done here.
llvm-svn: 119942
2010-11-21 13:53:09 +00:00
Duncan Sands
1f86be9164
Fix spelling.
...
llvm-svn: 119941
2010-11-21 12:43:13 +00:00
Chris Lattner
6ce038082b
apply Dan's fix for PR8268 which allows constant folding to handle indexes over
...
zero sized elements. This allows us to compile:
#include <string>
void foo() { std::string s; }
into an empty function.
llvm-svn: 119933
2010-11-21 08:39:01 +00:00
Chris Lattner
663ba91cc6
add "getLocation" method to AliasAnalysis for getting the source and
...
destination location of a memcpy/memmove. I'm not clear about whether
TBAA works on these, so I'm leaving it out for now. Dan, please revisit
this when convenient.
llvm-svn: 119928
2010-11-21 07:51:27 +00:00
Chris Lattner
e48c31ce33
implement PR8576, deleting dead stores with intervening may-alias stores.
...
llvm-svn: 119927
2010-11-21 07:34:32 +00:00
Benjamin Kramer
ddd1b7b801
Simplify code. No change in functionality.
...
llvm-svn: 119908
2010-11-20 18:43:35 +00:00
Benjamin Kramer
c77ebcc9a5
Silence warning about an uninitialized variable.
...
llvm-svn: 119800
2010-11-19 11:37:26 +00:00
Duncan Sands
b238de0415
Remove threading of Xor over selects and phis, with an explanation
...
of why such threading is pointless.
llvm-svn: 119798
2010-11-19 09:20:39 +00:00
Duncan Sands
aef146b890
Factor code for testing whether replacing one value with another
...
preserves LCSSA form out of ScalarEvolution and into the LoopInfo
class. Use it to check that SimplifyInstruction simplifications
are not breaking LCSSA form. Fixes PR8622.
llvm-svn: 119727
2010-11-18 19:59:41 +00:00
Dan Gohman
f1ebfc1544
Strip trailing whitespace.
...
llvm-svn: 119706
2010-11-18 17:06:31 +00:00
Dan Gohman
0ab28b62b1
Use llvm_unreachable for "impossible" situations.
...
llvm-svn: 119705
2010-11-18 17:05:57 +00:00
Dan Gohman
2e1fc849b2
Add support for PHI-translating sext, zext, and trunc instructions,
...
enabling more PRE. PR8586.
llvm-svn: 119704
2010-11-18 17:05:13 +00:00
Dan Gohman
8ea83d81e0
Introduce memoization for ScalarEvolution dominates and properlyDominates
...
queries, and SCEVExpander getRelevantLoop queries.
llvm-svn: 119595
2010-11-18 00:34:22 +00:00
Dan Gohman
7e6b393e66
Factor out the code for purging a SCEV from all the various memoization maps.
...
Some of these maps may merge in the future, but for now it's convenient to have
a utility function for them.
llvm-svn: 119587
2010-11-17 23:28:48 +00:00
Dan Gohman
7ee1bbb76c
Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
...
memoize the results. This improves compile time in code which highly complex
expressions which get queried many times.
llvm-svn: 119584
2010-11-17 23:21:44 +00:00
Dan Gohman
534749bf70
Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
...
to ScalarEvolution. Delete SCEV::~SCEV. SCEV is no longer virtual.
llvm-svn: 119578
2010-11-17 22:27:42 +00:00
Dan Gohman
20d9ce21ef
Move SCEV::dominates and properlyDominates to ScalarEvolution.
...
llvm-svn: 119570
2010-11-17 21:41:58 +00:00
Dan Gohman
afd6db9932
Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
...
functions of ScalarEvolution, in preparation for memoization and
other optimizations.
llvm-svn: 119562
2010-11-17 21:23:15 +00:00
Duncan Sands
39d77131a1
Before replacing a phi node with a different value, it
...
needs to be checked that this won't break LCSSA form.
Change the existing checking method to a more direct one:
rather than seeing if all predecessors belong to the loop,
check that the replacing value is either not in any loop or
is in a loop that contains the phi node.
llvm-svn: 119556
2010-11-17 20:49:12 +00:00
Dan Gohman
d3a32ae4c8
Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
...
instead of in SCEVAddRecExpr's constructor, in preparation for an
upcoming change.
llvm-svn: 119554
2010-11-17 20:48:38 +00:00
Dan Gohman
ed75631743
Fix ScalarEvolution's range memoization to avoid using a
...
default ctor with ConstantRange.
llvm-svn: 119550
2010-11-17 20:23:08 +00:00
Duncan Sands
c89ac07e7a
Move some those Xor simplifications which don't require creating new
...
instructions out of InstCombine and into InstructionSimplify. While
there, introduce an m_AllOnes pattern to simplify matching with integers
and vectors with all bits equal to one.
llvm-svn: 119536
2010-11-17 18:52:15 +00:00
Duncan Sands
ec7a6ecb92
Now that hasConstantValue has been made simpler, it may return the
...
phi node itself if it occurs in an unreachable basic block. Protect
against this. Hopefully this will fix some more buildbots.
llvm-svn: 119493
2010-11-17 10:23:23 +00:00
Duncan Sands
64e41cf865
Previously SimplifyInstruction could report that an instruction
...
simplified to itself (this can only happen in unreachable blocks).
Change it to return null instead. Hopefully this will fix some
buildbot failures.
llvm-svn: 119490
2010-11-17 08:35:29 +00:00
Duncan Sands
7412f6e53d
Fix a layering violation: hasConstantValue, which is part of the PHINode
...
class, uses DominatorTree which is an analysis. This change moves all of
the tricky hasConstantValue logic to SimplifyInstruction, and replaces it
with a very simple literal implementation. I already taught users of
hasConstantValue that need tricky stuff to use SimplifyInstruction instead.
I didn't update InlineFunction because the IR looks like it might be in a
funky state at the point it calls hasConstantValue, which makes calling
SimplifyInstruction dangerous since it can in theory do a lot of tricky
reasoning. This may be a pessimization, for example in the case where
all phi node operands are either undef or a fixed constant.
llvm-svn: 119459
2010-11-17 04:30:22 +00:00
Duncan Sands
d06f50e2db
Have ScalarEvolution use SimplifyInstruction rather than hasConstantValue.
...
While there, add a note about an inefficiency I noticed.
llvm-svn: 119458
2010-11-17 04:18:45 +00:00
Dan Gohman
761065e3b7
Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
...
This fixes some extreme compile times on unrolled sha512 code.
llvm-svn: 119455
2010-11-17 02:44:44 +00:00
Duncan Sands
5ffc298bc7
In which I discover the existence of loops. Threading an operation
...
over a phi node by applying it to each operand may be wrong if the
operation and the phi node are mutually interdependent (the testcase
has a simple example of this). So only do this transform if it would
be correct to perform the operation in each predecessor of the block
containing the phi, i.e. if the other operands all dominate the phi.
This should fix the FFMPEG snow.c regression reported by İsmail Dönmez.
llvm-svn: 119347
2010-11-16 12:16:38 +00:00
Duncan Sands
f12ba1dfe1
Teach InstructionSimplify the trick of skipping incoming phi
...
values that are equal to the phi itself.
llvm-svn: 119161
2010-11-15 17:52:45 +00:00
Duncan Sands
b99f39b9f6
If dom tree information is available, make it possible to pass
...
it to get better phi node simplification.
llvm-svn: 119055
2010-11-14 18:36:10 +00:00
Duncan Sands
4581ddc123
Teach InstructionSimplify about phi nodes. I chose to have it simply
...
offload the work to hasConstantValue rather than do something more
complicated (such handling mutually recursive phis) because (1) it is
not clear it is worth it; and (2) if it is worth it, maybe such logic
would be better placed in hasConstantValue. Adjust some GVN tests
which are now cleaned up much further (eg: all phi nodes are removed).
llvm-svn: 119043
2010-11-14 13:30:18 +00:00
Duncan Sands
1d27f01210
Boost the power of phi node constant folding slightly: if all
...
operands are the phi node itself or undef, then return undef.
This logic already existed at a higher level so in practice it
shouldn't make the slightest difference. Note that this code
could be replaced by a call to PN->hasConstantValue(). However
since we bail out the moment we see a non-constant operand, it
is more efficient to have a specialized version of that logic.
llvm-svn: 119041
2010-11-14 12:53:18 +00:00
Duncan Sands
7e800d6f9c
Strip trailing whitespace.
...
llvm-svn: 119038
2010-11-14 11:23:23 +00:00
Duncan Sands
e5ac78e16e
Fix typo pointed out by Trevor Harmon.
...
llvm-svn: 119001
2010-11-13 12:16:27 +00:00
Dan Gohman
970afd926f
Re-disable TBAA for now; it broke MultiSource/Applications/JM/lencod,
...
at least.
llvm-svn: 118890
2010-11-12 11:21:08 +00:00
Dan Gohman
ea18d8ec2d
Enable TBAA.
...
llvm-svn: 118884
2010-11-12 06:20:01 +00:00
Dan Gohman
65316d6749
Add helper functions for computing the Location of load, store,
...
and vaarg instructions.
llvm-svn: 118845
2010-11-11 21:50:19 +00:00
Dan Gohman
468638826e
Don't forget the TBAA info, if available.
...
llvm-svn: 118842
2010-11-11 21:27:26 +00:00
Dan Gohman
7dacf8f3f3
Avoid calling alias on non-pointer values.
...
llvm-svn: 118822
2010-11-11 19:23:51 +00:00
Dan Gohman
c87c843db7
It's not necessary to clear out the Size and TBAATag at each of
...
these points.
llvm-svn: 118752
2010-11-11 00:42:22 +00:00
Dan Gohman
8bf3d832e5
Set NonLocalDepInfo's Size field to UnknownSize when invalidating
...
it, so that it doesn't appear to be a known size.
llvm-svn: 118748
2010-11-11 00:20:27 +00:00
Dan Gohman
6791936848
When clearing a non-local pointer dependency cache entry, clear
...
the reverse map too. This fixes seflhost build errors.
llvm-svn: 118729
2010-11-10 22:35:02 +00:00
Devang Patel
364bf04267
Take care of special characters while creating named MDNode name to hold function specific local variable's info.
...
This fixes radar 8653152. I am checking in testcase as a separate check-in.
llvm-svn: 118726
2010-11-10 22:19:21 +00:00
Dan Gohman
1d760ce8b3
Factor out the code for computing an AliasAnalysis::Location
...
for a given instruction into a helper function.
llvm-svn: 118723
2010-11-10 21:51:35 +00:00
Dan Gohman
2e8ca44b81
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
Duncan Sands
8f7220e9fd
Reduce the maximum recursion depth, 5 seems pointlessly too much.
...
Probably it should just be 1, but compromise with 3.
llvm-svn: 118718
2010-11-10 20:53:24 +00:00
Dan Gohman
0a6021a54d
Enhance GVN to do more precise alias queries for non-local memory
...
references. For example, this allows gvn to eliminate the load in
this example:
void foo(int n, int* p, int *q) {
p[0] = 0;
p[1] = 1;
if (n) {
*q = p[0];
}
}
llvm-svn: 118714
2010-11-10 20:37:15 +00:00
Duncan Sands
f3b1bf1606
Teach InstructionSimplify how to look through PHI nodes. Since PHI
...
nodes can be used in loops, this could result in infinite looping
if there is no recursion limit, so add such a limit. It is also
used for the SelectInst case because in theory there could be an
infinite loop there too if the basic block is unreachable.
llvm-svn: 118694
2010-11-10 18:23:01 +00:00
Dan Gohman
066c1bb1e9
Add a doesAccessArgPointees helper function, and update code to use
...
it, and to be consistent.
llvm-svn: 118692
2010-11-10 18:17:28 +00:00
Duncan Sands
b0579e9d3f
Simplify binary operations where one operand is a select instruction.
...
The simplifications performed here never create new instructions, they
only return existing instructions (or a constant), and so are always a
win. In theory they should transform (for example)
%z = and i32 %x, %y
%s = select i1 %cond, i32 %y, i32 %z
%r = and i32 %x, %s
into
%r = and i32 %x, y
but in practice they get into a fight with instcombine, and lose.
Unfortunately instcombine does a poor job in this case. Nonetheless
I'm committing this transform to make it easier to discuss what to
do to make peace with instcombine.
llvm-svn: 118679
2010-11-10 13:00:08 +00:00
Dan Gohman
2694e14087
Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
...
chaining and simplify FunctionAttrs' GetModRefBehavior logic.
llvm-svn: 118660
2010-11-10 01:02:18 +00:00
Dan Gohman
88ff1ece63
VAArg doesn't capture its operand.
...
llvm-svn: 118623
2010-11-09 20:09:35 +00:00
Dan Gohman
5d06f892ef
Teach AliasAnalysis about AccessesArgumentsReadonly.
...
llvm-svn: 118621
2010-11-09 20:06:55 +00:00
Dan Gohman
0f17507478
Teach LICM and AliasSetTracker about AccessesArgumentsReadonly.
...
llvm-svn: 118618
2010-11-09 19:58:21 +00:00
Duncan Sands
fc5ad3f0f9
Factorize code, no functionality change.
...
llvm-svn: 118516
2010-11-09 17:25:51 +00:00
Dan Gohman
142ff82a18
Re-introduce the MaxLookup limit to BasicAliasAnalysis'
...
pointsToConstantMemory code to guard against possible
compile time slowdowns.
llvm-svn: 118440
2010-11-08 20:26:19 +00:00
Dan Gohman
601c94b309
Implement getModRefBehavior for TypeBasedAliasAnalysis.
...
llvm-svn: 118416
2010-11-08 17:10:22 +00:00
Dan Gohman
9130bad71f
Extend the AliasAnalysis::pointsToConstantMemory interface to allow it
...
to optionally look for constant or local (alloca) memory.
Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select
and Phi nodes, and to support looking for local memory.
Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that
AliasAnalysis knows all the tricks that it knew.
llvm-svn: 118412
2010-11-08 16:45:26 +00:00
Dan Gohman
0b56778d65
Delete getIntrinsicModRefBehavior. Clients can just use the normal
...
getModRefBehavior now, since it now understands intrinsics as well
as normal functions.
llvm-svn: 118411
2010-11-08 16:11:19 +00:00
Dan Gohman
e461d7d135
Teach BasicAliasAnalysis::getModRefBehavior(const Function *F)
...
to analyze intrinsic functions.
llvm-svn: 118409
2010-11-08 16:08:43 +00:00
Duncan Sands
a620bd1fa3
Add simplification of floating point comparisons with the result
...
of a select instruction, the same as already exists for integer
comparisons.
llvm-svn: 118379
2010-11-07 16:46:25 +00:00
Duncan Sands
f532d31198
Fix a README item: when doing a comparison with the result
...
of a select instruction, see if doing the compare with the
true and false values of the select gives the same result.
If so, that can be used as the value of the comparison.
llvm-svn: 118378
2010-11-07 16:12:23 +00:00
Benjamin Kramer
ed8b7bf9ed
Use arrays instead of constant-sized SmallVectors.
...
llvm-svn: 118257
2010-11-04 18:45:27 +00:00
Devang Patel
57c5a20364
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
...
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 15:01:38 +00:00
Devang Patel
415c551459
Fix DIType verifier. The element 3 is DIFile now.
...
llvm-svn: 118054
2010-11-02 20:41:13 +00:00
Dan Gohman
dcb354b234
Make ScalarEvolution::forgetLoop forget all contained loops too, because
...
they may have ValuesAtScopes map entries referencing their outer loops.
This fixes a user-after-free reported in PR8471.
llvm-svn: 117698
2010-10-29 20:16:10 +00:00
Dan Gohman
15a43965ac
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
c6096263e2
Support TBAA attachments on calls. This is somewhat experimental.
...
llvm-svn: 117317
2010-10-25 21:38:20 +00:00
Dan Gohman
82b2e0da9c
Fix chaining in TBAA's pointsToConstantMemory.
...
llvm-svn: 117314
2010-10-25 21:24:55 +00:00
Dan Gohman
e6715d0755
Only read one bit for testing for a readonly type, leaving the other
...
bits open for future uses.
llvm-svn: 117301
2010-10-25 20:22:29 +00:00
Dan Gohman
fd864a1d31
Add a comment.
...
llvm-svn: 117288
2010-10-25 19:47:25 +00:00
Dan Gohman
abaf2d8d3b
Update comments; BasicAA is no longer necessarily the end of the chain.
...
llvm-svn: 117268
2010-10-25 16:29:52 +00:00
Dan Gohman
1033ce669b
Reintroduce these asserts, now that BasicAA is a normal AliasAnalysis pass.
...
llvm-svn: 117266
2010-10-25 16:28:57 +00:00
Benjamin Kramer
9192e7ab12
Make some symbols static, move classes into anonymous namespaces.
...
llvm-svn: 117111
2010-10-22 17:35:07 +00:00
Dan Gohman
8512270dbc
Add some more documentation.
...
llvm-svn: 117070
2010-10-21 21:55:35 +00:00
Dan Gohman
12c9e0cf1c
Explain what "constant" means here.
...
llvm-svn: 117053
2010-10-21 19:45:09 +00:00
Dan Gohman
104f1812ce
Update comments.
...
llvm-svn: 117048
2010-10-21 19:01:22 +00:00
Dan Gohman
1b85604130
Memdep says that an instruction clobbers itself
...
when it means there is no specific clobber instruction.
llvm-svn: 116960
2010-10-20 22:37:41 +00:00
Dan Gohman
a2ab75bc8d
Factor out the main aliasing check into a separate function.
...
llvm-svn: 116958
2010-10-20 22:11:14 +00:00
Dan Gohman
2549d0cf64
Fix comments; the type graph is currently a tree, not a DAG.
...
llvm-svn: 116954
2010-10-20 22:02:58 +00:00
Tobias Grosser
23c8341c3d
Add RegionPass support.
...
A RegionPass is executed like a LoopPass but on the regions detected by the
RegionInfo pass instead of the loops detected by the LoopInfo pass.
llvm-svn: 116905
2010-10-20 01:54:44 +00:00
Douglas Gregor
48b4568718
Fix CMake build
...
llvm-svn: 116903
2010-10-20 01:36:56 +00:00
Dan Gohman
da85ed8541
Move NoAA out of BasicAliasAnalysis.cpp into its own file, now that
...
it doesn't have a special relationship with BasicAliasAnalysis
anymore.
llvm-svn: 116876
2010-10-19 23:09:08 +00:00
Dan Gohman
f372cf869b
Reapply r116831 and r116839, converting AliasAnalysis to use
...
uint64_t, plus fixes for places I missed before.
llvm-svn: 116875
2010-10-19 22:54:46 +00:00
Dan Gohman
b4aa503501
Revert r116831 and r116839, which are breaking selfhost builds.
...
llvm-svn: 116858
2010-10-19 21:06:16 +00:00
Dan Gohman
f4c5fe73be
Change AliasAnalysis and its clients to use uint64_t instead of unsigned
...
for representing object sizes, for consistency with other parts of LLVM.
llvm-svn: 116831
2010-10-19 18:00:02 +00:00
Owen Anderson
6c18d1aac0
Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
...
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.
Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.
I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.
llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Dan Gohman
14fe8cf238
Consistently use AliasAnalysis::UnknownSize instead of hardcoding ~0u.
...
llvm-svn: 116815
2010-10-19 17:06:23 +00:00
Dan Gohman
e4a82e2f21
Make the representation of AliasSets explicitly differentiate
...
between "not known yet" and "known no tbaa info" so that it
can merge them properly.
llvm-svn: 116767
2010-10-18 23:31:47 +00:00
Dan Gohman
408beac597
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
71af9db0e8
Make AliasSetTracker TBAA-aware, enabling TBAA-enabled LICM.
...
llvm-svn: 116743
2010-10-18 20:44:50 +00:00
Dan Gohman
f3702452c8
Fix BasicAA to pass TBAAInfo through to the chained analysis.
...
llvm-svn: 116730
2010-10-18 18:45:11 +00:00
Dan Gohman
33fcde9b9c
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
f0a3bed6d6
Use chaining in TypeBasedAliasAnalysis::pointsToConstantMemory.
...
llvm-svn: 116721
2010-10-18 18:10:31 +00:00
Dan Gohman
02538ac4d3
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
Benjamin Kramer
1dc34b48dd
Eliminate some calls to Value::getNameStr.
...
llvm-svn: 116670
2010-10-16 11:28:23 +00:00
Dan Gohman
31a01ee3cb
Tolerate a null parent pointer.
...
llvm-svn: 116533
2010-10-14 22:55:57 +00:00
Chris Lattner
698661c741
add uadd_ov/usub_ov to apint, consolidate constant folding
...
logic to use the new APInt methods. Among other things this
implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold
which comes from "clang -ftrapv", originally brought to my attention from PR8221.
llvm-svn: 116457
2010-10-14 00:05:07 +00:00
Owen Anderson
c266a36625
Analysis groups need to initialize their default implementations.
...
llvm-svn: 116441
2010-10-13 21:49:58 +00:00
Tobias Grosser
4b0986b6c1
Add Region::isTopLevelRegion().
...
llvm-svn: 116402
2010-10-13 11:02:44 +00:00
Tobias Grosser
4c71c117d1
RegionInfo: Fix trivial error that slipped in last minute.
...
llvm-svn: 116400
2010-10-13 08:00:53 +00:00
Tobias Grosser
fe92a9384e
RegionInfo: Update RegionInfo after a BB was split.
...
llvm-svn: 116398
2010-10-13 05:54:13 +00:00
Tobias Grosser
a8677226ab
RegioInfo: Add getExpandedRegion().
...
getExpandedRegion() enables us to create non canonical regions. Those regions
can be used to define the largerst region, that fullfills a certain property.
llvm-svn: 116397
2010-10-13 05:54:11 +00:00
Tobias Grosser
648594c920
RegionInfo: Allow to update exit and entry of a region.
...
llvm-svn: 116396
2010-10-13 05:54:10 +00:00
Tobias Grosser
bf984fd78e
RegionInfo: Enhance addSubregion.
...
llvm-svn: 116395
2010-10-13 05:54:09 +00:00
Tobias Grosser
8352ce5f8d
RegionInfo: Allow to set the parent region of a basic block.
...
llvm-svn: 116394
2010-10-13 05:54:07 +00:00
Tobias Grosser
e910b9d9cd
RegionInfo: Free the RegionNodes in cache.
...
Contributed by: ether
llvm-svn: 116380
2010-10-13 00:07:59 +00:00
Owen Anderson
8ac477ffb5
Begin adding static dependence information to passes, which will allow us to
...
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.
llvm-svn: 116334
2010-10-12 19:48:12 +00:00
Dan Gohman
a8d3a7f93d
Support AA chaining.
...
llvm-svn: 116264
2010-10-11 23:39:34 +00:00
Kenneth Uildriks
b8d7efe785
Now using a variant of the existing inlining heuristics to decide whether to create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization.
...
llvm-svn: 116158
2010-10-09 22:06:36 +00:00
Kenneth Uildriks
99463ca8cf
Start separating out code metrics into code size metrics and code performance metrics. Partial Specialization will apply the former to function specializations, and the latter to all callsites that can use a specialization, in order to decide whether to create a specialization
...
llvm-svn: 116057
2010-10-08 13:57:31 +00:00
Owen Anderson
df7a4f2515
Now with fewer extraneous semicolons!
...
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
98eb3ec6c5
Add an implementation of the initialization routine for IPA.
...
llvm-svn: 115947
2010-10-07 18:31:27 +00:00
Owen Anderson
6875c2ea26
Add initialization routines for Analysis and IPA.
...
llvm-svn: 115946
2010-10-07 18:31:00 +00:00
Owen Anderson
82d38df40c
Fix a warning when building with clang++.
...
llvm-svn: 115924
2010-10-07 17:04:18 +00:00
Owen Anderson
5e19bfcde3
Move the pass initialization helper functions into the llvm namespace, and add
...
a header declaring them all. This is also where we will declare per-library pass-set
initializer functions down the road.
llvm-svn: 115900
2010-10-07 04:13:08 +00:00
Owen Anderson
af08ad4350
Appease the clang self-host buildbot by providing a correct instantiation.
...
llvm-svn: 115857
2010-10-06 22:23:20 +00:00
Owen Anderson
ad8134f03b
Hide analysis group registration behind a macro, just like pass registration.
...
llvm-svn: 115835
2010-10-06 21:02:27 +00:00
Devang Patel
9a33ec24eb
Add support for DW_TAG_unspecified_parameters.
...
llvm-svn: 115833
2010-10-06 20:50:40 +00:00
Dan Gohman
8e4c19ac44
Don't add the operand count to SCEV uniquing data; FoldingSetNodeID
...
already knows its own length, so this is redundant.
llvm-svn: 115521
2010-10-04 17:24:08 +00:00
Devang Patel
bea08d1c85
Let FE mark a variable as artificial variable.
...
llvm-svn: 115102
2010-09-29 23:07:21 +00:00
Devang Patel
95ae73c394
Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
...
This is a backword compatible change.
llvm-svn: 115084
2010-09-29 21:04:46 +00:00
Benjamin Kramer
923a8cf356
Remove PointerTracking from cmakelists …
...
llvm-svn: 115076
2010-09-29 19:39:50 +00:00
Chris Lattner
af995f0ee5
remove PointerTracking from mainline, Edwin is going to move it out to ClamAV
...
for LLVM 2.9
llvm-svn: 115062
2010-09-29 18:43:27 +00:00
Oscar Fuentes
b4b12535e8
Removed a bunch of unnecessary target_link_libraries.
...
llvm-svn: 114999
2010-09-28 22:39:14 +00:00
Devang Patel
7a55481fa4
Provide an interface to let FEs anchor debug info for types.
...
llvm-svn: 114969
2010-09-28 18:08:20 +00:00
Jakob Stoklund Olesen
1083573796
Don't try to constant fold libm functions with non-finite arguments.
...
Usually we wouldn't do this anyway because llvm_fenv_testexcept would return an
exception, but we have seen some cases where neither errno nor fenv detect an
exception on arm-linux.
llvm-svn: 114893
2010-09-27 21:29:20 +00:00
Dan Gohman
2348393cf5
Teach memdep about TBAA tags.
...
llvm-svn: 114588
2010-09-22 21:41:02 +00:00
Benjamin Kramer
4b57204e80
Simplify code.
...
llvm-svn: 114444
2010-09-21 16:41:29 +00:00
Benjamin Kramer
4021d906f1
Make CreateComplexVariable independent of SmallVector.
...
llvm-svn: 114439
2010-09-21 16:00:03 +00:00
Jakob Stoklund Olesen
4a253e5ac8
Don't include <fenv.h> now that we have llvm/System/FEnv.h.
...
llvm-svn: 114219
2010-09-17 21:47:03 +00:00
Dan Gohman
b48f904602
Attempt to support platforms which don't have fenv.h.
...
llvm-svn: 114196
2010-09-17 20:06:27 +00:00
Dan Gohman
18fa17cf3d
Fix the folding of floating-point math library calls, like sin(infinity),
...
so that it detects errors on platforms where libm doesn't set errno.
It's still subject to host libm details though.
llvm-svn: 114148
2010-09-17 01:38:06 +00:00
Dan Gohman
2fa59799d9
Add an #include of raw_ostream.h. Previously, this only compiled
...
because it was using Twine.h's declaration of operator<<(const Twine &).
llvm-svn: 114141
2010-09-17 00:33:43 +00:00
Benjamin Kramer
d61e3833a3
Update CMake build.
...
llvm-svn: 114128
2010-09-16 23:06:18 +00:00
Dan Gohman
f4925061af
Rename a variable to avoid a declaration conflict.
...
llvm-svn: 114126
2010-09-16 22:50:09 +00:00
Dan Gohman
ee74402fe6
Add a pass which prints out all the memdep dependencies.
...
llvm-svn: 114121
2010-09-16 22:08:32 +00:00
Owen Anderson
c33cdcfd80
Revert r114097, adding back in the assertion against replacing an Instruction by itself. Now that CorrelatedValuePropagation is
...
more careful not to call SimplifyInstructionsInBlock() on an unreachable block, the issue has been fixed at a higher level. Add
a big warning to SimplifyInstructionsInBlock() to hopefully prevent this in the future.
llvm-svn: 114117
2010-09-16 20:51:41 +00:00
Owen Anderson
140296f5c0
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.
llvm-svn: 114103
2010-09-16 18:28:33 +00:00
Owen Anderson
94532cb297
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.
llvm-svn: 114097
2010-09-16 17:42:36 +00:00
Eli Friedman
ab3a128582
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
Dan Gohman
e0386dbef1
Convert TBAA to use the new TBAATag field of AliasAnalysis::Location.
...
llvm-svn: 113892
2010-09-14 23:28:12 +00:00
Dan Gohman
41f14cf3e9
Remove the experimental AliasAnalysis::getDependency interface, which
...
isn't a good level of abstraction for memdep. Instead, generalize
AliasAnalysis::alias and related interfaces with a new Location
class for describing a memory location. For now, this is the same
Pointer and Size as before, plus an additional field for a TBAA tag.
Also, introduce a fixed MD_tbaa metadata tag kind.
llvm-svn: 113858
2010-09-14 21:25:10 +00:00
Michael J. Spencer
93c9b2ea93
Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
...
This reverts commit r113632
Conflicts:
cmake/modules/AddLLVM.cmake
llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Benjamin Kramer
8c35fb0739
Teach InstructionSimplify to fold (A & B) & A -> A & B and (A | B) | A -> A | B.
...
Reassociate does this but it doesn't catch all cases (e.g. if the operands are i1).
llvm-svn: 113651
2010-09-10 22:39:55 +00:00
Michael J. Spencer
dc38d36ccb
CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
...
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Owen Anderson
04cf3fd761
What the loop unroller cares about, rather than just not unrolling loops with calls, is
...
not unrolling loops that contain calls that would be better off getting inlined. This mostly
comes up when an interleaved devirtualization pass has devirtualized a call which the inliner
will inline on a future pass. Thus, rather than blocking all loops containing calls, add
a metric for "inline candidate calls" and block loops containing those instead.
llvm-svn: 113535
2010-09-09 20:32:23 +00:00
Dan Gohman
1c5be00ec7
Extend the getDependence query with support for PHI translation.
...
llvm-svn: 113521
2010-09-09 18:37:31 +00:00
Owen Anderson
a08318acb2
Refactor code-size reduction estimation methods out of InlineCostAnalyzer and into CodeMetrics. They
...
don't use any InlineCostAnalyzer state, and are useful for other clients who don't necessarily want to use
all of InlineCostAnalyzer's logic, some of which is fairly inlining-specific.
No intended functionality change.
llvm-svn: 113499
2010-09-09 16:56:42 +00:00
Dan Gohman
64d842ec72
Add a new experimental generalized dependence query interface to
...
AliasAnalysis, and some code for implementing the new query on top of
existing implementations by making standard alias and getModRefInfo
queries.
llvm-svn: 113329
2010-09-08 01:32:20 +00:00
Owen Anderson
a74fa15f32
Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
...
and exposing internal details.
llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Nick Lewycky
ad48e01eef
Add completely hokey binary-and and binary-or operations to ConstantRange and
...
teach LazyValueInfo to use them.
llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Chris Lattner
a58edd1df3
cleanup some of the lifetime/invariant marker stuff, add a big fixme.
...
llvm-svn: 113144
2010-09-06 03:58:04 +00:00
Chris Lattner
e34c835bde
speed up -gvn 3.4% on the testcase in PR7023
...
llvm-svn: 113135
2010-09-06 01:26:29 +00:00
Chris Lattner
da24b9a49a
pull a simple method out of LICM into a new
...
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.
No functionality change.
llvm-svn: 113133
2010-09-06 01:05:37 +00:00
Chris Lattner
72d283c826
fix PR8063, a crash in globalopt in the malloc analysis code.
...
llvm-svn: 113109
2010-09-05 17:20:46 +00:00
Chris Lattner
0963048185
dead method.
...
llvm-svn: 113077
2010-09-04 18:19:16 +00:00
Chris Lattner
65b48b5dfc
zap dead code.
...
llvm-svn: 113073
2010-09-04 18:12:00 +00:00
Dan Gohman
47bec3cb57
Disable the asserts that check that normalization is perfectly
...
invertible. ScalarEvolution's folding routines don't always succeed
in canonicalizing equal expressions to a single canonical form, and
this can cause these asserts to fail, even though there's no actual
correctness problem. This fixes PR8066.
llvm-svn: 113021
2010-09-03 22:12:56 +00:00
Owen Anderson
c725462245
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.
llvm-svn: 112994
2010-09-03 19:08:37 +00:00
Chris Lattner
19199cce55
stop forcing a noop AssemblyAnnotationWriter to silence #uses
...
comments, these don't happen anymore.
llvm-svn: 112901
2010-09-02 23:03:10 +00:00
Owen Anderson
2912df072d
Remove incorrect and poorly tested code for trying to reason about values on default edges of
...
switches. Just return the conservatively correct answer.
llvm-svn: 112876
2010-09-02 22:16:52 +00:00
Owen Anderson
a8c896b704
Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
...
be treated as equivalent.
llvm-svn: 112843
2010-09-02 18:23:58 +00:00
Dan Gohman
110ed64fbb
Revert 112442 and 112440 until the compile time problems introduced
...
by 112440 are resolved.
llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Dan Gohman
47308d5da3
Reapply r112432, now that the real problem is addressed.
...
llvm-svn: 112667
2010-08-31 22:53:17 +00:00
Dan Gohman
f01a5eed1e
Reapply r112433, now that the real problem is addressed.
...
llvm-svn: 112666
2010-08-31 22:52:12 +00:00
Dan Gohman
aabfc52790
Revert r110916. This patch is buggy because the code inside the
...
inner loop doesn't update all the variables in the outer loop.
llvm-svn: 112665
2010-08-31 22:50:31 +00:00
Dan Gohman
90f29bcd90
Revert r112432. It appears to be exposing a problem in the emacs build.
...
llvm-svn: 112638
2010-08-31 20:58:44 +00:00
Dan Gohman
444c24a9f0
Speculatively revert r112433.
...
llvm-svn: 112608
2010-08-31 17:56:47 +00:00
Owen Anderson
9517943d11
It is possible to try to merge a not-constant with a constantrage, when dealing with ptrtoint ConstantExpr's.
...
Unfortunately, the only testcase I have for this is huge and doesn't reduce well because the error is
sensitive to iteration-order issues, since the problem only occurs when merging values in a particular order.
llvm-svn: 112489
2010-08-30 17:03:45 +00:00
Benjamin Kramer
8548c892a8
Don't print two "0x" prefixes. Use a raw_ostream overload instead of llvm::format.
...
llvm-svn: 112479
2010-08-30 14:46:53 +00:00
Chris Lattner
f58382ed87
two changes: 1) make AliasSet hold the list of call sites with an
...
assertingvh so we get a violent explosion if the pointer dangles.
2) Fix AliasSetTracker::deleteValue to remove call sites with
by-pointer comparisons instead of by-alias queries. Using
findAliasSetForCallSite can cause alias sets to get merged
when they shouldn't, and can also miss alias sets when the
call is readonly.
#2 fixes PR6889, which only repros with a .c file :(
llvm-svn: 112452
2010-08-29 18:42:23 +00:00
Dan Gohman
3a08ed7904
Make IVUsers iterative instead of recursive.
...
This has the side effect of reversing the order of most of
IVUser's results.
llvm-svn: 112442
2010-08-29 16:40:03 +00:00
Dan Gohman
d1da5cdfee
Restructure the {A,+,B}<L> * {C,+,D}<L> folding so that it folds
...
all applicable addrecs before recursing on getMulExpr, instead of
recursing on getMulExpr for each one.
llvm-svn: 112433
2010-08-29 15:16:58 +00:00
Dan Gohman
3e6fc18943
Batch up subtracts along with adds, when analyzing long chains of
...
operations.
llvm-svn: 112432
2010-08-29 15:10:06 +00:00
Dan Gohman
7712d2900d
Micro-optimize GroupByComplexity.
...
llvm-svn: 112431
2010-08-29 15:07:13 +00:00
Dan Gohman
0f2de01355
Hold AddRec->getLoop() in a variable, to make the Mul code more consistent
...
with the Add code.
llvm-svn: 112430
2010-08-29 14:55:19 +00:00
Dan Gohman
028c18158a
Rename a variable, for consistency.
...
llvm-svn: 112429
2010-08-29 14:53:34 +00:00
Dan Gohman
28a84d4ba1
Use iterators instead of indices.
...
llvm-svn: 112428
2010-08-29 14:52:02 +00:00
Chris Lattner
dc8070ed6d
when merging two alias sets, the result set is volatile if either
...
of the sets is volatile. We were dropping the volatile bit of the
merged in set, leading (luckily) to assertions in cases like
PR7535. I cannot produce a testcase that repros with opt, but this
is obviously correct.
llvm-svn: 112402
2010-08-29 04:14:47 +00:00
Chris Lattner
eef6b19dcb
more cleanup
...
llvm-svn: 112401
2010-08-29 04:13:43 +00:00
Chris Lattner
afb7074f18
clean this up
...
llvm-svn: 112400
2010-08-29 04:06:55 +00:00
Dan Gohman
fe22f1d3cc
Fix an index calculation thinko.
...
llvm-svn: 112337
2010-08-28 00:39:27 +00:00
Owen Anderson
38f6b7fe3b
Improve the precision of getConstant().
...
llvm-svn: 112323
2010-08-27 23:29:38 +00:00
Dan Gohman
15871f23e3
When merging adjacent operands, scan ahead and merge all equal
...
adjacent operands at once, instead of just two at a time.
llvm-svn: 112299
2010-08-27 21:39:59 +00:00
Dan Gohman
c866bf4fec
Make the {A,+,B}<L> + {C,+,D}<L> --> Other + {A+C,+,B+D}<L>
...
transformation collect all the addrecs with the same loop
add combine them at once rather than starting everything over
at the first chance.
llvm-svn: 112290
2010-08-27 20:45:56 +00:00
Dan Gohman
9bad2fb378
Switch ScalarEvolution's main Value*->SCEV* map from std::map
...
to DenseMap.
llvm-svn: 112281
2010-08-27 18:55:03 +00:00
Owen Anderson
6ebbd92380
Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change.
...
This fixes PR5652.
llvm-svn: 112270
2010-08-27 17:12:29 +00:00
Dan Gohman
2706567c5c
Optimize SCEVComplexityCompare. Use a 3-way return instead of a 2-way
...
return to avoid needing two calls to test for equivalence, and sort
addrecs by their degree before examining their operands.
llvm-svn: 112267
2010-08-27 15:26:01 +00:00
Owen Anderson
4afea9e3c6
In the default address space, any GEP off of null results in a trap value if you try to load it. Thus,
...
any load in the default address space that completes implies that the base value that it GEP'd from
was not null.
llvm-svn: 112015
2010-08-25 01:16:47 +00:00
Owen Anderson
a10000006e
NULL loads are only invalid in the default address space.
...
llvm-svn: 111972
2010-08-24 22:00:55 +00:00
Owen Anderson
b695c83de9
Add support for inferring values for the default cases of switches.
...
llvm-svn: 111971
2010-08-24 21:59:42 +00:00
Owen Anderson
da34de1599
Add support for inferring that a load from a pointer implies that it is not null.
...
llvm-svn: 111959
2010-08-24 20:47:29 +00:00
Owen Anderson
c62f704576
Don't assume that all constants with integer types are ConstantInts.
...
llvm-svn: 111906
2010-08-24 07:55:44 +00:00
Devang Patel
dd719f701d
Let FE use derived types for DW_TAG_friend.
...
Patch by Alexander Herz!
llvm-svn: 111861
2010-08-23 23:16:25 +00:00
Devang Patel
a8652674e0
Handle qualified constants that are directly folded by FE.
...
PR 7920.
llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Owen Anderson
d31d82d75c
Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API.
...
llvm-svn: 111815
2010-08-23 17:52:01 +00:00
Dan Gohman
5fc55dc3cf
CreateTemporaryType doesn't needs its Context argument.
...
llvm-svn: 111687
2010-08-20 22:39:47 +00:00
Dan Gohman
16a5d98c3a
Introduce a new temporary MDNode concept. Temporary MDNodes are
...
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.
llvm-svn: 111681
2010-08-20 22:02:26 +00:00
Dan Gohman
a931605647
Convert DbgInfoPrinter to use errs() instead of outs().
...
llvm-svn: 111659
2010-08-20 18:03:05 +00:00
Dan Gohman
f71c521fb7
Revert r111199; it breaks -debug-pass=Structure output.
...
llvm-svn: 111500
2010-08-19 01:29:07 +00:00
Chris Lattner
3decde9305
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
26403acef7
GetLinearExpression is only called when TD is non-null, pass as
...
a reference instead of pointer.
llvm-svn: 111445
2010-08-18 22:52:09 +00:00
Chris Lattner
1b9c38796e
rework GEP decomposition to make a new VariableGEPIndex struct instead of
...
using a pair. This tidies up the code a bit. While setting things up, add
a (currently unused) field to keep track of how the value is extended.
llvm-svn: 111444
2010-08-18 22:47:56 +00:00
Chris Lattner
9f7500f57b
move gep decomposition out of ValueTracking into BasicAA. The form of
...
decomposition that it is doing is very basicaa specific and is only used
by basicaa.
Now with less tree breakingness.
llvm-svn: 111433
2010-08-18 22:07:29 +00:00
Owen Anderson
80d19f0905
Use ConstantRange to propagate information through value definitions.
...
llvm-svn: 111425
2010-08-18 21:11:37 +00:00
Daniel Dunbar
fbeeb130d8
Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The
...
form of", it doesn't pass tests.
llvm-svn: 111385
2010-08-18 18:43:08 +00:00
Owen Anderson
208636fa33
Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.
...
llvm-svn: 111382
2010-08-18 18:39:01 +00:00
Chris Lattner
54fe883203
move gep decomposition out of ValueTracking into BasicAA. The form of
...
decomposition that it is doing is very basicaa specific and is only used
by basicaa.
llvm-svn: 111375
2010-08-18 18:22:17 +00:00
Chris Lattner
a33edcb56c
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
Dan Gohman
ed2b005842
Tweak IVUsers' concept of "interesting" to exclude add recurrences
...
where the step value is an induction variable from an outer loop, to
avoid trouble trying to re-expand such expressions. This effectively
hides such expressions from indvars and lsr, which prevents them
from getting into trouble.
llvm-svn: 111317
2010-08-17 22:50:37 +00:00
Owen Anderson
fa7d44687f
Fix another iterator invalidation that caused a *really* nasty miscompilation in 403.gcc.
...
llvm-svn: 111210
2010-08-16 23:42:33 +00:00
Dan Gohman
55cd6aadc9
Make dumpPassStructure be a PMDataManager abstraction, rather than
...
a Pass abstraction, since that's the level it's actually used at.
Rename Pass' dumpPassStructure to dumpPass.
This eliminates an awkward use of getAsPass() to convert a PMDataManager*
into a Pass* just to permit a dumpPassStructure call.
llvm-svn: 111199
2010-08-16 22:45:12 +00:00
Dan Gohman
797a1dbb1c
To create a copy of a SmallVector with an element removed from the
...
middle, copy the elements in two groups, rather than copying all the
elements and then doing an erase on the middle of the result. These
are SmallVectors, so we shouldn't expect to hit dynamic allocation
in the common case.
llvm-svn: 111151
2010-08-16 16:57:24 +00:00
Dan Gohman
0d0cc18af5
Tidy whitespace.
...
llvm-svn: 111147
2010-08-16 16:34:09 +00:00
Dan Gohman
c29eeaecec
Add a comment.
...
llvm-svn: 111145
2010-08-16 16:31:39 +00:00
Dan Gohman
7eac4961d7
Use const_iterator in a few places.
...
llvm-svn: 111144
2010-08-16 16:30:01 +00:00
Dan Gohman
74c61503b1
Use iterators instead of indices in a few more places.
...
llvm-svn: 111143
2010-08-16 16:27:53 +00:00
Dan Gohman
f29618236e
Micro-optimize SCEVConstant comparison.
...
llvm-svn: 111142
2010-08-16 16:25:35 +00:00
Dan Gohman
3688ea5c7d
Move SCEVNAryExpr's virtual member functions out of line, and convert
...
them to iterators.
llvm-svn: 111140
2010-08-16 16:21:27 +00:00
Dan Gohman
d6925bbe0d
Use iterators instead of indices in simple cases.
...
llvm-svn: 111138
2010-08-16 16:16:11 +00:00
Dan Gohman
b6c773ec2e
Avoid gratuitous inefficiency in ifndef NDEBUG code.
...
llvm-svn: 111137
2010-08-16 16:13:54 +00:00
Dan Gohman
e5fb1036e6
Make one getAddExpr call when analyzing a+b+c+d+e+... instead of one
...
for each add instruction. Ditto for Mul.
llvm-svn: 111136
2010-08-16 16:03:49 +00:00
Dan Gohman
b094b39111
Delete an unused function.
...
llvm-svn: 111135
2010-08-16 15:57:14 +00:00
Dan Gohman
fb83b043eb
Revert r111058, the lint check for indirectbr successors that aren't
...
address-taken. This can occur normally, if the code which took the
address got DCEd.
llvm-svn: 111121
2010-08-16 14:39:19 +00:00
Argyrios Kyrtzidis
d0fcc9a818
Revert r111082. No warnings for this common pattern.
...
llvm-svn: 111102
2010-08-15 10:27:23 +00:00
Argyrios Kyrtzidis
7c09ddf0ae
Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
...
llvm-svn: 111082
2010-08-14 21:35:10 +00:00
Dan Gohman
21e6dc6aa3
Add a lint check for an indirectbr destination which has not
...
had its address taken.
llvm-svn: 111058
2010-08-13 23:56:28 +00:00
Dan Gohman
0c436ab356
Various optimizations. Don't compare two loops' depths
...
when they are the same loop. Don't compare two instructions'
loop depths when they are in the same block.
llvm-svn: 111045
2010-08-13 21:24:58 +00:00
Dan Gohman
63c020a210
When testing whether one loop contains another, test this directly
...
rather than testing whether the loop contains the other's header.
llvm-svn: 111039
2010-08-13 20:23:25 +00:00
Dan Gohman
3324b9ec67
Add a const.
...
llvm-svn: 111038
2010-08-13 20:17:27 +00:00
Dan Gohman
cf32f2bde1
When creating a symmetric SCEV with a constant operand, put
...
the constant operand on the left, as that's where ScalarEvolution
will end up canonicalizing to.
llvm-svn: 111037
2010-08-13 20:17:14 +00:00
Dan Gohman
ec0120a123
An add recurrence is loop-invariant in any loop inside of its
...
associated loop. This avoids potentially expensive traversals
of the add recurrence's operands.
llvm-svn: 111034
2010-08-13 20:11:39 +00:00
Dan Gohman
2de47777f4
Optimize ScalarEvolution::getAddExpr's operand factoring code by
...
having it finish processing all of the muliply operands before
starting the whole getAddExpr process over again, instead of
immediately after the first simplification.
llvm-svn: 110916
2010-08-12 15:00:23 +00:00
Dan Gohman
157847f5d1
Hoist some loop-invariant code out of a hot loop.
...
llvm-svn: 110915
2010-08-12 14:52:55 +00:00
Dan Gohman
e67b287451
Optimize ScalarEvolution::getAddExpr's duplicate operand detection
...
by having it finish processing the whole operand list before
starting the whole getAddExpr process over again, instead of
immediately after the first duplicate is found.
llvm-svn: 110914
2010-08-12 14:46:54 +00:00
Devang Patel
4d597e8268
Even if a variable has constant value all the time, it is still a variable in gdb's eyes.
...
Tested by scope.exp in gdb testsuite.
llvm-svn: 110876
2010-08-11 23:17:54 +00:00
Owen Anderson
7b974a45db
Fix a subtle use-after-free issue.
...
llvm-svn: 110863
2010-08-11 22:36:04 +00:00
Dan Gohman
a97e78b4ac
Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
...
and remove casts from all its callers.
llvm-svn: 110848
2010-08-11 20:34:43 +00:00
Owen Anderson
0bd61240e9
Improve indentation.
...
llvm-svn: 110778
2010-08-11 04:24:25 +00:00
Dan Gohman
f7495f286a
When analyzing loop exit conditions combined with and and or, don't
...
make any assumptions about when the two conditions will agree on when
to permit the loop to exit. This fixes PR7845.
llvm-svn: 110758
2010-08-11 00:12:36 +00:00
Dan Gohman
e18c2d6f99
Rename and reorder the arguments to isImpliedCond, for consistency and clarity.
...
llvm-svn: 110750
2010-08-10 23:46:30 +00:00
Owen Anderson
5f1dd0967d
Now that we're using ConstantRange to represent potential values, make use of that represenation to
...
create constraints from comparisons other than eq/neq.
llvm-svn: 110742
2010-08-10 23:20:01 +00:00
Devang Patel
3e4d04230b
Add missing argument. CreateCompositeTypeEx() users, please verify.
...
llvm-svn: 110717
2010-08-10 20:22:49 +00:00
Owen Anderson
185fe00633
Switch over to using ConstantRange to track integral values.
...
llvm-svn: 110714
2010-08-10 20:03:09 +00:00
Devang Patel
8e06a5eb47
Do not forget debug info for enums. Use named mdnode to keep track of these types.
...
llvm-svn: 110712
2010-08-10 20:01:20 +00:00
Tobias Grosser
7fbe6cb429
RegionInfo: Do not assert if a BB is not part of the dominance tree.
...
llvm-svn: 110665
2010-08-10 09:54:35 +00:00
Devang Patel
b219746c80
Handle TAG_constant for integers.
...
llvm-svn: 110656
2010-08-10 07:11:13 +00:00