1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

17347 Commits

Author SHA1 Message Date
Reid Spencer
1fbf856864 Fix countLeadingZeros to actually return the correct number.
Fix toString to correctly return "0" for zero valued APInts over 128 bits.

llvm-svn: 34459
2007-02-21 00:29:48 +00:00
Reid Spencer
17d47c5062 Make long addition and subtraction work. Speed things up by using internal
functions more.

llvm-svn: 34458
2007-02-20 23:40:25 +00:00
Evan Cheng
0af52bec6b This cast broke lots of tests.
llvm-svn: 34457
2007-02-20 21:30:56 +00:00
Dan Gohman
e24135a647 Fix typos in comments.
llvm-svn: 34456
2007-02-20 20:52:03 +00:00
Reid Spencer
b27fcd8cb6 Clean up variable names in operator*.
Attempt #3 for getting a portable INFINITY value.

llvm-svn: 34454
2007-02-20 20:42:10 +00:00
Reid Spencer
4caebb1af8 Use INFINITY macro from math.h instead of constructing hex floating point
constants (avoids warnings).

llvm-svn: 34452
2007-02-20 18:29:12 +00:00
Reid Spencer
80b41ab5f7 First version that can process arith.cpp test case up to 1024 bits:
1. Ensure pVal is set to 0 in each constructor.
2. Fix roundToDouble to make correct calculations and not read beyond the
   end of allocated memory.
3. Implement Knuth's "classical algorithm" for division from scratch and
   eliminate buffer overflows and uninitialized mememory reads. Document
   it properly too.
4. Implement a wrapper function for KnuthDiv which handles the 64-bit to
   32-bit conversion and back. It also implement short division for the
   n == 1 case that Knuth's algorithm can't handle.
5. Simplify the logic of udiv and urem a little, make them exit early, and
   have them use the "divide" wrapper function to perform the division
   or remainder operation.
6. Move the toString function to the end of the file, closer to where
   the division functions are located.

Note: division is still broken for some > 64 bit values, but at least it
      doesn't crash any more.
llvm-svn: 34449
2007-02-20 08:51:03 +00:00
Chris Lattner
be8f4becf4 switch ConstantFP's from ValueMap to DenseMap, which is much faster to query
and is more memory efficient.

llvm-svn: 34446
2007-02-20 07:17:17 +00:00
Chris Lattner
37a49eb48d cleanup ConstantInt to use a single DenseMap for uniquing instead of the
heavy-weight ValueMap class.  This reduces mem usage bc reading kc++ by 29K,
even though it only creates 2955 constant ints!

llvm-svn: 34445
2007-02-20 06:39:57 +00:00
Chris Lattner
b22fb7fc60 Not all managedstatics need object pointers.
llvm-svn: 34444
2007-02-20 06:18:57 +00:00
Chris Lattner
adb16a1a53 Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
llvm-svn: 34443
2007-02-20 06:11:36 +00:00
Chris Lattner
c8db23f8a7 Clean up the internals of the ConstantInt machinery
llvm-svn: 34441
2007-02-20 05:55:46 +00:00
Chris Lattner
26dc9c9dc8 simplify some code that was not llvm_shutdown safe
llvm-svn: 34440
2007-02-20 05:46:39 +00:00
Chris Lattner
bfbeedf462 remove reoptimizer-specific passes
llvm-svn: 34439
2007-02-20 05:31:49 +00:00
Chris Lattner
502e4b271a remove dead method
llvm-svn: 34436
2007-02-20 05:29:47 +00:00
Evan Cheng
f35559f26f Dead code.
llvm-svn: 34435
2007-02-20 01:29:10 +00:00
Evan Cheng
a6399ed8d6 How the heck did I forget patterns for llvm.x86.sse2.cmp.sd?
llvm-svn: 34434
2007-02-20 00:39:09 +00:00
Reid Spencer
bd46f28da7 Simplify some code by moving variable declarations into the only block that
uses them.

llvm-svn: 34432
2007-02-19 23:30:10 +00:00
Reid Spencer
78e1ec0122 Implement support for non-standard integer bit widths of any size. The
rules alignment is to pick the alignment that corresponds to the smallest
specified alignment that is larger than the bit width of the type or the
largest specified integer alignment if none are larger than the bitwidth
of the type. For the byte size, the size returned is the next larger
multiple of the alignment for that type (using the above rule). This patch
also changes bit widths from "short" to "uint32_t" to ensure there are
enough bits to specify any bit width that LLVM can handle (currently 2^23);
16-bits isn't enough.

llvm-svn: 34431
2007-02-19 22:35:00 +00:00
Evan Cheng
e4ab9c032b Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.
llvm-svn: 34428
2007-02-19 21:49:54 +00:00
Chris Lattner
f501d245c8 llvm-gcc issue fixed, revert reversal :)
llvm-svn: 34425
2007-02-19 20:01:23 +00:00
Chris Lattner
8f9dc788c1 remove warning
llvm-svn: 34424
2007-02-19 19:46:17 +00:00
Evan Cheng
936deee790 Temporarily reverting the patch. It's breaking llvm-gcc build.
llvm-svn: 34423
2007-02-19 19:23:41 +00:00
Reid Spencer
9ada0ff0ed Add a FIXME for unwritten code.
llvm-svn: 34422
2007-02-19 19:00:29 +00:00
Chris Lattner
865b2f741a remove dead methods
llvm-svn: 34419
2007-02-19 07:44:24 +00:00
Chris Lattner
b83d08ddc2 eliminate use of deprecated apis
llvm-svn: 34417
2007-02-19 07:34:47 +00:00
Reid Spencer
b27fcf3482 For PR1207:
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.

llvm-svn: 34399
2007-02-19 03:20:00 +00:00
Reid Spencer
a177605511 1. Fix some indentation and variable names in the get{Min,Max}Value methods.
2. Implement toString for power-of-2 radix without using divide and always
   printing full words. This allows hex/binary to look at the bit
   respresentation of the APInt as well as avoid bugs in divide.

llvm-svn: 34396
2007-02-18 22:29:05 +00:00
Chris Lattner
69435023b2 fix comment
llvm-svn: 34395
2007-02-18 22:10:58 +00:00
Chris Lattner
d085064847 simplify pass, delete dead gvar protos as well.
llvm-svn: 34394
2007-02-18 22:10:34 +00:00
Reid Spencer
ce1322ccf6 1. Use APINT_WORD_SIZE instead of sizeof(uint64_t)
2. Teach slt about signedness.
3. Teach roundToDouble to properly sign extend.

llvm-svn: 34391
2007-02-18 20:09:41 +00:00
Reid Spencer
035cf2fca2 1. Remove dead code (lshift function).
2. Consolidate memory allocation into just two inline functions.
3. Convert "unsigned" to uint32_t to gaurantee its size.
4. Eliminate magic constants and replace with symbolic equivalent.
5. Improve code documentation slightly.
6. Simplify the logical operator code because bitwidths must be the same.
7. Fix indentation per coding standards.
8. Use exit-early style to reduce indentation in several functions.

llvm-svn: 34389
2007-02-18 18:38:44 +00:00
Reid Spencer
19f4e9457e Make add_1 exit early if carry is 0.
Fix line breaks and 80 cols violation.
Simplify operator^= since bitwidths must be the same.

llvm-svn: 34388
2007-02-18 06:39:42 +00:00
Reid Spencer
62b55a934b Implement signed output for toString.
Fix bugs in countLeadingZeros and countTrailingZeros.

llvm-svn: 34386
2007-02-18 00:44:22 +00:00
Chris Lattner
dee1492159 temporarily revert Devang's most recent patch, which caused a large
compile-time regression in LLC.

llvm-svn: 34385
2007-02-17 23:14:24 +00:00
Reid Spencer
3390126870 Fix some bugs in division logic.
llvm-svn: 34384
2007-02-17 22:38:07 +00:00
Evan Cheng
8ac045a4b2 - Changes how function livein's are handled, they now have a start index of 0.
- When coalescing a copy MI, if its destination is "dead", propagate the
  property to the source MI's destination if there are no intervening uses.
- Detect dead function live-in's and remove them.

llvm-svn: 34383
2007-02-17 11:15:40 +00:00
Evan Cheng
259a05c582 Do not add livein's to entry MBB twice.
llvm-svn: 34382
2007-02-17 11:11:27 +00:00
Evan Cheng
d45a3628a2 Added removeLiveIn.
llvm-svn: 34381
2007-02-17 11:10:48 +00:00
Evan Cheng
35f59a6dd2 Added findRegisterDefOperand().
llvm-svn: 34380
2007-02-17 11:10:18 +00:00
Evan Cheng
897d82c747 - Use MRegister::regsOverlap().
- Allow LiveVariables to track liveness of more registers.

llvm-svn: 34379
2007-02-17 11:09:47 +00:00
Evan Cheng
8c2508f1ac Added getReservedRegs().
llvm-svn: 34376
2007-02-17 11:06:00 +00:00
Chris Lattner
e3eae5e265 Fix ixaddrs as well, allowing ppc64 to compile to:
_test2:
        li r2, 0
        lis r3, 1
        std r2, 9024(r3)
        blr

instead of:

_test2:
        lis r2, 1
        li r3, 0
        ori r2, r2, 9024
        std r3, 0(r2)
        blr

This implements CodeGen/PowerPC/LargeAbsoluteAddr.ll:test2

llvm-svn: 34373
2007-02-17 06:57:26 +00:00
Chris Lattner
50411d5be7 Compile test/CodeGen/PowerPC/LargeAbsoluteAddr.ll to:
_test:
        lis r2, 743
        li r3, 0
        stw r3, 32751(r2)
        blr

instead of:

_test:
        li r2, 0
        stw r2, 32751(48693248)
        blr

Implement support for ppc64 as well, allowing it to produce better code.

llvm-svn: 34371
2007-02-17 06:44:03 +00:00
Chris Lattner
8f3acb68cb print target nodes nicely
llvm-svn: 34369
2007-02-17 06:38:37 +00:00
Chris Lattner
871a3e6c91 Implement i/n/s constraints correctly. This fixes
test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll

llvm-svn: 34368
2007-02-17 06:00:35 +00:00
Devang Patel
953cadacbc Use inverted map to speedup collectLastUses().
llvm-svn: 34364
2007-02-17 03:53:44 +00:00
Reid Spencer
401a49c4e2 Move static functions closer to their usage.
llvm-svn: 34363
2007-02-17 03:16:00 +00:00
Reid Spencer
31731e9a99 Clean up the divide and remainder logic a bit (exit early). Use more
meaningful variable names. Add comments to document the flow.

llvm-svn: 34362
2007-02-17 02:07:07 +00:00
Dale Johannesen
960bd79f88 Fixes PR 1200
llvm-svn: 34359
2007-02-17 00:44:34 +00:00