Commit Graph

710 Commits

Author SHA1 Message Date
Chris Lattner
a4f445b28c Implement: -A*-B == A*B
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5740 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 23:23:04 +00:00
Chris Lattner
a27231acc0 Add new transformation: // (~A | ~B) == (~(A & B))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5738 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 23:13:59 +00:00
Chris Lattner
8d96964e29 Generalize not and neg comparison testers to allow constant to be considered not'able and neg'able. This
allows optimization of this:
int %test4(int %A, int %B) {
        %a = xor int %A, -1
        %c = and int %a, 5    ; 5 = ~c2
        %d = xor int %c, -1
        ret int %d
}

into this:
int %test4(int %A, int %B) {            ; No predecessors!
        %c.demorgan = or int %A, -6             ; <int> [#uses=1]
        ret int %c.demorgan
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5736 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 23:06:50 +00:00
Chris Lattner
4f98c56936 Generalize (A+c1)+c2 optimization to work with all associative operators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5733 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 21:43:22 +00:00
Chris Lattner
28ba1aad99 Minor change, no functionality diff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5731 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 19:20:30 +00:00
Chris Lattner
ea34005404 Fix bug: (x << 100) wasn't folded to 0, but (x >> 100) was (when x is unsigned)
Implement new shift optimizations for shifting the result of a shift.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5729 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 19:16:08 +00:00
Chris Lattner
cb40a3749a Implement: (A|B)^B == A & (~B)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5728 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 18:24:17 +00:00
Chris Lattner
3a43837d85 Fix bug: SimplifyCFG/2003-03-07-DominateProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5722 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-07 18:13:41 +00:00
Chris Lattner
decd0812ec Implement %test7 in InstCombine/getelementptr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5704 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-05 22:33:14 +00:00
Chris Lattner
46a5f1f6e4 Implement CFGSimplify/PhiBlockMerge*.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5702 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-05 21:36:33 +00:00
Chris Lattner
e2ca540e7c Implement testcase CFGSimplify/EqualPHIEdgeBlockMerge.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5699 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-05 21:01:52 +00:00
Chris Lattner
0252e49f6d Convert LICM over to use AliasSetTracker. Besides being nicer, this automatically
allows LICM to use access sizes to help alias analysis be more precise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5693 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-03 23:32:45 +00:00
Chris Lattner
dde601d0eb Eliminate tons of bogus warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5686 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-03 19:57:46 +00:00
Chris Lattner
fb743a937f Change the mem2reg interface to accept a TargetData argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5685 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-03 17:25:18 +00:00
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
6315938d68 Fix bug I introduced yesterday :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5669 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-28 16:54:17 +00:00
Chris Lattner
74cd04ea01 Fix bug: LICM/2003-02-27-PreheaderExitNodeUpdate.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-28 03:07:54 +00:00
Chris Lattner
9f879cfb0a Fix bug: 2003-02-27-PreheaderExitNodeUpdate.ll by updating exit node info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5664 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 22:48:57 +00:00
Chris Lattner
7e7ad49c23 Add a new assertion to check that stuff is happening right
Ironically the exit block modification code wasn't updating the exit block
information itself.  Fix this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5659 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 22:31:07 +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
69269ac203 * Don't forget to update Loop information!
* Remove bogus assertion: there may be a single outside predecessor and
    still need a new loop-preheader if the predecessor has multiple
    successors.  See bug: LICM/2003-02-27-PreheaderProblem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5655 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 21:50:19 +00:00
Chris Lattner
4e2fd7574a Replace assertion with a handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5653 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 20:55:48 +00:00
Chris Lattner
dbf3cd7952 * Significant changes to the preheader insertion pass:
- Now we perform loop exit-block splitting to ensure exit blocks are
     always dominated by the loop header.
   - We now preserve dominance frontier information
   - This fixes bug: LICM/2003-02-26-LoopExitNotDominated.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5652 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-27 20:27:08 +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
d99bf49a53 Split mem2reg promotion into two parts: a function which does the work, and
a pass which wraps the function.  This allows other passes to use the functionality


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5610 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-22 23:57:48 +00:00
Chris Lattner
cc139de15a Clean up std namespace references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5608 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-22 22:25:17 +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
Anand Shukla
92d5e30e76 Changes to runtime framework
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 20:41:53 +00:00
Chris Lattner
fd595203bd Fix a bug that cause a crash resolving questionable function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 19:12:29 +00:00
Chris Lattner
a3183be835 Fix a misunderstanding of the standard associative containers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 05:34:36 +00:00
Chris Lattner
6b403233f7 Fix bug: LevelRaise/2003-02-13-CallRaise.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5562 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 03:07:17 +00:00
Chris Lattner
dab73bef89 Revert Anand's patch which broke the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5525 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-10 15:55:50 +00:00
Anand Shukla
f013d3d40b *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5522 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-09 21:15:36 +00:00
Chris Lattner
617d92c7d9 Fix a problem Sumant was running into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5499 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-06 22:03:46 +00:00
Chris Lattner
f9c81670d7 Split public interface out into header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5472 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-03 19:08:18 +00:00
Chris Lattner
41c04f730b Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
This change provides a small (3%) but consistent speedup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-01 04:52:08 +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
49f2012140 Fix a bug resolving sprintf(...) to sprintf(char*, char*, ...)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5446 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 22:38:44 +00:00
Chris Lattner
9943a59cb5 Actually print the function _name_ if there is a problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5443 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 21:33:07 +00:00
Chris Lattner
2f6bb2bce1 * Fix linking of opaque types and their non-opaque versions
* Fix bug: Linker/2003-01-30-LinkerTypeRename.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5441 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 20:53:43 +00:00
Chris Lattner
5c2d335d86 Eliminate using decls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5439 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 19:53:34 +00:00
Chris Lattner
da902ba970 * Fix function resolution for varargs function to generate incorrect bytecode instead of crashing
* remove using decls
 CVS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5437 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 18:22:32 +00:00
Chris Lattner
8c73b0f7f6 Fix levelraise/2003-01-30-ShiftCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5435 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 17:10:41 +00:00
Chris Lattner
f34e1ba79c Initial checkin of pool allocation code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5432 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-29 21:12:13 +00:00
Chris Lattner
0ea3e6dc41 Disable construction of pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5422 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-24 20:13:20 +00:00
Chris Lattner
e5fa63a578 Fix bug: LevelRaise/2003-01-22-GEPProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5407 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-23 02:39:10 +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