Chris Lattner
57c67b06e9
Two changes:
...
#1 is to unconditionally strip constantpointerrefs out of
instruction operands where they are absolutely pointless and inhibit
optimization. GRRR!
#2 is to implement InstCombine/getelementptr_const.ll
llvm-svn: 12519
2004-03-25 22:59:29 +00:00
Chris Lattner
abb77c9959
Teach the optimizer to delete zero sized alloca's (but not mallocs!)
...
llvm-svn: 12507
2004-03-19 06:08:10 +00:00
Chris Lattner
684fa5ac64
Be more accurate
...
llvm-svn: 12464
2004-03-17 01:59:27 +00:00
Chris Lattner
a3783a577e
Fix bug in previous checkin
...
llvm-svn: 12458
2004-03-16 23:36:49 +00:00
Chris Lattner
95057f6ad1
Okay, so there is no reasonable way for tail duplication to update SSA form,
...
as it is making effectively arbitrary modifications to the CFG and we don't
have a domset/domfrontier implementations that can handle the dynamic updates.
Instead of having a bunch of code that doesn't actually work in practice,
just demote any potentially tricky values to the stack (causing the problem
to go away entirely). Later invocations of mem2reg will rebuild SSA for us.
This fixes all of the major performance regressions with tail duplication
from LLVM 1.1. For example, this loop:
---
int popcount(int x) {
int result = 0;
while (x != 0) {
result = result + (x & 0x1);
x = x >> 1;
}
return result;
}
---
Used to be compiled into:
int %popcount(int %X) {
entry:
br label %loopentry
loopentry: ; preds = %entry, %no_exit
%x.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ] ; <int> [#uses=3]
%result.1.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ] ; <int> [#uses=2]
%tmp.1 = seteq int %x.0, 0 ; <bool> [#uses=1]
br bool %tmp.1, label %loopexit, label %no_exit
no_exit: ; preds = %loopentry
%tmp.4 = and int %x.0, 1 ; <int> [#uses=1]
%tmp.6 = add int %tmp.4, %result.1.0 ; <int> [#uses=1]
%tmp.9 = shr int %x.0, ubyte 1 ; <int> [#uses=1]
br label %loopentry
loopexit: ; preds = %loopentry
ret int %result.1.0
}
And is now compiled into:
int %popcount(int %X) {
entry:
br label %no_exit
no_exit: ; preds = %entry, %no_exit
%x.0.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ] ; <int> [#uses=2]
%result.1.0.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ] ; <int> [#uses=1]
%tmp.4 = and int %x.0.0, 1 ; <int> [#uses=1]
%tmp.6 = add int %tmp.4, %result.1.0.0 ; <int> [#uses=2]
%tmp.9 = shr int %x.0.0, ubyte 1 ; <int> [#uses=2]
%tmp.1 = seteq int %tmp.9, 0 ; <bool> [#uses=1]
br bool %tmp.1, label %loopexit, label %no_exit
loopexit: ; preds = %no_exit
ret int %tmp.6
}
llvm-svn: 12457
2004-03-16 23:29:09 +00:00
Chris Lattner
7a7b114871
Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCP
...
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).
llvm-svn: 12442
2004-03-16 19:49:59 +00:00
Chris Lattner
a64923ad26
Do not copy gigantic switch instructions
...
llvm-svn: 12441
2004-03-16 19:45:22 +00:00
Chris Lattner
db5b8f4d6b
Fix a regression from this patch:
...
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040308/013095.html
Basically, this patch only updated the immediate dominatees of the header node
to tell them that the preheader also dominated them. In practice, ALL
dominatees of the header node are also dominated by the preheader.
This fixes: LoopSimplify/2004-03-15-IncorrectDomUpdate.
and PR293
llvm-svn: 12434
2004-03-16 06:00:15 +00:00
Chris Lattner
cd83282df1
Add counters for the number of calls elimianted
...
llvm-svn: 12420
2004-03-15 05:46:59 +00:00
Chris Lattner
20cda2645e
Implement LICM of calls in simple cases. This is sufficient to move around
...
sin/cos/strlen calls and stuff. This implements:
LICM/call_sink_pure_function.ll
LICM/call_sink_const_function.ll
llvm-svn: 12415
2004-03-15 04:11:30 +00:00
Chris Lattner
b68659552a
Do not create empty basic blocks when the lowerswitch pass expects blocks to
...
be non-empty! This fixes LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
llvm-svn: 12384
2004-03-14 04:14:31 +00:00
Chris Lattner
d078812f96
If a block is dead, dominators will not be calculated for it. Because of this
...
loop information won't see it, and we could have unreachable blocks pointing to
the non-header node of blocks in a natural loop. This isn't tidy, so have the
loopsimplify pass clean it up.
llvm-svn: 12380
2004-03-14 03:59:22 +00:00
Chris Lattner
7d2a539735
Add some debugging output
...
Fix InstCombine/2004-03-13-InstCombineInfLoop.ll which caused an infinite
loop compiling (I think) povray.
llvm-svn: 12365
2004-03-13 23:54:27 +00:00
Chris Lattner
797cb2f6c1
This little patch speeds up the loop used to update the dominator set analysis.
...
On the testcase from GCC PR12440, which has a LOT of loops (1392 of which require
preheaders to be inserted), this speeds up the loopsimplify pass from 1.931s to
0.1875s. The loop in question goes from 1.65s -> 0.0097s, which isn't bad. All of
these times are a debug build.
This adds a dependency on DominatorTree analysis that was not there before, but
we always had dominatortree available anyway, because LICM requires both loop
simplify and DT, so this doesn't add any extra analysis in practice.
llvm-svn: 12362
2004-03-13 22:01:26 +00:00
Chris Lattner
022167f13b
Implement sub.ll:test14
...
llvm-svn: 12355
2004-03-13 00:11:49 +00:00
Chris Lattner
92295c5031
Implement InstCombine/sub.ll:test12 & test13
...
llvm-svn: 12353
2004-03-12 23:53:13 +00:00
Chris Lattner
59db22dcd4
Add sccp support for select instructions
...
llvm-svn: 12318
2004-03-12 05:52:44 +00:00
Chris Lattner
b909e8b0d4
Add trivial optimizations for select instructions
...
llvm-svn: 12317
2004-03-12 05:52:32 +00:00
Chris Lattner
538fee7aa2
Since 'load null' is undefined, we can make it do whatever we want. Returning
...
a zero value is the most likely way to cause further simplification, so we do it.
llvm-svn: 12197
2004-03-07 22:16:24 +00:00
Chris Lattner
7abcc387de
Don't emit things like malloc(16*1). Allocation instructions are fixed arity now.
...
llvm-svn: 12086
2004-03-03 01:40:53 +00:00
Chris Lattner
5cf39339d1
Disable tail duplication in a case that breaks on Olden/tsp
...
llvm-svn: 12021
2004-03-01 01:12:13 +00:00
Chris Lattner
bf2963ef91
Fix PR255: [tailduplication] Single basic block loops are very rare
...
Note that this is a band-aid put over a band-aid. This just undisables
tail duplication in on very specific case that it seems to work in.
llvm-svn: 11989
2004-02-29 06:41:20 +00:00
Chris Lattner
772eafa332
if there is already a prototype for malloc/free, use it, even if it's incorrect.
...
Do not just inject a new prototype.
llvm-svn: 11951
2004-02-28 18:51:45 +00:00
Chris Lattner
51ea127bf3
Rename AddUsesToWorkList -> AddUsersToWorkList, as that is what it does.
...
Create a new AddUsesToWorkList method
optimize memmove/set/cpy of zero bytes to a noop.
llvm-svn: 11941
2004-02-28 05:22:00 +00:00
Chris Lattner
f3a366062c
Turn 'free null' into nothing
...
llvm-svn: 11940
2004-02-28 04:57:37 +00:00
Chris Lattner
4f7accab96
Implement test/Regression/Transforms/InstCombine/canonicalize_branch.ll
...
This is a really minor thing, but might help out the 'switch statement induction'
code in simplifycfg.
llvm-svn: 11900
2004-02-27 06:27:46 +00:00
Chris Lattner
9c6833c5ca
Fix incorrect debug code
...
llvm-svn: 11821
2004-02-25 15:15:04 +00:00
Chris Lattner
8ee0593f0d
Fix a faulty optimization on FP values
...
llvm-svn: 11801
2004-02-24 18:10:14 +00:00
Chris Lattner
ae739aefd7
Generate much more efficient code in programs like pifft
...
llvm-svn: 11775
2004-02-23 21:46:58 +00:00
Chris Lattner
c40b9d7d51
Fix a small typeo in my checkin last night that broke vortex and other programs :(
...
llvm-svn: 11774
2004-02-23 21:46:42 +00:00
Chris Lattner
f5ce254692
Fix InstCombine/2004-02-23-ShiftShiftOverflow.ll
...
Also, turn 'shr int %X, 1234' into 'shr int %X, 31'
llvm-svn: 11768
2004-02-23 20:30:06 +00:00
Chris Lattner
2b55ea38bc
Implement cast.ll::test14/15
...
llvm-svn: 11742
2004-02-23 07:16:20 +00:00
Chris Lattner
e79e854c5c
Refactor some code. In the mul - setcc folding case, we really care about
...
whether this is the sign bit or not, so check unsigned comparisons as well.
llvm-svn: 11740
2004-02-23 06:38:22 +00:00
Chris Lattner
c8a10c4b6a
Implement mul.ll:test11
...
llvm-svn: 11737
2004-02-23 06:00:11 +00:00
Chris Lattner
59611149ee
Implement "strength reduction" of X <= C and X >= C
...
llvm-svn: 11735
2004-02-23 05:47:48 +00:00
Chris Lattner
2635b52d4e
Implement InstCombine/mul.ll:test10, which is a case that occurs when dealing
...
with "predication"
llvm-svn: 11734
2004-02-23 05:39:21 +00:00
Chris Lattner
8d0bacbb9e
Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in a
...
hot 164.gzip loop.
llvm-svn: 11702
2004-02-22 05:25:17 +00:00
Chris Lattner
4db2d22bea
Fold PHI nodes of constants which are only used by a single cast. This implements
...
phi.ll:test4
llvm-svn: 11494
2004-02-16 05:07:08 +00:00
Chris Lattner
b36d908f7b
Teach LLVM to unravel the "swap idiom". This implements:
...
Regression/Transforms/InstCombine/xor.ll:test20
llvm-svn: 11492
2004-02-16 03:54:20 +00:00
Chris Lattner
c207635fd5
Implement Transforms/InstCombine/xor.ll:test19
...
llvm-svn: 11490
2004-02-16 01:20:27 +00:00
Chris Lattner
d85e061575
Instead of producing calls to setjmp/longjmp, produce uses of the
...
llvm.setjmp/llvm.longjmp intrinsics.
llvm-svn: 11482
2004-02-15 22:24:27 +00:00
Chris Lattner
76b2ff4ded
Adjustments to support the new ConstantAggregateZero class
...
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Chris Lattner
7cbb22abe6
Expose a pass ID that can be 'required'
...
llvm-svn: 11376
2004-02-13 16:16:16 +00:00
Chris Lattner
d4b36cf9bc
Remove obsolete comment. Unreachable blocks will automatically be left at the
...
end of the function.
llvm-svn: 11313
2004-02-11 05:20:50 +00:00
Chris Lattner
5add05129e
Add an _embarassingly simple_ implementation of basic block layout. This is
...
more of a testcase for profiling information than anything that should reasonably
be used, but it's a starting point. When I have more time I will whip this into
better shape.
llvm-svn: 11311
2004-02-11 04:53:20 +00:00
Chris Lattner
37d46f4815
Only add the global variable with the abort message if an unwind actually
...
occurs in the program.
llvm-svn: 11249
2004-02-09 22:48:47 +00:00
Misha Brukman
3480e935d0
Fix grammar-o.
...
llvm-svn: 11210
2004-02-08 22:27:33 +00:00
Chris Lattner
3b7f6b2217
Improve compatibility with programs that already have a prototype for 'write',
...
even if it is wierd in some way.
llvm-svn: 11207
2004-02-08 22:14:44 +00:00
Chris Lattner
fae8ab3088
rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
...
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
108cadc274
Implement proper invoke/unwind lowering.
...
This fixed PR16 "[lowerinvoke] The -lowerinvoke pass does not insert calls to setjmp/longjmp"
llvm-svn: 11195
2004-02-08 19:53:56 +00:00
Chris Lattner
476488e669
Add a call to 'write' right before the call to abort() in the unwind path.
...
This causes the JIT, or LLC'd program to print out a nice message, explaining
WHY the program aborted.
llvm-svn: 11184
2004-02-08 07:30:29 +00:00
Chris Lattner
2dd1c8d8ce
Fix another dominator update bug. These bugs keep getting exposed because GCSE
...
keeps finding more code motion opportunities now that the dominators are correct!
llvm-svn: 11142
2004-02-05 23:20:59 +00:00
Chris Lattner
c0c953f0bc
Fix bug updating dominators
...
llvm-svn: 11140
2004-02-05 22:33:26 +00:00
Chris Lattner
f978c421e5
Add debug output
...
llvm-svn: 11139
2004-02-05 22:33:19 +00:00
Chris Lattner
14ab84a483
Fix PR223: Loopsimplify incorrectly updates dominator information
...
The problem is that the dominator update code didn't "realize" that it's
possible for the newly inserted basic block to dominate anything. Because
it IS possible, stuff was getting updated wrong.
llvm-svn: 11137
2004-02-05 21:12:24 +00:00
Chris Lattner
8d414ad035
Adjust to the new BasicBlock ctor, which requires a function parameter
...
llvm-svn: 11114
2004-02-04 03:58:28 +00:00
Chris Lattner
c2f0aa58df
Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.
...
llvm-svn: 11083
2004-02-02 20:09:56 +00:00
Chris Lattner
cacd30b957
Update comment
...
llvm-svn: 11082
2004-02-02 20:09:22 +00:00
Chris Lattner
ed9b12c31a
Disable tail duplication in any "hard" cases, where it might break SSA form.
...
llvm-svn: 11052
2004-02-01 06:32:28 +00:00
Chris Lattner
7c91a6176c
Fix the count of the number of instructions removed
...
llvm-svn: 11049
2004-02-01 05:15:07 +00:00
Misha Brukman
bf43787f33
Hyphenate `target-dependent'
...
llvm-svn: 11003
2004-01-28 20:43:01 +00:00
Chris Lattner
1f7942fe7d
Fix InstCombine/2004-01-13-InstCombineInvokePHI.ll, which also fixes lots
...
of C++ programs in Shootout-C++, including lists1 and moments, etc
llvm-svn: 10845
2004-01-14 06:06:08 +00:00
Chris Lattner
fcf21a75b0
Fix bug in previous checkin
...
llvm-svn: 10798
2004-01-12 19:47:05 +00:00
Chris Lattner
c1e7cc0fbe
Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces
...
llvm-svn: 10796
2004-01-12 19:35:11 +00:00
Chris Lattner
d7ccc9e5a5
Add header file I accidentally removed in teh shuffle
...
llvm-svn: 10795
2004-01-12 19:15:20 +00:00
Chris Lattner
c9fb4a3b89
Remove use of the ConstantHandling interfaces
...
llvm-svn: 10793
2004-01-12 19:12:50 +00:00
Chris Lattner
1b7d4d7b63
Don't use ConstantExpr::getShift anymore
...
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner
118a76cb2f
Remove unneeded #include
...
llvm-svn: 10788
2004-01-12 18:33:54 +00:00
Chris Lattner
0fe5b32c01
Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
...
llvm-svn: 10779
2004-01-12 17:43:40 +00:00
Chris Lattner
fe992d4332
Fix fairly severe bug in my last checking where we treated all unfoldable
...
constants as being "true" when evaluating branches. This was introduced
because we now create constantexprs for the constants instead of failing the
fold.
llvm-svn: 10778
2004-01-12 17:40:36 +00:00
Chris Lattner
49f74522ec
* Implement minor performance optimization for the getelementptr case
...
* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
This allows us to fold expressions like "foo"[2], even if the pointer is only
a conditional constant.
llvm-svn: 10767
2004-01-12 04:29:41 +00:00
Chris Lattner
7e8af38637
Do not hack on volatile loads. I'm not sure what the point of a volatile load
...
from constant memory is, but lets not take chances.
llvm-svn: 10765
2004-01-12 04:13:56 +00:00
Chris Lattner
05fe6847a8
Implement SCCP/phitest.ll
...
llvm-svn: 10763
2004-01-12 03:57:30 +00:00
Chris Lattner
3bcecb92f3
Update obsolete comments
...
Fix iterator invalidation problems which was causing -mstrip to miss some
entries, and read free'd memory. This shrinks the symbol table of 254.gap
from 333 to 284 bytes! :)
llvm-svn: 10751
2004-01-10 21:36:49 +00:00
Chris Lattner
49525f8cf4
Finegrainify namespacification
...
llvm-svn: 10725
2004-01-09 06:02:20 +00:00
Chris Lattner
59d2d7fc33
Improve encapsulation in the Loop and LoopInfo classes by eliminating the
...
getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.
llvm-svn: 10714
2004-01-08 00:09:44 +00:00
Chris Lattner
7e755e443f
More minor non-functional changes. This now computes the exit condition, though
...
it doesn't do anything with it.
llvm-svn: 10590
2003-12-23 07:47:09 +00:00
Chris Lattner
a02d5aa6ce
Don't mind me, I'm just refactoring away. This patch makes room for LFTR, but
...
contains no functionality changes.
llvm-svn: 10583
2003-12-22 09:53:29 +00:00
Chris Lattner
6449dcefbc
Implement IndVarsSimplify/pointer-indvars.ll, transforming pointer
...
arithmetic into "array subscripts"
llvm-svn: 10580
2003-12-22 05:02:01 +00:00
Chris Lattner
d3678bc7c5
Fix PR194
...
llvm-svn: 10573
2003-12-22 03:58:44 +00:00
Chris Lattner
fc7bdac1b3
Fix ADCE/2003-12-19-MergeReturn.llx
...
llvm-svn: 10539
2003-12-19 09:08:34 +00:00
Chris Lattner
918460190f
Remove the wierd "Operands" loop, by traversing basicblocks in reverse order
...
llvm-svn: 10536
2003-12-19 08:18:16 +00:00
Chris Lattner
547192d688
Implement LICM/sink_multiple.ll, by sinking all possible instructions in the
...
loop before hoisting any.
llvm-svn: 10534
2003-12-19 07:22:45 +00:00
Chris Lattner
031a3f8cc7
Generalize a special case to fix PR187
...
llvm-svn: 10531
2003-12-19 06:27:08 +00:00
Chris Lattner
91daeb5431
Factor code out into the Utils library
...
llvm-svn: 10530
2003-12-19 05:58:40 +00:00
John Criswell
b22e9b4b35
Reverted back to previous revision - this was previously merged
...
according to the CVS log messages.
llvm-svn: 10517
2003-12-18 17:19:19 +00:00
John Criswell
86a3a48697
Merged in RELEASE_11.
...
llvm-svn: 10516
2003-12-18 16:43:17 +00:00
Chris Lattner
9e2b42a0c8
When we delete instructions from the loop, make sure to remove them from the
...
AliasSetTracker as well.
llvm-svn: 10507
2003-12-18 08:12:32 +00:00
Chris Lattner
6c08bb8b8e
Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx
...
llvm-svn: 10473
2003-12-15 17:34:02 +00:00
Chris Lattner
884e824534
Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
...
llvm-svn: 10467
2003-12-14 23:57:39 +00:00
Chris Lattner
d1c371c32c
Do not promote volatile alias sets into registers
...
llvm-svn: 10458
2003-12-14 04:52:31 +00:00
Chris Lattner
34399dda2d
Fix LICM/2003-12-11-SinkingToPHI.ll, and quite possibly all of the other known problems in the universe.
...
llvm-svn: 10409
2003-12-11 22:23:32 +00:00
Chris Lattner
6281fd3ead
Fix bug: LICM/sink_multiple_exits.ll
...
Thanks for pointing this out John :)
llvm-svn: 10387
2003-12-10 22:35:56 +00:00
Chris Lattner
55c2113b7b
Don't allow dead instructions to stop sinking early.
...
llvm-svn: 10386
2003-12-10 20:43:29 +00:00
Chris Lattner
713907e2b8
Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx
...
llvm-svn: 10385
2003-12-10 20:43:04 +00:00
Chris Lattner
7e5bd59da2
Finegrainify namespacification
...
Fix bug: LowerInvoke/2003-12-10-Crash.llx
llvm-svn: 10382
2003-12-10 20:22:42 +00:00
Chris Lattner
ccd9f3c1f8
Finegrainify namespacification
...
Reorder #includes
Implement: IndVarsSimplify/2003-12-10-IndVarDeadCode.ll
llvm-svn: 10376
2003-12-10 18:06:47 +00:00
Chris Lattner
7710f2f49e
Finegrainify namespacification
...
Fix bug: LoopSimplify/2003-12-10-ExitBlocksProblem.ll
llvm-svn: 10373
2003-12-10 17:20:35 +00:00
Chris Lattner
6364314a6e
Simplify code
...
llvm-svn: 10371
2003-12-10 16:58:24 +00:00
Chris Lattner
48b4b852b4
Avoid performing two identical lookups when one will suffice
...
llvm-svn: 10370
2003-12-10 16:57:24 +00:00
Chris Lattner
edda1af35a
Make LICM itself a bit more efficient, and make the generated code more efficient too: don't insert a store in every exit block, because a particular block may be exited to more than once by a loop
...
llvm-svn: 10369
2003-12-10 15:56:24 +00:00
Chris Lattner
aaaea51090
Implement instruction sinking out of loops. This still can do a little bit
...
better job, but this is the majority of the work. This implements
LICM/sink*.ll
llvm-svn: 10358
2003-12-10 06:41:05 +00:00
Chris Lattner
6c237bcdf2
Do not insert one entry PHI nodes in split exit blocks!
...
llvm-svn: 10348
2003-12-09 23:12:55 +00:00
Chris Lattner
65c1193d55
Refactor code a little bit, eliminating the gratuitous InstVisitor, which
...
should make subsequent changes simpler. This also allows us to hoist vaarg
and vanext instructions
llvm-svn: 10342
2003-12-09 19:32:44 +00:00
Chris Lattner
c05176843e
Fine grainify namespacification
...
Code cleanups
Make LICM::SafeToHoist marginally more efficient
llvm-svn: 10341
2003-12-09 17:18:00 +00:00
Chris Lattner
50663a1a78
Implement: TailCallElim/accum_recursion_constant_arg.ll
...
Also make sure to clean up any PHI nodes that are inserted which are pointless.
llvm-svn: 10333
2003-12-08 23:37:35 +00:00
Chris Lattner
198e620752
Implement: test/Regression/Transforms/TailCallElim/accum_recursion.ll
...
We now insert accumulator variables as necessary to eliminate tail recursion
more aggressively. This is still fairly limited, but allows us to transform
fib/factorial, and other functions into nice happy loops. :)
llvm-svn: 10332
2003-12-08 23:19:26 +00:00
Chris Lattner
a7b6f3ab9c
Cleanup and restructure the code to make it easier to read and maintain.
...
The only functionality change is that we now implement:
Regression/Transforms/TailCallElim/intervening-inst.ll
Which is really kinda pointless, because it means that trivially dead code
does not interfere with -tce, but trivially dead code probably wouldn't be
around anytime when this pass is run anyway.
The point of including this change it to support other more aggressive
transformations when we have the analysis capabilities to do so.
llvm-svn: 10312
2003-12-08 05:34:54 +00:00
Chris Lattner
8427bffb9a
* Finegrainify namespacification
...
* Transform: free <ty>* (cast <ty2>* X to <ty>*) into free <ty2>* X
llvm-svn: 10303
2003-12-07 01:24:23 +00:00
Chris Lattner
40d2aeb28f
Finegrainify namespacification
...
Fix regressions ScalarRepl/basictest.ll & arraytest.ll
llvm-svn: 10287
2003-12-02 17:43:55 +00:00
Chris Lattner
52310702a1
Do not use index type to determine what it is indexing into!
...
llvm-svn: 10226
2003-11-25 21:09:18 +00:00
Chris Lattner
4cc2cc5c58
Do not crash when deleing a region with a dead invoke instruction
...
llvm-svn: 10161
2003-11-22 02:13:08 +00:00
Chris Lattner
1ad805977d
Finegrainify namespacification
...
The module stripping pass should not strip symbols on external globals
llvm-svn: 10157
2003-11-22 01:29:35 +00:00
Chris Lattner
a29600046d
Minor cleanups and simplifications
...
llvm-svn: 10127
2003-11-21 16:52:05 +00:00
Chris Lattner
2af517281d
Start using the nicer terminator auto-insertion API
...
llvm-svn: 10111
2003-11-20 18:25:24 +00:00
Chris Lattner
841dd53555
Fix PR116
...
llvm-svn: 10032
2003-11-16 21:39:27 +00:00
Chris Lattner
d76fe4ea7d
Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll
...
llvm-svn: 9981
2003-11-13 19:17:02 +00:00
Brian Gaeke
960707c335
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
4474336166
Adjust to new critical edge interface
...
llvm-svn: 9853
2003-11-10 04:10:50 +00:00
Misha Brukman
ad03afcb34
Declare FunctionPasses as such so that they can be used in FunctionPassManager.
...
llvm-svn: 9768
2003-11-07 17:20:18 +00:00
Chris Lattner
7c94d1171a
Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.
...
llvm-svn: 9731
2003-11-05 17:31:36 +00:00
Chris Lattner
8f2f598024
Fix bug with previous implementation:
...
- // ~(c-X) == X-(c-1) == X+(-c+1)
+ // ~(c-X) == X-c-1 == X+(-c-1)
Implement: C - ~X == X + (1+C)
llvm-svn: 9715
2003-11-05 01:06:05 +00:00
Chris Lattner
e580666532
Minor cleanup, plus implement InstCombine/xor.ll:test17
...
llvm-svn: 9711
2003-11-04 23:50:51 +00:00
Chris Lattner
0f68fa6569
Implement InstCombine/xor.ll:test(15|16)
...
llvm-svn: 9708
2003-11-04 23:37:10 +00:00
Chris Lattner
6444c37488
Implement InstCombine/cast-set.ll:test6[a]. This improves code generated for
...
a hot function in em3d
llvm-svn: 9673
2003-11-03 05:17:03 +00:00
Chris Lattner
1693079e92
Implement InstCombine/cast-set.ll: test1, test2, test7
...
llvm-svn: 9670
2003-11-03 04:25:02 +00:00
Chris Lattner
af7893203b
Fix bug with zero sized casts
...
llvm-svn: 9667
2003-11-03 01:29:41 +00:00
Chris Lattner
d4d987dd4a
Fix bug in previous checkin
...
llvm-svn: 9656
2003-11-02 06:54:48 +00:00
Chris Lattner
f4ad165e8b
Implement transmogriphication of allocation instructions
...
llvm-svn: 9654
2003-11-02 05:57:39 +00:00
Chris Lattner
686767f3f6
Fix bug: 2003-10-29-CallSiteResolve.ll & PR70
...
llvm-svn: 9600
2003-10-30 00:46:41 +00:00
Chris Lattner
bcb0f4bf2e
Fix PR66 & ScalarRepl/2003-10-29-ArrayProblem.ll
...
llvm-svn: 9585
2003-10-29 17:55:44 +00:00
John Criswell
4436c49787
Added LLVM copyright notice to Makefiles.
...
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
482202a601
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
b94550e537
Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
...
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
f0fc9be634
ADd support for the new varargs instructions
...
llvm-svn: 9225
2003-10-18 05:56:52 +00:00
Chris Lattner
50b6858e2e
This code does not require random access use_lists
...
llvm-svn: 9156
2003-10-16 16:49:12 +00:00
Chris Lattner
f95d9b99b3
Decrease usage of use_size()
...
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner
178957028b
Wrap code at 80 columns
...
llvm-svn: 9073
2003-10-13 05:04:27 +00:00
Chris Lattner
c4622a6955
Add support to the loop canonicalization pass to make it transform loops to
...
have a SINGLE backedge. This is useful to, for example, the -indvars pass.
This implements testcase LoopSimplify/single-backedge.ll and closes PR#34
llvm-svn: 9065
2003-10-13 00:37:13 +00:00
Chris Lattner
72272a70b8
Rename loop preheaders pass to loop simplify
...
llvm-svn: 9061
2003-10-12 21:52:28 +00:00
Chris Lattner
55d4788397
File is renamed to LoopSimplify.cpp
...
llvm-svn: 9059
2003-10-12 21:44:18 +00:00
Chris Lattner
154e4d5dea
First step in renaming the preheaders pass to loopsimplify
...
llvm-svn: 9058
2003-10-12 21:43:28 +00:00
Chris Lattner
9703c02ce4
The preheader insertion pass only depends on the CFG. Mark it as such, which
...
allows GCCAS to only run it once.
llvm-svn: 9056
2003-10-12 19:33:10 +00:00
Misha Brukman
8b2bd4ed47
Fix spelling.
...
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Chris Lattner
35e56e7372
Update comment
...
llvm-svn: 8965
2003-10-08 16:56:11 +00:00
Chris Lattner
0bbbe5d4c8
Use a set to keep track of which edges have been noticed as executable already
...
to avoid reprocessing PHI nodes needlessly. This speeds up the big bad PHI
testcase 43%: from 104.9826 to 73.5157s
llvm-svn: 8964
2003-10-08 16:55:34 +00:00
Chris Lattner
7324f7cd03
Minor fixes here and there
...
llvm-svn: 8963
2003-10-08 16:21:03 +00:00
Chris Lattner
71ac22ffb5
Avoid building data structures we don't really need. This improves the runtime
...
of a test that Bill Wendling sent me from 228.5s to 105s. Obviously there is
more improvement to be had, but this is a nice speedup which should be "felt"
by many programs.
llvm-svn: 8962
2003-10-08 15:47:41 +00:00
Chris Lattner
950fc785ae
whoops, don't accidentally lose variable names
...
llvm-svn: 8955
2003-10-07 22:58:41 +00:00
Chris Lattner
75b4d1deec
Fix bug: InstCombine/cast.ll:test11 / PR#7
...
llvm-svn: 8954
2003-10-07 22:54:13 +00:00