1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
Commit Graph

3070 Commits

Author SHA1 Message Date
Chris Lattner
b5fc5522fb Add support for tracking whether a module is 64/32 bit and big/little endian
Also add a moduleID field which can be used for diagnostics

llvm-svn: 5834
2003-04-22 18:02:04 +00:00
Misha Brukman
c06beb4c03 It's "necessary" to spell "necessarily" correctly.
llvm-svn: 5833
2003-04-22 17:54:23 +00:00
Chris Lattner
b315dbe98a Make stderr, stdout, stdin work with LLI
llvm-svn: 5832
2003-04-21 22:44:36 +00:00
Chris Lattner
dd3c1121d0 Fix wierd idiom
llvm-svn: 5831
2003-04-21 22:43:32 +00:00
Chris Lattner
2fc856e8b6 fprintf CAN take exactly 2 args
llvm-svn: 5830
2003-04-21 22:43:20 +00:00
Chris Lattner
a48a91d095 Add support for a simple constantexpr: cast of one ptr type to another
llvm-svn: 5829
2003-04-21 21:33:44 +00:00
Chris Lattner
21967df20a Fix bug: 2003-01-30-LinkerRename.ll
llvm-svn: 5828
2003-04-21 21:15:04 +00:00
Chris Lattner
6da72fd92a 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
a489b529fe Fix bug where use still existed in dead code
llvm-svn: 5824
2003-04-21 19:15:26 +00:00
Chris Lattner
c1da4513e0 Initial support for reading standard .a files
llvm-svn: 5820
2003-04-19 21:45:34 +00:00
Chris Lattner
8b1c27945b Add support for reading unaligned bytecode buffers
llvm-svn: 5819
2003-04-19 21:45:17 +00:00
Chris Lattner
869d67b885 Remove arbitrary limitation
llvm-svn: 5818
2003-04-19 00:50:37 +00:00
Chris Lattner
5931df28b7 Implement: FunctionResolve/2003-04-18-ForwardDeclGlobal.ll
llvm-svn: 5816
2003-04-19 00:15:27 +00:00
Chris Lattner
61d704329e Fix bug: Mem2reg/2003-04-18-DeadBlockProblem.ll
llvm-svn: 5810
2003-04-18 19:25:22 +00:00
Chris Lattner
08b5392e07 Global constants CAN be external
llvm-svn: 5808
2003-04-18 04:34:29 +00:00
Chris Lattner
8453f87c9c Fix a big bad bug I checked in yesterday :(
llvm-svn: 5807
2003-04-18 04:11:56 +00:00
Chris Lattner
f171f30deb Refactor CloneFunction to expose the new CloneBasicBlock function
llvm-svn: 5806
2003-04-18 03:50:09 +00:00
Chris Lattner
5403f79db0 New const_cast instead of c style cast
llvm-svn: 5805
2003-04-18 03:49:49 +00:00
Chris Lattner
32af8814ce Allow hexadecimal integer constants to be used
llvm-svn: 5802
2003-04-17 22:17:32 +00:00
Chris Lattner
eacb88d2e9 Don't build constantexprs that could be folded
llvm-svn: 5801
2003-04-17 19:24:48 +00:00
Chris Lattner
719fd86bdc Allow constant folding of GEP instructions, even if we don't do a whole lot yet.
Fold ConstExpr casts better
castToPointer shouldn't be forced to return a constantpointer

llvm-svn: 5800
2003-04-17 19:24:18 +00:00
Chris Lattner
23615ca1b5 Fix bug: IndVarSimplify/2003-04-16-ExprAnalysis.ll
llvm-svn: 5795
2003-04-16 22:50:19 +00:00
Chris Lattner
bb00f755ed Change the interface to constant expressions to allow automatic folding
llvm-svn: 5793
2003-04-16 22:40:51 +00:00
Chris Lattner
545bebf00c Add support to the bytecode reader/writer for the new linkage types
llvm-svn: 5790
2003-04-16 21:16:05 +00:00
Chris Lattner
a9a0e4e780 Add code to verify correctly linkages
llvm-svn: 5788
2003-04-16 20:42:40 +00:00
Chris Lattner
fa4f750f3e Add new linkage types to support a real frontend
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner
343a212f2b Improve the efficiency and cleanup writing a bit
llvm-svn: 5782
2003-04-16 20:20:02 +00:00
Chris Lattner
638d4b0f28 Don't allow declaring an external internal variable
llvm-svn: 5781
2003-04-16 18:13:57 +00:00
Chris Lattner
f5ce9b1a74 Fix bug: Assember2003-04-15-ConstantInitAssertion.llx
llvm-svn: 5777
2003-04-15 16:09:31 +00:00
Chris Lattner
fc93e77390 Make help message more clear
llvm-svn: 5775
2003-04-13 03:50:14 +00:00
Chris Lattner
0ac391e6c8 * 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
Misha Brukman
127a46eeba Fixed compilation errors, command-line argument declarations, cleaned up code to
look nicer and removed useless stuff.

Also renamed a few variables, moved them into namespaces, converted outputting
to a file into a print to std::cerr with a DEBUG() guard, as all passes should
do anyway.

No functional changes have been made. However, this code now compiles.

llvm-svn: 5769
2003-04-10 19:19:23 +00:00
Misha Brukman
1db4cefc28 Made the code readable:
* Lines must be wrapped at 80 chars. This is a hard limit.
* Consistent style on functions, braces, if, for, etc. Code must be readable.

No functional changes have been made, even though I added a new typedef.

llvm-svn: 5768
2003-04-09 21:51:34 +00:00
Guochun Shi
478533bb86 change the include file names and some class names to make it compile
llvm-svn: 5764
2003-04-06 23:56:19 +00:00
Chris Lattner
7bfad931b8 Implement scanf and fix sscanf to actually endian swap the results correctly
llvm-svn: 5763
2003-03-31 22:12:37 +00:00
Chris Lattner
731913bab3 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
44370a85d9 * 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
Guochun Shi
9ba51857c1 *** empty log message ***
llvm-svn: 5755
2003-03-27 17:57:44 +00:00
Chris Lattner
b215db890f Move BreakCriticalEdges pass to lib/Transforms/Utils
llvm-svn: 5754
2003-03-21 21:43:19 +00:00
Chris Lattner
8696069d85 Add helper method
llvm-svn: 5753
2003-03-21 21:41:02 +00:00
Chris Lattner
03fab572fb * Change the order that globals and constants are processed in
* Add support for implicit zero initializers

llvm-svn: 5750
2003-03-19 20:57:22 +00:00
Chris Lattner
839f5a9077 Changes to the V2 bytecode format:
- Null values are implicitly encoded instead of explicitly, this makes
    things more compact!
  - More compactly represent ConstantPointerRefs
  - Bytecode files are represented as:
      Header|GlobalTypes|GlobalVars/Function Protos|Constants|Functions|SymTab
    instead of
      Header|GlobalTypes|Constants|GlobalVars/Function Protos|Functions|SymTab
    which makes a lot of things simpler.

Writer changes:
  - We now explictly encode versioning information in the bytecode files.
  - This allows new code to read bytecode files produced by old code, but
    new bytecode files can have enhancements such as the above.  Although this
    makes the reader a bit more complex (having to deal with old formats), the
    writer only needs to be able to produce the most recent version.

llvm-svn: 5749
2003-03-19 20:56:46 +00:00
Chris Lattner
dd194d3844 * Bug fixes:
- Fix problems where the constant table would not get updated when
    resolving constants causes other constants to change.

Changes to the V2 bytecode format
  - Null values are implicitly encoded instead of explicitly, this makes
    things more compact!
  - More compactly represent ConstantPointerRefs
  - Bytecode files are represented as:
      Header|GlobalTypes|GlobalVars/Function Protos|Constants|Functions|SymTab
    instead of
      Header|GlobalTypes|Constants|GlobalVars/Function Protos|Functions|SymTab
    which makes a lot of things simpler.

Changes to the reader:
  - Function loading code is much simpler.  We now no longer make function
    PlaceHolderHelper objects to be replaced with real functions.

llvm-svn: 5748
2003-03-19 20:54:26 +00:00
Chris Lattner
c51d7871ee 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
6eededc41f Implement: -A*-B == A*B
llvm-svn: 5740
2003-03-10 23:23:04 +00:00
Chris Lattner
715b592fc4 Add new transformation: // (~A | ~B) == (~(A & B))
llvm-svn: 5738
2003-03-10 23:13:59 +00:00
Chris Lattner
0f5ab645eb 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
5e5950b7e0 Fix ConstantUInt::isAllOnesValue
llvm-svn: 5734
2003-03-10 22:39:02 +00:00
Chris Lattner
3eca9aaa0a Generalize (A+c1)+c2 optimization to work with all associative operators
llvm-svn: 5733
2003-03-10 21:43:22 +00:00
Chris Lattner
9dec4368c0 Minor change, no functionality diff
llvm-svn: 5731
2003-03-10 19:20:30 +00:00