Commit Graph

1248 Commits

Author SHA1 Message Date
Chris Lattner
b6ac8bc586 Add header file I accidentally removed in teh shuffle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10795 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:15:20 +00:00
Chris Lattner
5585b335e5 Remove use of the ConstantHandling interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10793 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:12:50 +00:00
Chris Lattner
c6646ebdb9 Remove use of ConstantExpr::getShift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10792 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:10:58 +00:00
Chris Lattner
b16689b647 Don't use ConstantExpr::getShift anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:08:43 +00:00
Chris Lattner
81ebc30089 Remove use of ConstantHandling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10789 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:35:03 +00:00
Chris Lattner
e5d4f1b9e7 Remove unneeded #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10788 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:33:54 +00:00
Chris Lattner
8f90b005d6 Move llvm::ConstantFoldInstruction from VMCore to here, next to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:25:22 +00:00
Chris Lattner
ccd3a878d0 Remove uses of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10783 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:12:44 +00:00
Chris Lattner
b7a5d3edee Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10779 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 17:43:40 +00:00
Chris Lattner
84831642e4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10778 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 17:40:36 +00:00
Chris Lattner
c6a4d6a066 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10767 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 04:29:41 +00:00
Chris Lattner
5f16a13896 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 04:13:56 +00:00
Chris Lattner
1daee8b010 Implement SCCP/phitest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10763 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 03:57:30 +00:00
Chris Lattner
2d11f167e6 Implement Transforms/ScalarRepl/phinodepromote.ll, which is an important
case that the C/C++ front-end generates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10761 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 01:18:32 +00:00
Chris Lattner
2cacc0a306 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!  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10751 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 21:36:49 +00:00
Chris Lattner
f7703df496 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10727 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:12:26 +00:00
Chris Lattner
21949d9088 Remove dependence on structure index type. s/MT/FT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:02:51 +00:00
Chris Lattner
d745602662 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10725 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:02:20 +00:00
Chris Lattner
559d519549 Finegrainify namespacification
add flags for PR82


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10724 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:53:38 +00:00
Chris Lattner
63a917bbc2 Inching towards fixing PR82
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10722 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:44:50 +00:00
Chris Lattner
329c1c6c94 Improve encapsulation in the Loop and LoopInfo classes by eliminating the
getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10714 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-08 00:09:44 +00:00
Chris Lattner
0898c78a52 Merging constants can cause further room for improvement. Iterate until
we converge


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 07:19:08 +00:00
Chris Lattner
9a0a41f224 rename ClassifyExpression -> ClassifyExpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10592 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 08:04:08 +00:00
Chris Lattner
15cad759fe More minor non-functional changes. This now computes the exit condition, though
it doesn't do anything with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10590 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 07:47:09 +00:00
Chris Lattner
e799902fbb Remove extraneous #include
finegrainify namespacification


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10589 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 07:43:38 +00:00
Chris Lattner
b97238079d Fix memory corruption bug PR193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10586 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 23:49:36 +00:00
Chris Lattner
500597a1c3 Don't mind me, I'm just refactoring away. This patch makes room for LFTR, but
contains no functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10583 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 09:53:29 +00:00
Chris Lattner
18b3c97bc7 Implement IndVarsSimplify/pointer-indvars.ll, transforming pointer
arithmetic into "array subscripts"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 05:02:01 +00:00
Chris Lattner
3324e718bc Fix PR194
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10573 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 03:58:44 +00:00
Chris Lattner
bd1a90ecc7 Fix ADCE/2003-12-19-MergeReturn.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10539 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 09:08:34 +00:00
Chris Lattner
a3df8a964a Remove the wierd "Operands" loop, by traversing basicblocks in reverse order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10536 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 08:18:16 +00:00
Chris Lattner
e4365b2e8c Implement LICM/sink_multiple.ll, by sinking all possible instructions in the
loop before hoisting any.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10534 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 07:22:45 +00:00
Chris Lattner
0f98e75adf Generalize a special case to fix PR187
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10531 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 06:27:08 +00:00
Chris Lattner
60921c9aa1 Factor code out into the Utils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10530 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 05:58:40 +00:00
Chris Lattner
abbc2dd779 Add new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10529 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 05:56:28 +00:00
John Criswell
47df12d80d Reverted back to previous revision - this was previously merged
according to the CVS log messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10517 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 17:19:19 +00:00
John Criswell
d000e1dc2f Merged in RELEASE_11.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10516 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 16:43:17 +00:00
Chris Lattner
ba7df4c482 When we delete instructions from the loop, make sure to remove them from the
AliasSetTracker as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10507 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:12:32 +00:00
Chris Lattner
9e45d2e0e8 Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10473 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-15 17:34:02 +00:00
Chris Lattner
d64152a708 Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10467 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 23:57:39 +00:00
Chris Lattner
00ad4a2d17 Do not promote volatile alias sets into registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10458 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 04:52:31 +00:00
Chris Lattner
ea9403f2aa Fix LICM/2003-12-11-SinkingToPHI.ll, and quite possibly all of the other known problems in the universe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10409 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 22:23:32 +00:00
Chris Lattner
1301515197 verifyFunction depends on dominator info, which levelraise does not declare
that it needs.  This is pretty scary code!  This fixes

Regression.Transforms.LevelRaise.2002-07-16-SourceAndDestCrash
Regression.Transforms.LevelRaise.2002-07-31-AssertionFailure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10406 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 21:47:37 +00:00
Chris Lattner
7d3ced934f Fix bug: LICM/sink_multiple_exits.ll
Thanks for pointing this out John  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10387 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 22:35:56 +00:00
Chris Lattner
df45bd3803 Don't allow dead instructions to stop sinking early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10386 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 20:43:29 +00:00
Chris Lattner
88369d214f Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 20:43:04 +00:00
Chris Lattner
dead99325c Finegrainify namespacification
Fix bug: LowerInvoke/2003-12-10-Crash.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10382 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 20:22:42 +00:00
Chris Lattner
ba4f3f6a41 Finegrainify namespacification
Reorder #includes
Implement: IndVarsSimplify/2003-12-10-IndVarDeadCode.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10376 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 18:06:47 +00:00
Chris Lattner
66ea98e85c Finegrainify namespacification
Fix bug: LoopSimplify/2003-12-10-ExitBlocksProblem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10373 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 17:20:35 +00:00
Chris Lattner
e3cfe8d563 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10371 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 16:58:24 +00:00
Chris Lattner
f594a03197 Avoid performing two identical lookups when one will suffice
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10370 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 16:57:24 +00:00
Chris Lattner
0ed2da9ac7 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10369 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 15:56:24 +00:00
Chris Lattner
a2706518f9 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10358 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 06:41:05 +00:00
Chris Lattner
010ba10032 Do not insert one entry PHI nodes in split exit blocks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-09 23:12:55 +00:00
Chris Lattner
ed6dfc2856 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10342 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-09 19:32:44 +00:00
Chris Lattner
92094b4d92 Fine grainify namespacification
Code cleanups
Make LICM::SafeToHoist marginally more efficient


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-09 17:18:00 +00:00
Chris Lattner
cf2f89251d Implement: TailCallElim/accum_recursion_constant_arg.ll
Also make sure to clean up any PHI nodes that are inserted which are pointless.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10333 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 23:37:35 +00:00
Chris Lattner
543d622ef7 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.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 23:19:26 +00:00
Chris Lattner
7152da38ef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 05:34:54 +00:00
Chris Lattner
eb12cd67dd Implement RaiseAllocations/FreeCastConstantExpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10305 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 01:42:08 +00:00
Chris Lattner
67b1e1b89f * Finegrainify namespacification
* Transform: free <ty>* (cast <ty2>* X to <ty>*) into free <ty2>* X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10303 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 01:24:23 +00:00
Chris Lattner
d866473094 Finegrainify namespacification
Fix regressions ScalarRepl/basictest.ll & arraytest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10287 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-02 17:43:55 +00:00
Chris Lattner
3607f4d217 Fix test: Transforms/LevelRaise/2003-11-28-IllegalTypeConversion.ll
Some gep generalization changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-29 05:31:25 +00:00
Chris Lattner
be883a23ed Do not use index type to determine what it is indexing into!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10226 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 21:09:18 +00:00
Chris Lattner
ab25f5a6c1 Delete dead line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10164 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:26:17 +00:00
Chris Lattner
3788c242be Fix bug: Transforms/PruneEH/2003-11-21-PHIUpdate.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10163 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:20:36 +00:00
Chris Lattner
c8ecd22037 Do not crash when deleing a region with a dead invoke instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10161 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:13:08 +00:00
Chris Lattner
35bb52f8b1 Finegrainify namespacification
The module stripping pass should not strip symbols on external globals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10157 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 01:29:35 +00:00
Chris Lattner
6d1db01284 Considering that CI is not even IN SCOPE here, I wooda thought the compiler
would have caught this.  *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10142 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:57:29 +00:00
Chris Lattner
1e2385b941 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:54:22 +00:00
Chris Lattner
1192283096 Get rid of using decls, finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10137 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:52:10 +00:00
Chris Lattner
869adc283c * Finegrainify namespacification
* Make the cost metric for passing constants in as arguments to functions MUCH
  more accurate, by actually estimating the amount of code that will be constant
  propagated away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10136 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:46:09 +00:00
Chris Lattner
a51bcb50b0 Finegrainify namespacification
Print out the costs for functions that AREN'T inlined as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:45:31 +00:00
Chris Lattner
108e4ab159 Minor cleanups and simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10127 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 16:52:05 +00:00
Chris Lattner
03fb8b2a42 * Finegrainify namespacification
* Implement FuncResolve/2003-11-20-BogusResolveWarning.ll
   ... which eliminates a large number of annoying warnings.  I know misha
   will miss them though!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10123 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 21:21:31 +00:00
Chris Lattner
f8485c6434 Start using the nicer terminator auto-insertion API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10111 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:25:24 +00:00
Chris Lattner
adbc0b5287 Spew symbolic types!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10110 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:23:14 +00:00
Chris Lattner
143df9a1bb When spewing out warnings during function resolution, do not vomit out pages
and pages of non-symbolic types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:19:35 +00:00
Misha Brukman
444fdea19d This file was somehow missing a top-level comment line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10055 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:35:17 +00:00
Chris Lattner
faa45ce300 Fix PR116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10032 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 21:39:27 +00:00
Chris Lattner
917e804253 Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9981 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 19:17:02 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
363ca610d1 Reorganize code for locality, improve comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9857 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-10 04:42:42 +00:00
Chris Lattner
d23520cd94 Adjust to new critical edge interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9853 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-10 04:10:50 +00:00
Chris Lattner
d77922f1a2 Do NOT inline self recursive calls into other functions. This is causing the
pool allocator no end of trouble, and doesn't make a lot of sense anyway.  This
does not solve the problem with mutually recursive functions, but they are much less common.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 05:05:36 +00:00
Chris Lattner
b045e14111 Untypo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9827 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 05:04:25 +00:00
Misha Brukman
ed1f7c81aa Declare FunctionPasses as such so that they can be used in FunctionPassManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9768 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 17:20:18 +00:00
Chris Lattner
0c7e8e17ff Various cleanups and efficiency improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9753 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-06 19:46:29 +00:00
Chris Lattner
d7222ec801 Fix bug: PR93
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9752 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-06 19:18:49 +00:00
Chris Lattner
b6e0631a94 Fix the problem with running cleanups in bugpoint: We were deleting arguments
of intrinsic functions, causing the verifier to fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9745 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 21:53:41 +00:00
Chris Lattner
fdcc3acb7b Split behavior into two pieces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9741 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 21:43:02 +00:00
Chris Lattner
e7a6663eb1 Yet more fixes for constant expr shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9739 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 20:43:58 +00:00
Chris Lattner
d981f8af79 Further fixes for PR93
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9738 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 20:37:01 +00:00
Chris Lattner
1bcc70d240 Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9731 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 17:31:36 +00:00
Chris Lattner
646f8d7457 Be gcc 3.4 clean
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9725 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 06:12:18 +00:00
Chris Lattner
d65460f133 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9715 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 01:06:05 +00:00
Chris Lattner
ad5b4fb6b7 Minor cleanup, plus implement InstCombine/xor.ll:test17
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9711 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 23:50:51 +00:00
Chris Lattner
689d24b6ed Implement InstCombine/xor.ll:test(15|16)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9708 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 23:37:10 +00:00
John Criswell
700867bb69 Checking in Chris's suggestions:
Added assert() to ensure symbol table is well formed.
Added code to remember the value that was found; resolving types can change
the symbol table and invalidate the value of the iterator.
Added comments to the ResolveTypes() function (mainly for my own benefit).
Please feel free to correct the comments if they are not accurate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9693 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 15:22:26 +00:00
Chris Lattner
6870805117 Implement InstCombine/cast-set.ll:test6[a]. This improves code generated for
a hot function in em3d


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 05:17:03 +00:00
Chris Lattner
de90b76670 Implement InstCombine/cast-set.ll: test1, test2, test7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9670 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 04:25:02 +00:00
Chris Lattner
8ee9204309 Fix bug with zero sized casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 01:29:41 +00:00
Chris Lattner
fc07a3473a Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9656 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-02 06:54:48 +00:00
Chris Lattner
bc61e661bd Implement transmogriphication of allocation instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9654 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-02 05:57:39 +00:00
Chris Lattner
d6d0d8c18d Fix PR78
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9648 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-02 02:06:27 +00:00
Chris Lattner
bb9ae1512e Strip off CPR's manually, because if we don't, the inliner doesn't delete dead
functions.  GRR


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-31 21:05:58 +00:00
Chris Lattner
bb60904469 Fix bug: 2003-10-29-CallSiteResolve.ll & PR70
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9600 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 00:46:41 +00:00
Chris Lattner
942457564d Refactor code, initial implementation of -insert-block-profiling pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9593 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 21:24:22 +00:00
Chris Lattner
546fc40d69 Fix PR66 & ScalarRepl/2003-10-29-ArrayProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9585 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 17:55:44 +00:00
Chris Lattner
6ace4daa57 Fix bug: ConstantMerge/2003-10-28-MergeExternalConstants.ll & PR64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9579 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 06:01:26 +00:00
Chris Lattner
fe2143d87d Check in statistifying patch for Bill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-28 23:14:59 +00:00
Chris Lattner
c0204e0b73 Pass in argc & argv
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9563 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-28 22:42:24 +00:00
Chris Lattner
baa2007fae Initial checkin of profiling instrumentation pass. So far, despite the
file name, we only support function profiling.  This will be fixed in the
near future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9547 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-28 18:59:04 +00:00
Chris Lattner
7b6dd2950f Eliminate using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9543 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-27 21:44:09 +00:00
Chris Lattner
2e8dfb8221 Propagating constants to arguments can make other arguments constant. For now
do something dumb, and inefficient, but more complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-27 21:09:00 +00:00
Chris Lattner
35956558e2 Fix test: Linker/2003-10-27-LinkOncePromote.ll
Fix PR58


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9530 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-27 16:39:39 +00:00
Chris Lattner
198f4507e2 Get the list of PHI node values before the basic block is split. Also, add
PHI node entries for unwind instructions just like for call instructions which
became invokes!  This fixes PR57, tested by
Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9526 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-27 05:33:09 +00:00
Chris Lattner
2e56dd82b3 We might as well strip off any CPRs before propagation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9437 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 18:49:23 +00:00
Chris Lattner
ff5bf9c62b * We were forgetting to pass varargs arguments through a call
* Add a work around for bug PR56, gross but necessary for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9428 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 17:44:53 +00:00
Chris Lattner
d358e6fed5 Check in initial version of ipcp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9423 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 16:52:27 +00:00
Chris Lattner
c3afd9bf4b Make this pass substantially stronger by having it delete dead return values
as well as arguments.  Now it can delete arguments and return values which are
only passed into other arguments or are returned, if they are dead.  This causes
it to delete several hundred extra args/retvals from the C++ hello world program,
shrinking it by about 2K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9398 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 03:48:17 +00:00
Chris Lattner
ce94319558 This important patch fixes two warnings in the linker which can occur from linking
valid pieces of code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 23:03:38 +00:00
Chris Lattner
6be5e567ce Update the 'used' flag correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:43:18 +00:00
Chris Lattner
4cb766af4a Loop over the module, not the symbol table. This makes the code handle
unused external functions again


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9365 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:42:20 +00:00
Chris Lattner
efd47ba3ac Implement FunctionResolve/2003-10-21-GlobalResolveHack.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 03:35:34 +00:00
Chris Lattner
5858e1e3f3 Fix bug: FunctionResolve/2003-10-21-GlobalTypeDifference.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9359 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 23:17:56 +00:00
Chris Lattner
aeb18ce9c0 Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 22:46:38 +00:00
Chris Lattner
f85770c9a6 Fix message to make more sense and confuse Chris less
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9354 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 21:52:20 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
bacc773d20 Reorder for minor efficiency gain
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:54:26 +00:00
Chris Lattner
3b237fcd38 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:34:28 +00:00
Chris Lattner
3c4a34e8db Fix PR#50
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9227 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 06:14:59 +00:00
Chris Lattner
cda965e28a ADd support for the new varargs instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9225 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:56:52 +00:00
Chris Lattner
9493101409 Do not crash on empty structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9195 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:03:54 +00:00
Chris Lattner
72ac148d49 Add support for 'weak' linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 18:29:00 +00:00
Chris Lattner
76590640cf This code does not require random access use_lists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9156 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 16:49:12 +00:00
Chris Lattner
28b2265eb9 Eliminate using declaration
Rewrite code to work with use_lists what are either random access or bidirectional


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9155 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 16:48:53 +00:00
Chris Lattner
fd05924946 Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:48:29 +00:00
Chris Lattner
fb42dd83f8 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9133 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:42:21 +00:00
Chris Lattner
f775f95369 Do not move variable sized allocations to the top of the caller, which might
break dominance relationships, and is otherwise bad.  This fixes bug:
Inline/2003-10-13-AllocaDominanceProblem.ll.  This also fixes miscompilation
of 3 176.gcc source files (reload1.c, global.c, flow.c)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 01:11:07 +00:00
Chris Lattner
8b716f66ad Whoops, we inserted into the wrong set. What's up with the dead set anyway?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9094 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 16:49:21 +00:00
Chris Lattner
46e033d28d Use external df iterators to avoid revisiting blocks in functions with
multiple setjmp calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 16:44:50 +00:00
Chris Lattner
4a650af599 Wrap code at 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9073 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 05:04:27 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
21fb3afe73 Regularize header file comment, eliminate using's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9069 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:30:47 +00:00
Chris Lattner
6d3906be28 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 01:02:33 +00:00
Chris Lattner
bb2d4de409 Checkin an improvement contributed by Bill:
Only transform call sites in a setjmp'ing function which are reachable from
the setjmp.  If the call dominates the setjmp (for example), the called
function cannot longjmp to the setjmp.

This dramatically reduces the number of invoke instructions created in some
large testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 00:57:16 +00:00
Chris Lattner
2ab6a7358e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9065 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 00:37:13 +00:00