Commit Graph

809 Commits

Author SHA1 Message Date
Misha Brukman 373086db75 Hopefully, the final fix for `[Pp]ropogate'.
llvm-svn: 6251
2003-05-20 21:01:22 +00:00
Misha Brukman e5838c4d72 s/convertable/convertible/g
llvm-svn: 6248
2003-05-20 18:45:36 +00:00
Chris Lattner 652e7bf8a8 Fix long standing bug
llvm-svn: 6232
2003-05-15 18:25:13 +00:00
Chris Lattner 25fa9718cb Fix Bug: Linker/2003-05-15-TypeProblem.ll
llvm-svn: 6225
2003-05-15 16:30:55 +00:00
Chris Lattner 58ea8ff469 Fix major problem with appending linkage changes
llvm-svn: 6185
2003-05-14 12:11:51 +00:00
Chris Lattner f779becc5a Implement linkage of appending global variables!
llvm-svn: 6178
2003-05-13 21:33:43 +00:00
Chris Lattner 0895025b30 Fix bug: LoopPreheaders/2003-05-12-PreheaderExitOfChild.ll
llvm-svn: 6153
2003-05-12 22:04:34 +00:00
Chris Lattner b02697210e Handle va_arg instruction correctly
llvm-svn: 6030
2003-05-08 02:50:13 +00:00
Chris Lattner fce555a981 Don't inline functions that take variable numbers of arguments!
llvm-svn: 6024
2003-05-08 02:36:43 +00:00
Chris Lattner d9bd5a0443 Remove using decl
llvm-svn: 6023
2003-05-08 02:34:52 +00:00
Chris Lattner caa1de250b Attempt to fix sumant's typesafety issue
llvm-svn: 5984
2003-05-02 19:32:04 +00:00
Chris Lattner 3666378690 Fix spelling
llvm-svn: 5983
2003-05-02 19:26:34 +00:00
Chris Lattner df7cc91159 Fix Bug: LowerSwitch/2003-05-01-PHIProblem.ll
llvm-svn: 5979
2003-05-01 22:21:21 +00:00
Chris Lattner 802c63d964 Fix bug: LevelRaise/2003-05-01-CallCast.ll
llvm-svn: 5975
2003-05-01 21:02:53 +00:00
Chris Lattner dd65d863a9 Fix another case where constexprs could cause a crash
llvm-svn: 5972
2003-04-30 22:34:06 +00:00
Chris Lattner 9244df60d3 Fix constant folding of constexprs
llvm-svn: 5971
2003-04-30 22:19:10 +00:00
Chris Lattner fcd1fe4f12 Create constant expression casts instead of constant instructions if possible
llvm-svn: 5968
2003-04-28 01:25:38 +00:00
Chris Lattner 9810b94850 Fix several bugs:
* Warnings were emitted all of the time and were really annoying
  * Functions could not be resolved unless they had external linkage.  Linkonce
    linkage was not allowed
  * ConstantPointerRef's were not handled when linking functions
    we now actually handle cast (CPR) to X -> cast (NewCPR) to X

llvm-svn: 5967
2003-04-28 01:23:29 +00:00
Chris Lattner 4a6c3e79b0 Avoid naming things exactly the same
llvm-svn: 5966
2003-04-27 22:55:56 +00:00
Chris Lattner b68a34eb3f Fix bug: ADCE/2003-04-25-PHIPostDominateProblem.ll
llvm-svn: 5952
2003-04-25 22:53:27 +00:00
Chris Lattner 3c98276168 Fix major problem with PHI node traversal: rechecking PHIs should go into
the visit function.  The worklist is for when their lattice value changes.

llvm-svn: 5927
2003-04-25 03:35:10 +00:00
Chris Lattner cccc5c76c8 Minor non-functional changes:
* Spell propagate right
  * Improve performance of phi node handling
  * Delete using directive
  * Other minor changes

llvm-svn: 5920
2003-04-25 02:50:03 +00:00
Chris Lattner 3a2fe67908 Fix bug: mem2reg/2003-04-24-MultipleIdenticalSuccessors.ll
llvm-svn: 5919
2003-04-25 00:54:58 +00:00
Chris Lattner c1f9206c8c Make the levelraise pass be well behaved w.r.t the TargetData that the current
PassMAnager provides.

llvm-svn: 5896
2003-04-24 18:25:27 +00:00
Chris Lattner 364437e6a3 Fix iterator invalidation problem
llvm-svn: 5895
2003-04-24 17:52:20 +00:00
Chris Lattner b57ed83e28 Make sure that the cloned module retains the type symbol table entries!
llvm-svn: 5894
2003-04-24 17:15:33 +00:00
Chris Lattner 0aebf8f80a Make sure to preserve endiannes and pointer size when cloning modules!
llvm-svn: 5892
2003-04-24 15:54:40 +00:00
Chris Lattner 21a8e8a2c9 Fix Bug: Linker/2003-04-23-LinkOnceLost.ll
llvm-svn: 5879
2003-04-23 18:38:39 +00:00
Chris Lattner 889f620841 Remove unnecesary &*'s
llvm-svn: 5872
2003-04-23 16:37:45 +00:00
Chris Lattner 1b094a0f2e New pass to lower switch instructions to branch instructions
llvm-svn: 5865
2003-04-23 16:23:59 +00:00
Chris Lattner 1f45f4e4d8 Minor cleanups
llvm-svn: 5863
2003-04-23 16:18:14 +00:00
Chris Lattner c6ce4dafbe Add warning when linking modules with disagreeing target properties
llvm-svn: 5845
2003-04-22 19:13:20 +00:00
Chris Lattner d36ad926f2 Preserve the new moduleID field
llvm-svn: 5835
2003-04-22 18:02:26 +00:00
Chris Lattner 4522f446c1 Fix bug: 2003-01-30-LinkerRename.ll
llvm-svn: 5828
2003-04-21 21:15:04 +00:00
Chris Lattner 4adb8536d9 Fix linking a function with qualifiers to a external function declaration:
Fixed bug: Linker/2003-04-21-Linkage.ll

llvm-svn: 5827
2003-04-21 21:07:05 +00:00
Chris Lattner 46371cc500 Fix bug where use still existed in dead code
llvm-svn: 5824
2003-04-21 19:15:26 +00:00
Chris Lattner defe5c72e8 Implement: FunctionResolve/2003-04-18-ForwardDeclGlobal.ll
llvm-svn: 5816
2003-04-19 00:15:27 +00:00
Chris Lattner 5f5d985583 Fix bug: Mem2reg/2003-04-18-DeadBlockProblem.ll
llvm-svn: 5810
2003-04-18 19:25:22 +00:00
Chris Lattner 424132aa57 Global constants CAN be external
llvm-svn: 5808
2003-04-18 04:34:29 +00:00
Chris Lattner e9f4232a70 Refactor CloneFunction to expose the new CloneBasicBlock function
llvm-svn: 5806
2003-04-18 03:50:09 +00:00
Chris Lattner de6f87ba07 New const_cast instead of c style cast
llvm-svn: 5805
2003-04-18 03:49:49 +00:00
Chris Lattner 46b3d30bf6 Change the interface to constant expressions to allow automatic folding
llvm-svn: 5793
2003-04-16 22:40:51 +00:00
Chris Lattner 379a8d2d1c Add new linkage types to support a real frontend
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner 01587d4ad1 Make help message more clear
llvm-svn: 5775
2003-04-13 03:50:14 +00:00
Chris Lattner 18b1bf67b2 * 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.

llvm-svn: 5771
2003-04-10 19:41:13 +00:00
Chris Lattner 9023155621 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.

llvm-svn: 5759
2003-03-31 19:55:43 +00:00
Chris Lattner 07f7e5d3b5 * We now preserve the no-critical-edge pass (because we cannot insert critical edges)
* Small modification to be more efficient

llvm-svn: 5757
2003-03-31 17:30:25 +00:00
Chris Lattner c42046f9f1 Move BreakCriticalEdges pass to lib/Transforms/Utils
llvm-svn: 5754
2003-03-21 21:43:19 +00:00
Chris Lattner 7fb29e19f0 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

llvm-svn: 5743
2003-03-11 00:12:48 +00:00
Chris Lattner 934a64cfa4 Implement: -A*-B == A*B
llvm-svn: 5740
2003-03-10 23:23:04 +00:00
Chris Lattner 3e327a4334 Add new transformation: // (~A | ~B) == (~(A & B))
llvm-svn: 5738
2003-03-10 23:13:59 +00:00
Chris Lattner bb74e2284a 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
}

llvm-svn: 5736
2003-03-10 23:06:50 +00:00
Chris Lattner dcf240a649 Generalize (A+c1)+c2 optimization to work with all associative operators
llvm-svn: 5733
2003-03-10 21:43:22 +00:00
Chris Lattner 3695257724 Minor change, no functionality diff
llvm-svn: 5731
2003-03-10 19:20:30 +00:00
Chris Lattner e8d6c604bb 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.

llvm-svn: 5729
2003-03-10 19:16:08 +00:00
Chris Lattner 1bbb7b6f19 Implement: (A|B)^B == A & (~B)
llvm-svn: 5728
2003-03-10 18:24:17 +00:00
Chris Lattner 569a57f9ff Fix bug: SimplifyCFG/2003-03-07-DominateProblem.ll
llvm-svn: 5722
2003-03-07 18:13:41 +00:00
Chris Lattner 235af5673b Implement %test7 in InstCombine/getelementptr.ll
llvm-svn: 5704
2003-03-05 22:33:14 +00:00
Chris Lattner e54d214fcb Implement CFGSimplify/PhiBlockMerge*.ll
llvm-svn: 5702
2003-03-05 21:36:33 +00:00
Chris Lattner 31116bafed Implement testcase CFGSimplify/EqualPHIEdgeBlockMerge.ll
llvm-svn: 5699
2003-03-05 21:01:52 +00:00
Chris Lattner 0592bb7654 Convert LICM over to use AliasSetTracker. Besides being nicer, this automatically
allows LICM to use access sizes to help alias analysis be more precise.

llvm-svn: 5693
2003-03-03 23:32:45 +00:00
Chris Lattner 50cbb9081a Eliminate tons of bogus warnings
llvm-svn: 5686
2003-03-03 19:57:46 +00:00
Chris Lattner e27406eb59 Change the mem2reg interface to accept a TargetData argument
llvm-svn: 5685
2003-03-03 17:25:18 +00:00
Chris Lattner e19a9f8ef7 Fix bug: LICM/2003-02-28-PromoteDifferentType.ll
llvm-svn: 5675
2003-02-28 19:21:40 +00:00
Chris Lattner 49eb0e3026 Fix bug I introduced yesterday :(
llvm-svn: 5669
2003-02-28 16:54:17 +00:00
Chris Lattner 32a39c26e0 Fix bug: LICM/2003-02-27-PreheaderExitNodeUpdate.ll
llvm-svn: 5667
2003-02-28 03:07:54 +00:00
Chris Lattner f2d9f94a33 Fix bug: 2003-02-27-PreheaderExitNodeUpdate.ll by updating exit node info
llvm-svn: 5664
2003-02-27 22:48:57 +00:00
Chris Lattner 10b2b055e8 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.

llvm-svn: 5659
2003-02-27 22:31:07 +00:00
Chris Lattner 1ad80e2511 Fix bug: 2003-02-27-StoreSinkPHIs.ll
llvm-svn: 5658
2003-02-27 21:59:36 +00:00
Chris Lattner 4e2fbfb4c3 * 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

llvm-svn: 5655
2003-02-27 21:50:19 +00:00
Chris Lattner dbb05b0f09 Replace assertion with a handler.
llvm-svn: 5653
2003-02-27 20:55:48 +00:00
Chris Lattner 650096a061 * 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

llvm-svn: 5652
2003-02-27 20:27:08 +00:00
Chris Lattner 71b82bb494 Convert to work with new AliasAnalysis interface by conservatively assuming all pointers are arbitrarily large accesses
llvm-svn: 5636
2003-02-26 19:28:57 +00:00
Chris Lattner 4869f3700e Rename Instruction::hasSideEffects() -> mayWriteToMemory()
llvm-svn: 5620
2003-02-24 20:48:32 +00:00
Chris Lattner 45d67d6ea7 Initial implementation of Loop invariant memory->scalar promotion
llvm-svn: 5613
2003-02-24 03:52:32 +00:00
Chris Lattner 26f159046c 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

llvm-svn: 5610
2003-02-22 23:57:48 +00:00
Chris Lattner 04cad6a010 Clean up std namespace references
llvm-svn: 5608
2003-02-22 22:25:17 +00:00
Chris Lattner 57c8d99bbd 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)

llvm-svn: 5592
2003-02-18 19:57:07 +00:00
Chris Lattner 3082c5a070 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

llvm-svn: 5587
2003-02-18 19:28:33 +00:00
Anand Shukla f8c09ee341 Changes to runtime framework
llvm-svn: 5572
2003-02-14 20:41:53 +00:00
Chris Lattner 04c9274e50 Fix a bug that cause a crash resolving questionable function calls
llvm-svn: 5567
2003-02-14 19:12:29 +00:00
Chris Lattner ade85ecf77 Fix a misunderstanding of the standard associative containers
llvm-svn: 5565
2003-02-14 05:34:36 +00:00
Chris Lattner 222e70a9fa Fix bug: LevelRaise/2003-02-13-CallRaise.ll
llvm-svn: 5562
2003-02-14 03:07:17 +00:00
Chris Lattner eaec4be9ea Revert Anand's patch which broke the build
llvm-svn: 5525
2003-02-10 15:55:50 +00:00
Anand Shukla 893dfda486 *** empty log message ***
llvm-svn: 5522
2003-02-09 21:15:36 +00:00
Chris Lattner 4ecd2d0125 Fix a problem Sumant was running into
llvm-svn: 5499
2003-02-06 22:03:46 +00:00
Chris Lattner 82723d73ba Split public interface out into header file
llvm-svn: 5472
2003-02-03 19:08:18 +00:00
Chris Lattner c44c04af44 Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
This change provides a small (3%) but consistent speedup

llvm-svn: 5460
2003-02-01 04:52:08 +00:00
Chris Lattner f683599915 Fix typo
llvm-svn: 5458
2003-02-01 04:50:59 +00:00
Chris Lattner 68f63f779c Fix a bug resolving sprintf(...) to sprintf(char*, char*, ...)
llvm-svn: 5446
2003-01-30 22:38:44 +00:00
Chris Lattner 47948952dd Actually print the function _name_ if there is a problem
llvm-svn: 5443
2003-01-30 21:33:07 +00:00
Chris Lattner 069c158bc5 * Fix linking of opaque types and their non-opaque versions
* Fix bug: Linker/2003-01-30-LinkerTypeRename.ll

llvm-svn: 5441
2003-01-30 20:53:43 +00:00
Chris Lattner 2e65dd3575 Eliminate using decls
llvm-svn: 5439
2003-01-30 19:53:34 +00:00
Chris Lattner b2d9f7dcc9 * Fix function resolution for varargs function to generate incorrect bytecode instead of crashing
* remove using decls
 CVS: ----------------------------------------------------------------------

llvm-svn: 5437
2003-01-30 18:22:32 +00:00
Chris Lattner 747f67c96f Fix levelraise/2003-01-30-ShiftCrash.ll
llvm-svn: 5435
2003-01-30 17:10:41 +00:00
Chris Lattner 6e07784692 Initial checkin of pool allocation code
llvm-svn: 5432
2003-01-29 21:12:13 +00:00
Chris Lattner d1fd7e958c Disable construction of pool allocator
llvm-svn: 5422
2003-01-24 20:13:20 +00:00
Chris Lattner 6a3586b839 Fix bug: LevelRaise/2003-01-22-GEPProblem.ll
llvm-svn: 5407
2003-01-23 02:39:10 +00:00
Chris Lattner 6fa1629c47 Fix bug: ADCE/2003-01-22-PredecessorProblem.ll
llvm-svn: 5405
2003-01-23 02:12:18 +00:00
Chris Lattner 57fd307f6d Rename include/llvm/Transforms/Instrumentation/TraceFunctions.h to Instrumentation.h
llvm-svn: 5281
2003-01-14 22:39:29 +00:00