Commit Graph

308 Commits

Author SHA1 Message Date
Chris Lattner
caadc93f7b Fix bug: LICM/2003-02-28-PromoteDifferentType.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5675 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-28 19:21:40 +00:00
Chris Lattner
8601a9bf54 Fix bug: 2003-02-27-StoreSinkPHIs.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5658 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 21:59:36 +00:00
Chris Lattner
2d0a4a4eb8 Convert to work with new AliasAnalysis interface by conservatively assuming all pointers are arbitrarily large accesses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-26 19:28:57 +00:00
Chris Lattner
f0a93ed9c5 Rename Instruction::hasSideEffects() -> mayWriteToMemory()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5620 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-24 20:48:32 +00:00
Chris Lattner
2e6e741b73 Initial implementation of Loop invariant memory->scalar promotion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5613 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-24 03:52:32 +00:00
Chris Lattner
ad3448c917 4 new transformations:
* X*C + X --> X * (C+1)
  * X + X*C --> X * (C+1)
  * X - X*C --> X * (1-C)
  * X*C - X --> X * (C-1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5592 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-18 19:57:07 +00:00
Chris Lattner
a2881961b9 Add a variety of new transformations:
* A & ~A == 0
  * A / (2^c) == A >> c  if unsigned
  * 0 / A == 0
  * 1.0 * A == A
  * A * (2^c) == A << c
  * A ^ ~A == -1
  * A | ~A == -1
  * 0 % X = 0
  * A % (2^c) == A & (c-1) if unsigned
  * A - (A & B) == A & ~B
  * -1 - A == ~A


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5587 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-18 19:28:33 +00:00
Chris Lattner
bac74584f1 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5458 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-01 04:50:59 +00:00
Chris Lattner
d7f268d418 Fix bug: ADCE/2003-01-22-PredecessorProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5405 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-23 02:12:18 +00:00
Chris Lattner
4d0a82da2d Fix a huge performance problem in reassociate by introducing a
rank map cache for instruction ranks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5030 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 03:56:00 +00:00
Chris Lattner
680f0c283d Minor changes:
* Reword comment to make more clear
  * Don't print out BB's after modification made
  * Don't delete and new an instruction when we need to move something, just move it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5029 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 03:49:50 +00:00
Chris Lattner
342d1826fb Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4952 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-07 18:42:13 +00:00
Chris Lattner
c736d56562 Fix bug: 2002-12-05-MissedConstProp.ll pointed out by Casey Carter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4935 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-05 22:41:53 +00:00
Chris Lattner
6e6026b465 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:36:02 +00:00
Chris Lattner
0006bd7520 Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 00:49:43 +00:00
Chris Lattner
51c20e9a3a Fix spelling error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 23:18:37 +00:00
Chris Lattner
0188534cd1 Instcombine this away:
%A = getelementptr [4 x int]* %M, long 0, long 0
        %B = getelementptr int* %A, long 2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4536 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 16:43:32 +00:00
Chris Lattner
0864acf07b Add a transformation to turn:
malloc Ty, C
int
  malloc [C x Ty], 1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4534 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 16:18:53 +00:00
Chris Lattner
af663465d6 Make sure to _delete_ memory allocated by worklists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 02:54:22 +00:00
Chris Lattner
e4b730441d Fixes to the reassociate pass to make it respect dominance properties
Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4471 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 17:12:59 +00:00
Chris Lattner
6918c079a1 BreakCriticalEdges should update dominance frontier information as well as
other dominance stuff.  Patch contributed by Casey Carter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4457 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 02:44:36 +00:00
Misha Brukman
a3bbcb5b66 Fix spelling of `propagate'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4423 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:06:16 +00:00
Chris Lattner
cb2610ea03 - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4255 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-21 20:00:28 +00:00
Chris Lattner
d3d06a5cd8 - Fix bug: cee/2002-10-07-NoImmediateDominator.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4081 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:53:51 +00:00
Chris Lattner
f7f009d9a5 - Checkin LARGE number of Changes to CEE pass that will make it much more
powerful, but that are largely disabled.  The basic idea here is that it
    is trying to forward branches across basic blocks that have PHI nodes in
    it, which are crucial to be able to handle cases like whet.ll.
    Unfortunately we are not updating SSA correctly, causing sim.c to die, and I
    don't have time to fix the regression now, so I must disable the
    functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4077 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:34:15 +00:00
Chris Lattner
e802a023d9 Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:06:27 +00:00
Chris Lattner
57b314cfb1 It is illegal for PHI nodes to have zero values, delete the code to handle them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4071 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 17:07:39 +00:00
Chris Lattner
6eaeb5764c Fold ashr -1, X into -1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4070 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 16:16:40 +00:00
Chris Lattner
a92f696b74 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:41 +00:00
Chris Lattner
b461373fbc Fix bug in LICM that caused the previous big win. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3980 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:26:07 +00:00
Chris Lattner
952eaee239 Hoist the contents of Loops in depth first order in the dominator tree,
rather than in random order.  This causes LICM to be DRAMATICALLY more
effective. For example, on bzip2.c, it is able to hoist 302 loads and
2380 total instructions, as opposed to 44/338 before.  This  obviously
makes other transformations much more powerful as well!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3978 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 21:46:09 +00:00
Chris Lattner
99a57216a9 - Further cleanups of LICM pass, remove extra work from previous implementation
- Do not clone instructions then insert clone outside of loop.  Just move them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3951 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 19:40:25 +00:00
Chris Lattner
94170596b7 Improve comments, doxygenize more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3950 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:52:07 +00:00
Chris Lattner
9646e6b6af Clean up LICM significantly now that it is guaranteed to have loop preheaders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3947 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:38:03 +00:00
Chris Lattner
eb53ae4f2d Loop invariant code motion now depends on the LoopPreheader pass. Dead code
has not yet been removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3945 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:19:31 +00:00
Chris Lattner
c178d9459a - Cleanup break-crit-edges pass by making SplitCriticalEdge a member method.
- break-crit-edges pass does not invalidate loop-preheader pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3944 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:18:51 +00:00
Chris Lattner
2ada19ea04 Eliminate extraneous #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3916 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 21:18:40 +00:00
Chris Lattner
eb0456c8fd - Do not expose Critical Edge breaking mechanics outside the BCE pass, thus
removing it from Transforms/Local.h and from Transforms/Utils/*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3910 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:51:56 +00:00
Chris Lattner
16e7a5295f Correlated Exprs pass now requires BCE pass instead of doing it manually
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3908 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:43:56 +00:00
Chris Lattner
6de302bbdb - Expose passinfo from BreakCriticalEdges pass so that it may be "Required"
by other passes.  Make BCE pass be in anonymous namespace now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3907 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:43:12 +00:00
Chris Lattner
d76efa0186 Add new BreakCriticalEdges pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3903 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 00:08:39 +00:00
Chris Lattner
d06451f920 Optimize away cases like:
%cast109 = cast uint %cast212 to short          ; <short> [#uses=1]
        %cast214 = cast short %cast109 to uint          ; <uint> [#uses=1]
        %cast215 = cast uint %cast214 to short          ; <short> [#uses=1]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3897 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 23:39:43 +00:00
Chris Lattner
c017d9132a * Fix bug: CorrelatedExprs/2002-09-23-PHIUpdateBug.ll
* Make sure "Changed" is updated correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3891 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 20:06:22 +00:00
Chris Lattner
dfcbf01222 Fix bug: test/Regression/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll
Thanks to Casey for finding it!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3783 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 21:05:42 +00:00
Vikram S. Adve
c7a6d24cef Extract most of the transformation into an externally accessible
function -- DecomposeArrayRef(GetElementPtrInst* GEP) -- that can
be invoked on a single instruction at a time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3755 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 16:40:07 +00:00
Misha Brukman
655fb5c817 Function.h is unnecessary when Module.h is included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3716 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 03:04:02 +00:00
Chris Lattner
3cac88ac9e - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3682 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:21:33 +00:00
Chris Lattner
9e6161cfd1 Fix the last of the silly bugs I just introduced. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3674 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 23:46:10 +00:00
Chris Lattner
f283608f2e Add cannonicalization of shl X, 1 -> add X, X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3671 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 23:04:09 +00:00
Chris Lattner
1d608abbc0 Clean up code due to auto-insert constructors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3665 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 22:38:47 +00:00
Chris Lattner
2a7c23ef91 Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3656 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 17:04:02 +00:00
Chris Lattner
5e76140536 * Clean up code a little bit
* Fix bug: test/Regression/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3644 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 05:24:05 +00:00
Chris Lattner
1b9029c2f2 Hack unneccesary now that shifts of pointers are no longer legal!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3640 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 03:50:54 +00:00
Chris Lattner
e30e1cf029 Fix Bug: test/Regression/Transforms/InstCombine/2002-09-08-PointerShiftBug.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3626 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 21:39:07 +00:00
Chris Lattner
bd78696719 Minor simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3619 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 18:55:04 +00:00
Chris Lattner
b0dbd7fc5a Initial checkin of Correlated Expression Elimination Pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3599 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-06 18:41:55 +00:00
Chris Lattner
0c4e886dbf - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:08:28 +00:00
Chris Lattner
62b14df410 Add constant prop & DIE to InstCombine, so it cleans up after itself
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3568 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-02 04:59:56 +00:00
Chris Lattner
2a88bb7065 - Implement SCCP of getelementptr instructions
- Implement SCCP of globals into ConstantExprs hopefully opening new
   opportunities for more SCCP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3555 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-30 23:39:00 +00:00
Chris Lattner
2964f3624c Really minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3549 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-30 22:53:30 +00:00
Chris Lattner
14987f16b4 - GCSE now no longer counts instructions not removed (due to no common
dominator as being removed)
  - GCSE now uses new Value #'ing interface, instead of dealing with AA itself
  - GCSE worklist implementation much simpler, class cleaned up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3533 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-30 20:22:29 +00:00
Chris Lattner
e6f9a91618 - instcombine demorgan's law: and (not A), (not B) == not (or A, B)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3495 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-23 18:32:43 +00:00
Chris Lattner
cc63f1c674 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:20 +00:00
Chris Lattner
24ea74eb9a Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 22:49:05 +00:00
Chris Lattner
f5e84aa088 Add capability of using pointer analysis to LICM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3478 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 21:39:55 +00:00
Chris Lattner
0712d55512 Remove long obsolete comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3476 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 21:25:54 +00:00
Chris Lattner
c20e24524f Instcombine PHI's of the form %PN = phi PN, X into X and
%PN = phi PN, PN, PN into 0 (because the phi must not be reachable)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3470 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 20:22:01 +00:00
Chris Lattner
d456ec983c Convert GCSE pass to use new alias analysis infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3463 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 18:24:48 +00:00
Chris Lattner
a69fd90358 - Split Dominators.h into Dominators.h & PostDominators.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3432 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 23:43:50 +00:00
Chris Lattner
905641bb01 Remove an optimization that isn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3419 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 22:10:06 +00:00
Chris Lattner
05bd1b2eee - instcombine (~(a < b)) into (a >= b)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3406 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 18:24:26 +00:00
Chris Lattner
f02c46834a - implemented instcombine of phi (X, X, X) -> X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 15:35:35 +00:00
Chris Lattner
9b76123124 Promote getelementptr instructions to constexprs if we can.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3368 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:21:59 +00:00
Chris Lattner
3ecce66e25 Handle more cases of cast-of-cast in more general forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3347 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 16:15:25 +00:00
Chris Lattner
5cf6f112e6 Implement capability to fold this:
uint %test4(int %A, int %B) {
        %COND = setlt int %A, %B                ; <bool> [#uses=1]
        %result = cast bool %COND to uint               ; <uint> [#uses=1]
        ret uint %result
}
into a single cast instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3339 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 23:21:10 +00:00
Chris Lattner
db6e4d6625 Avoid inserting an entry block unless we need it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 21:35:02 +00:00
Chris Lattner
9b2b80fd48 Fix bug introduced in last checkin due to CastInst not being visible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3327 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:22:19 +00:00
Chris Lattner
0513e9fe03 Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:18:02 +00:00
Chris Lattner
48a4531ee4 Remove extra #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3322 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:17:32 +00:00
Chris Lattner
b804760b56 Remove support for unary operators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3318 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:53:45 +00:00
Chris Lattner
af2930efa0 - Fix InstCombine pass to not generate or process NOT instructions
- Fixed testcases to not use them either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3315 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:51:49 +00:00
Chris Lattner
572f4a01a5 - Rename ConstantGenericIntegral -> ConstantIntegral
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3300 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-13 17:50:24 +00:00
Chris Lattner
233f7dcde3 * Factor a bunch of code by using ReplaceInstUsesWith
* Move isMaxValue, isMinValue, isAllOnesValue to Constants.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3290 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-12 21:17:25 +00:00
Chris Lattner
8b170945ea New functionality for instcombine:
* New ReplaceInstUsesWith function to factor out tons of common code
     This needs to be used more in the future still, but it's a good start
   * New InsertNewInstBefore to allow multi-instruction replacements
   * Change getMaxValue functions to isAllOnesValue function, which doesn't
     have to CREATE/lookup a new constant.  Also the name is accurate
   * Add new isMaxValue, isMinValue, isMaxValueMinusOne, isMinValuePlusOne
     functions:  This should be moved to Constant* classes eventually
   * Implement xor X, ALLONES -> not X
   * Fold ALL setcc's of booleans away
   * Handle various SetCC's for integers against values at the end of their
     ranges, possibly off by one.  This implements the setcc-strength-reduce.ll
     testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3286 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 23:47:40 +00:00
Chris Lattner
5f0eb8da62 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3265 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:30 +00:00
Vikram S. Adve
900fd63d12 Eliminate cast instructions: use only GEPs in decomposed sequence.
Don't decompose if there are 2 indices with 0 as first index.
Compute Changed flag correctly in runOnBasicBlock().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3233 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-03 13:21:15 +00:00
Chris Lattner
8fd217cb29 Fix bug: test/Regression/Transforms/InstCombine/2002-08-02-CastTest.ll
Implement feature: Cast's can now be converted to bitwise AND expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3225 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 20:00:25 +00:00
Chris Lattner
90ac28cf3e * Cleanups of instcombine
- Reenable gep (gep x) -> x
   - Make instcombine do dead instruction elimination where it's really
     easy.  Now visitors don't have to ensure they aren't not processing
     dead instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3222 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 19:29:35 +00:00
Chris Lattner
be1ecf6050 Fix bug: test/Regression/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3215 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 18:06:01 +00:00
Chris Lattner
446698b63d * Fix bug: test/Regression/Transforms/ADCE/2002-07-17-AssertionFailure.ll
which was caused by us not running the "drop references of dead
  instructions" code when there were no basic blocks that were dead.

  We still don't want to do some of the stuff we do if there are dead
  basic blocks, but we DO want to drop references of dead instructions,
  so we factor the common code out to a new method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3137 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 00:22:34 +00:00
Chris Lattner
a61fab8c6d Add code to ensure that no PHI nodes are left laying around with their
arguments dropped.  This fixes bug:
   test/Regression/Transforms/ADCE/2002-07-17-PHIAssertion.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3134 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 23:40:46 +00:00
Chris Lattner
011de07117 Fix bug: test/Regression/Transforms/ADCE/2002-07-29-Segfault.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3129 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 22:31:39 +00:00
Chris Lattner
a59cbb2043 * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3116 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-27 01:12:17 +00:00
Chris Lattner
a6275ccdf5 * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3113 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:46 +00:00
Chris Lattner
ce6ef112c4 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3105 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 18:40:14 +00:00
Chris Lattner
0c0edf8afc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 06:17:51 +00:00
Chris Lattner
f629309f74 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3016 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:06:35 +00:00
Chris Lattner
56d27019e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:38 +00:00
Chris Lattner
43199a036d Disable folding g-e-p instructions into loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 22:37:17 +00:00
Chris Lattner
3e009942ed *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2813 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:25:25 +00:00