Commit Graph

734 Commits

Author SHA1 Message Date
Chris Lattner
892310eaff Make sure that the cloned module retains the type symbol table entries!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5894 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-24 17:15:33 +00:00
Chris Lattner
7899b74fdb Make sure to preserve endiannes and pointer size when cloning modules!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5892 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-24 15:54:40 +00:00
Chris Lattner
c2b97d43a0 Fix Bug: Linker/2003-04-23-LinkOnceLost.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5879 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 18:38:39 +00:00
Chris Lattner
e408e25132 Remove unnecesary &*'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5872 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:37:45 +00:00
Chris Lattner
14383485ac New pass to lower switch instructions to branch instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5865 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:23:59 +00:00
Chris Lattner
350c0a8216 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5863 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:18:14 +00:00
Chris Lattner
43a9994c01 Add warning when linking modules with disagreeing target properties
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5845 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 19:13:20 +00:00
Chris Lattner
37f59419b8 Preserve the new moduleID field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5835 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 18:02:26 +00:00
Chris Lattner
2719bac905 Fix bug: 2003-01-30-LinkerRename.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 21:15:04 +00:00
Chris Lattner
0fec08eb58 Fix linking a function with qualifiers to a external function declaration:
Fixed bug: Linker/2003-04-21-Linkage.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5827 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 21:07:05 +00:00
Chris Lattner
085c801dee Fix bug where use still existed in dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5824 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 19:15:26 +00:00
Chris Lattner
ea2294a498 Implement: FunctionResolve/2003-04-18-ForwardDeclGlobal.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5816 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-19 00:15:27 +00:00
Chris Lattner
393689afa9 Fix bug: Mem2reg/2003-04-18-DeadBlockProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5810 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-18 19:25:22 +00:00
Chris Lattner
156bcf3f65 Global constants CAN be external
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5808 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-18 04:34:29 +00:00
Chris Lattner
17d145d26f Refactor CloneFunction to expose the new CloneBasicBlock function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5806 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-18 03:50:09 +00:00
Chris Lattner
15faa8498c New const_cast instead of c style cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5805 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-18 03:49:49 +00:00
Chris Lattner
fb242b6edc Change the interface to constant expressions to allow automatic folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5793 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 22:40:51 +00:00
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Chris Lattner
af7ccd9bba Make help message more clear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5775 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-13 03:50:14 +00:00
Chris Lattner
d4bd3eba5d * Fix bug: Mem2Reg/2003-04-10-DFNotFound.ll
* Make Mem2Reg assign version numbers now for renamed variables instead of
  .mem2reg suffixes.  This produces what people think of as SSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5771 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-10 19:41:13 +00:00
Chris Lattner
e941291a7a Initial checkin of PRE on LLVM. This implementation is still lacking in
several ways:

 * Load expressions are not PRE'd well.  Alias Analysis should be used to
   get accurate information when computing anticipatibility.
 * The expression collection implementation does not handle PHI nodes properly,
   thus the implementation misses many opportunities to PRE.
 * This code could be sped up quite a bit

Despite these flaws, the code seems to work well, and handles PR's as one
would expect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5759 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-31 19:55:43 +00:00
Chris Lattner
6c0e0496dc * We now preserve the no-critical-edge pass (because we cannot insert critical edges)
* Small modification to be more efficient


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5757 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-31 17:30:25 +00:00
Chris Lattner
c277eaa41e Move BreakCriticalEdges pass to lib/Transforms/Utils
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5754 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-21 21:43:19 +00:00
Chris Lattner
c8802d2c16 Add the following instcombine xforms:
- Implement simple reassociation: (A|c1)|(B|c2) == (A|B)|(c1|c2)
  - (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
  - (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5743 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-11 00:12:48 +00:00
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