Duncan Sands
bb2cd025a9
Constant folding here is pointless, because InstructionSimplify
...
(which does constant folding and more) is called a few lines
later.
llvm-svn: 120042
2010-11-23 20:24:21 +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
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
Owen Anderson
a4fefc1949
Passes do not need to recursively initialize passes that they preserve, if
...
they do not also require them. This allows us to reduce inter-pass linkage
dependencies.
llvm-svn: 116854
2010-10-19 20:08:44 +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
Rafael Espindola
229e38f0fe
Be more consistent in using ValueToValueMapTy.
...
llvm-svn: 116387
2010-10-13 01:36:30 +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
Owen Anderson
df7a4f2515
Now with fewer extraneous semicolons!
...
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Dan Gohman
0ad7d9c24e
Fix loop unswitching's assumption that a code path which either
...
infinite loops or exits will eventually exit. This fixes PR5373.
llvm-svn: 112745
2010-09-01 21:46:45 +00:00
Chris Lattner
bc1a65ac6c
apparently unswitch had the same "Feature". Stop its
...
claims that it preserves domfrontier if it doesn't really.
llvm-svn: 112445
2010-08-29 17:23:19 +00:00
Owen Anderson
a7aed18624
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
bda59bd247
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
755aceb5d0
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Owen Anderson
a57b97e7e7
Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
...
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Devang Patel
0dc3c2d37e
Use ValueMap instead of DenseMap.
...
The ValueMapper used by various cloning utility maps MDNodes also.
llvm-svn: 106706
2010-06-24 00:33:28 +00:00
Kenneth Uildriks
9b21208bfb
Pulled CodeMetrics out of InlineCost.h and made it a bit more general, so it can be reused from PartialSpecializationCost
...
llvm-svn: 105725
2010-06-09 15:11:37 +00:00
Chris Lattner
66e809acc0
remove a bunch of ad-hoc code to simplify instructions from
...
loop unswitch, and use inst simplify instead. It is more
powerful and less duplication.
llvm-svn: 101874
2010-04-20 05:33:18 +00:00
Chris Lattner
5814d9d9da
RewriteLoopBodyWithConditionConstant can end up rewriting the
...
condition we're unswitching on. In this case, don't try to
simplify the second copy of the loop which may be dead or not,
but is probably a constant now. This fixes PR6879
llvm-svn: 101870
2010-04-20 05:09:16 +00:00
Chris Lattner
c832c1bf69
some code cleanups, use SwitchInst::findCaseValue, reduce indentation
...
llvm-svn: 100468
2010-04-05 21:18:32 +00:00
Evan Cheng
ba930449a9
Code clean up.
...
llvm-svn: 100467
2010-04-05 21:16:25 +00:00
Evan Cheng
ed66db3f9b
Code refactoring.
...
llvm-svn: 100262
2010-04-03 02:23:43 +00:00
Dan Gohman
2734ebd37f
Add a DominatorTree argument to isLCSSA so that it doesn't have to
...
compute a set of reachable blocks for itself each time it is called, which
is fairly frequently.
llvm-svn: 98179
2010-03-10 19:38:49 +00:00
Duncan Sands
19d0b47b1f
There are two ways of checking for a given type, for example isa<PointerType>(T)
...
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.
llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Duncan Sands
9dff9bec31
Uniformize the names of type predicates: rather than having isFloatTy and
...
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner
302240d73e
fix a crash in loop unswitch on a loop invariant vector condition.
...
llvm-svn: 95055
2010-02-02 02:26:54 +00:00
Benjamin Kramer
a81a6dff0d
Convert a ton of simple integer type equality tests to the new predicate.
...
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
David Greene
d9c355d590
Change errs() to dbgs().
...
llvm-svn: 92608
2010-01-05 01:27:04 +00:00
Dan Gohman
18fa5686f6
Add Loop contains utility methods for testing whether a loop
...
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.
llvm-svn: 91654
2009-12-18 01:24:09 +00:00
Dan Gohman
72c367fb52
Dereference loopHeader after checking for null rather than before.
...
llvm-svn: 90990
2009-12-09 22:55:01 +00:00
Edward O'Callaghan
2b8fed15e0
Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.
...
llvm-svn: 89844
2009-11-25 05:38:41 +00:00
Edward O'Callaghan
5fd452d596
Fix for PR5373, Credit to Jakub Staszak.
...
llvm-svn: 89758
2009-11-24 11:51:52 +00:00
Chris Lattner
46b5c642b9
remove a bunch of extraneous LLVMContext arguments
...
from various APIs, addressing PR5325.
llvm-svn: 86231
2009-11-06 04:27:31 +00:00
Dan Gohman
a83ac2d9e7
Update various Loop optimization passes to cope with the possibility that
...
LoopSimplify form may not be available.
llvm-svn: 86175
2009-11-05 21:11:53 +00:00
Chris Lattner
7a8db3a41a
if CostMetrics says to never duplicate some code, don't unswitch a loop.
...
This prevents unswitching from duplicating indbr's.
llvm-svn: 85705
2009-11-01 03:42:55 +00:00
Dan Gohman
b6b8ec769c
Restore LoopUnswitch's block-oriented threshold. LoopUnswitch now checks both
...
the estimated code size and the number of blocks when deciding whether to
do a non-trivial unswitch. This protects it from some very undesirable
worst-case behavior on large numbers of loop-unswitchable conditions, such
as in the testcase in PR5259.
llvm-svn: 84661
2009-10-20 20:06:09 +00:00
Devang Patel
92f8619923
Use isVoidTy()
...
llvm-svn: 84118
2009-10-14 17:29:00 +00:00
Devang Patel
a677136900
Check void type before using RAUWd.
...
llvm-svn: 84049
2009-10-13 22:56:32 +00:00
Devang Patel
115741ba79
Do not check use_empty() before replaceAllUsesWith(). This gives ValueHandles a chance to get properly updated.
...
llvm-svn: 84033
2009-10-13 21:41:20 +00:00
Dan Gohman
2dc6f8de03
Use the new CodeMetrics class to compute code size instead of
...
manually counting instructions.
llvm-svn: 84016
2009-10-13 20:12:23 +00:00
Dan Gohman
71ca652475
Make LoopUnswitch's cost estimation count Instructions, rather than
...
BasicBlocks, so that it doesn't blindly procede in the presence of
large individual BasicBlocks. This addresses a class of code-size
expansion problems.
llvm-svn: 83992
2009-10-13 17:50:43 +00:00
Mike Stump
deaf572ca8
Reflow comment.
...
llvm-svn: 81361
2009-09-09 17:57:16 +00:00
Dan Gohman
c56af25c01
Fix an 80-column violation.
...
llvm-svn: 81354
2009-09-09 17:17:19 +00:00
Dan Gohman
3ddbc242fb
Re-apply r80926, with fixes: keep the domtree informed of new blocks
...
that get created during loop unswitching, and fix SplitBlockPredecessors'
LCSSA updating code to create new PHIs instead of trying to just move
existing ones.
Also, optimize Loop::verifyLoop, since it gets called a lot. Use
searches on a sorted list of blocks instead of calling the "contains"
function, as is done in other places in the Loop class, since "contains"
does a linear search. Also, don't call verifyLoop from LoopSimplify or
LCSSA, as the PassManager is already calling verifyLoop as part of
LoopInfo's verifyAnalysis.
llvm-svn: 81221
2009-09-08 15:45:00 +00:00
Evan Cheng
904199547b
Revert r80926. It causes loop unswitch assertion and slow down some JIT tests significantly.
...
llvm-svn: 81101
2009-09-06 02:26:10 +00:00
Dan Gohman
4c1bdcf5d7
Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verify
...
that these passes are properly preserved.
Fix several transformation passes that claimed to preserve LoopSimplify
form but weren't.
llvm-svn: 80926
2009-09-03 16:31:42 +00:00
Chris Lattner
2dd09dbdf7
eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
...
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Chris Lattner
b25de3ff60
eliminate the "Value" printing methods that print to a std::ostream.
...
This required converting a bunch of stuff off DOUT and other cleanups.
llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Owen Anderson
55f1c09e31
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson
23a204d91b
Move getTrue() and getFalse() to 2.5-like APIs.
...
llvm-svn: 77685
2009-07-31 17:39:07 +00:00
Owen Anderson
b292b8ce70
Move more code back to 2.5 APIs.
...
llvm-svn: 77635
2009-07-30 23:03:37 +00:00