1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

17553 Commits

Author SHA1 Message Date
Jim Laskey
dda4a7577f Handle improper cast.
llvm-svn: 34535
2007-02-23 21:45:01 +00:00
Evan Cheng
f2035d3916 Handle cases when joining live intervals of two virtual registers.
llvm-svn: 34534
2007-02-23 20:40:13 +00:00
Jim Laskey
704423b797 Don't spill LR as a callee saved register.
llvm-svn: 34533
2007-02-23 20:34:16 +00:00
Lauro Ramos Venancio
7c2f17b629 Fix stack alignment in functions with varargs.
llvm-svn: 34532
2007-02-23 20:32:57 +00:00
Chris Lattner
6334a918d8 fix an obscure and tricky bug the inliner can hit sometimes.
llvm-svn: 34531
2007-02-23 19:54:30 +00:00
Devang Patel
e0c0b3bea6 Fix thinko.
llvm-svn: 34528
2007-02-23 18:05:55 +00:00
Devang Patel
06b8983669 Loop passes are set up to accept pointer.
llvm-svn: 34527
2007-02-23 17:53:17 +00:00
Evan Cheng
bdc95679a3 Mark livein registers as being in used.
llvm-svn: 34525
2007-02-23 08:41:19 +00:00
Dale Johannesen
544968d665 rewrite of constant islands
llvm-svn: 34523
2007-02-23 05:02:36 +00:00
Evan Cheng
2d4b1cb0ca Added -march=thumb; removed -enable-thumb.
llvm-svn: 34521
2007-02-23 03:14:31 +00:00
Evan Cheng
3ddb5d1018 80 col. violation.
llvm-svn: 34520
2007-02-23 03:03:16 +00:00
Anton Korobeynikov
b7350e191e External weak linkage is supported by recent binutils on mingw32.
llvm-svn: 34519
2007-02-23 01:58:50 +00:00
Reid Spencer
3573b012d3 1. Fix a carry out problem in add if destination and x point to the same
memory (as done in fromString).
2. Implement Knuth divide more closely to what is recommended in his book.
3. Fix computation of the remainder for Knuth Divide (bad shifting).
4. Remove some cruft from the file

llvm-svn: 34518
2007-02-23 01:57:13 +00:00
Evan Cheng
b8a95dcdbf A spill kills the register being stored. But it is later being reused by spiller, its live range has to be extended.
llvm-svn: 34517
2007-02-23 01:13:26 +00:00
Evan Cheng
92429f4cca First potential client of register scavenger.
llvm-svn: 34516
2007-02-23 01:11:26 +00:00
Evan Cheng
da51cf986a By default, spills kills the register being stored.
llvm-svn: 34515
2007-02-23 01:10:04 +00:00
Evan Cheng
bd3219f5bf Add option to turn on register scavenger; By default, spills kills the register being stored.
llvm-svn: 34514
2007-02-23 01:09:11 +00:00
Evan Cheng
387f1c2bdf Use findRegisterUseOperand to find a kill of particular register.
llvm-svn: 34512
2007-02-23 01:04:26 +00:00
Evan Cheng
f9ef2bfd8a Initial check in of register scavenger. Its only current functionality is tracking live registers per MBB.
llvm-svn: 34511
2007-02-23 01:01:19 +00:00
Devang Patel
46cad14ab8 Teach LoopPass to assign itself one Loop Pass Manager.
llvm-svn: 34510
2007-02-23 00:36:57 +00:00
Devang Patel
9a7b18fa3d Add facility that allows LoopPass to re-insert a loop into
Loop Pass Manager's queue.

llvm-svn: 34509
2007-02-23 00:16:44 +00:00
Devang Patel
bbfd00e658 Add LPPassManager interface that LoopPass can use to skip
rest of the passes in the queue for a loop.

llvm-svn: 34508
2007-02-23 00:10:16 +00:00
Chris Lattner
f8d7232532 remove obsolete file
llvm-svn: 34506
2007-02-22 23:48:43 +00:00
Devang Patel
d7448faaed Populate and walk loop queue.
llvm-svn: 34505
2007-02-22 23:45:15 +00:00
Devang Patel
b170ebf833 Add LoopQueue. This is used by loop pass manager to manage loop nest.
llvm-svn: 34504
2007-02-22 23:30:07 +00:00
Evan Cheng
68e7fe47f6 Remove unnecessary isKill properties if a live range has been lengthened due to coalescing.
llvm-svn: 34503
2007-02-22 23:03:39 +00:00
Jim Laskey
322a2e8899 Update comment.
llvm-svn: 34502
2007-02-22 18:51:19 +00:00
Jim Laskey
1dd7563e22 Missing end of abbreviations - correction
llvm-svn: 34501
2007-02-22 18:48:52 +00:00
Jim Laskey
e177fd58b3 Missing end of abbreviations.
llvm-svn: 34500
2007-02-22 18:22:42 +00:00
Jim Laskey
f29366635a Need to init.
llvm-svn: 34499
2007-02-22 18:04:49 +00:00
Jim Laskey
8c79f0f892 Remove isAccessable.
llvm-svn: 34497
2007-02-22 16:39:03 +00:00
Jim Laskey
25993e18e6 Use exception flag.
llvm-svn: 34496
2007-02-22 16:22:15 +00:00
Jim Laskey
8ddfb7141b Revert changes for a simplier solution.
llvm-svn: 34495
2007-02-22 16:21:18 +00:00
Jim Laskey
4990356454 Remove assertion.
llvm-svn: 34494
2007-02-22 16:12:17 +00:00
Jim Laskey
f6f24530c0 Tighten up error checking of args.
llvm-svn: 34493
2007-02-22 16:10:05 +00:00
Jim Laskey
dccc6d3a82 Handle lowering invoke to call correctly.
llvm-svn: 34492
2007-02-22 15:38:06 +00:00
Jim Laskey
655bea55fe Simplify lowering and selection of exception ops.
llvm-svn: 34491
2007-02-22 15:37:19 +00:00
Jim Laskey
b57ee1fc37 Simplify lowering and selection of exception ops.
llvm-svn: 34488
2007-02-22 14:56:36 +00:00
Devang Patel
aabb87cffe Add Loop Pass Manager.
llvm-svn: 34487
2007-02-22 08:56:17 +00:00
Reid Spencer
cbff120eeb When converting from 64 to 32-bits, use the actual number of words to
extract the value, not the number of words implied by the active bits.
This fixes numerous, but not all divide bugs.

llvm-svn: 34484
2007-02-22 00:58:45 +00:00
Reid Spencer
d51b03d452 Fix countLeadingZeros in the case that the bitwidth evenly divides the
word size. This fixes all reads of uninitialized data (buffer over read)
and makes APInt.cpp memory clean, per valgrind. The only remaining
problem is division in a few cases.

llvm-svn: 34483
2007-02-22 00:22:00 +00:00
Jim Laskey
6a937ad320 Support to provide exception and selector registers.
llvm-svn: 34482
2007-02-21 22:54:50 +00:00
Jim Laskey
58eaac9160 Selection and lowering for exception handling.
llvm-svn: 34481
2007-02-21 22:53:45 +00:00
Jim Laskey
2bbd4312c0 Itanium ABI exception handing support.
llvm-svn: 34480
2007-02-21 22:49:50 +00:00
Jim Laskey
a5ee0bbf17 Exception handling support.
llvm-svn: 34479
2007-02-21 22:48:45 +00:00
Jim Laskey
bce43df323 Add support for changes in DwarfWriter.
llvm-svn: 34478
2007-02-21 22:47:38 +00:00
Jim Laskey
d1e09aa74a Add TAI field for exception table section.
llvm-svn: 34477
2007-02-21 22:43:40 +00:00
Jim Laskey
b56b6a7042 Make branch folding behave in the presence of landing pads.
llvm-svn: 34476
2007-02-21 22:42:20 +00:00
Jim Laskey
1ac1a19f01 Allow for live in registers for eh landing pads.
llvm-svn: 34475
2007-02-21 22:41:17 +00:00
Jim Laskey
534bc5a9a3 Add structures used for collecting eh information.
llvm-svn: 34473
2007-02-21 22:38:31 +00:00
Evan Cheng
0e7be3c4e0 ELF / PIC requires GOT be in the EBX register during calls via PLT GOT pointer.
Add implicit uses of EBX to calls to ensure liveintervalanalysis does not treat
the GOT in EBX move as dead upon definition.
This should fix PR1207.

llvm-svn: 34470
2007-02-21 21:18:14 +00:00
Reid Spencer
df5fe8163d Reorganize some code to make it clearer, avoid a few uninitialized memory
reads, and reduce the number of temporary APInt instances we construct.

llvm-svn: 34467
2007-02-21 08:21:52 +00:00
Reid Spencer
95874f6bc9 Fix the carry in addition.
llvm-svn: 34465
2007-02-21 05:44:56 +00:00
Reid Spencer
c4662ad089 1. Add a dump() method for faster debugging.
2. Change 0 initialization of union to larger component so all is zeroed.
3. Fix the borrow logic in subtraction so it works for > 128 bits.
4. Rewrite fromString to use a simpler but correct algorithm and also to
   not set the bit width contrary to the user's request.
5. Optimize toString a bit by making it only do one Knuth divide per
   iteration instead of two.

With these changes, all arithmetic passes (verified by pari/GP) up to
1024 bits except for certain division cases.

llvm-svn: 34463
2007-02-21 03:55:44 +00:00
Evan Cheng
517ca88cdd Out of bound reference.
llvm-svn: 34461
2007-02-21 02:27:39 +00:00
Evan Cheng
0003c692cc Use BitVector instead. No functionality change.
llvm-svn: 34460
2007-02-21 02:22:03 +00:00
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
Chris Lattner
14496ddfd4 Do not dereference invalid ranges. Generalize targetdata alignment model.
This fixes the UnitTests/Vector/sumarray-dbl regressions.

llvm-svn: 34358
2007-02-17 00:41:42 +00:00
Reid Spencer
9c5efbcef2 Fix bugs introduced by constructor parameter order change.
llvm-svn: 34357
2007-02-17 00:18:01 +00:00
Chris Lattner
09f6f520bf Fix CodeGen/PowerPC/2007-02-16-AlignPacked.ll
llvm-svn: 34356
2007-02-16 23:11:51 +00:00
Reid Spencer
b175f70613 Remove an unnecessary predicate.
Patch by Scott Michel.

llvm-svn: 34354
2007-02-16 22:42:40 +00:00
Reid Spencer
d22266f456 Review changes:
1. Function style changes.
2. 80-col violations.
3. Better names for things.
4. Arrange constructors so they all take bit width first.
5. Add named signed and unsigned comparison functions and remove the
   corresponding operators.
6. Remove operator&& and operator|| but provide a getBoolValue function which
   converts to bool as comparison against 0. This allows the normal && and
   || operators to be used as if (X.getBoolValue() && Y.getBoolValue())

Note: this still doesn't function 100% yet. I'm working on the bugs now.
llvm-svn: 34353
2007-02-16 22:36:51 +00:00
Chris Lattner
8dd1ed7465 simplify some code, ensure that packed structures get abi alignment of 1.
llvm-svn: 34352
2007-02-16 22:25:34 +00:00
Chris Lattner
3beba5539b fix incorrect encoding of vminsw.
llvm-svn: 34351
2007-02-16 21:20:09 +00:00
Anton Korobeynikov
87e945c62d Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688

llvm-svn: 34349
2007-02-16 19:11:07 +00:00
Evan Cheng
5b8b96e9de Print <dead> def operands.
llvm-svn: 34343
2007-02-16 09:49:18 +00:00
Evan Cheng
64185104f1 Add live-ins to every BB.
llvm-svn: 34342
2007-02-16 09:05:02 +00:00
Andrew Lenharth
d2c65176e6 fix build
llvm-svn: 34339
2007-02-16 02:25:55 +00:00
Andrew Lenharth
ed90594898 This was done recently
llvm-svn: 34338
2007-02-16 02:11:59 +00:00
Dale Johannesen
b1a4813b73 test commit (blank line)
llvm-svn: 34337
2007-02-16 01:54:53 +00:00
Chris Lattner
134ae17654 make mayWriteToMemory a non-virtual function
llvm-svn: 34334
2007-02-15 23:15:00 +00:00
Chris Lattner
9572ded44a convert more vectors to smallvectors, 2.8% speedup
llvm-svn: 34333
2007-02-15 22:52:10 +00:00
Chris Lattner
fa8782ac3f change some vectors to smallvectors. This speeds up instcombine on 447.dealII
by 5%.

llvm-svn: 34332
2007-02-15 22:48:32 +00:00
Reid Spencer
c5814f843c For PR1195:
PACKED_ALIGN -> VECTOR_ALIGN

llvm-svn: 34330
2007-02-15 22:07:05 +00:00
Chris Lattner
9084bb5471 rewrite Value::takeName to take advantage of the new symtab stuff. This
causes it to require no allocations and no symtab lookups in the common
case.  This speeds up instcombine 9.2% on 447.dealII.

llvm-svn: 34324
2007-02-15 20:01:43 +00:00
Chris Lattner
8b185bf778 switch an std::set to a SmallPtr set, this speeds up instcombine by 9.5%
on 447.dealII

llvm-svn: 34323
2007-02-15 19:41:52 +00:00
Chris Lattner
5d0b16f797 Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string.  This speeds up instcombine on 447.dealII by 5%.

llvm-svn: 34318
2007-02-15 19:17:16 +00:00
Chris Lattner
fbd6928545 Add a new Value::getNameStr method, which is preferred over getName.
llvm-svn: 34310
2007-02-15 18:53:54 +00:00
Reid Spencer
af246fde76 For PR1202:
Make sure we found an existing Alignment before overwriting it.

llvm-svn: 34308
2007-02-15 18:34:36 +00:00
Chris Lattner
c3d976fb65 fix indentation
llvm-svn: 34307
2007-02-15 18:19:15 +00:00
Chris Lattner
c4bca38e6e Apply B Scott Michel's patch for PR1184, which improves diagnostics in an
abort case.

llvm-svn: 34306
2007-02-15 18:17:56 +00:00
Zhou Sheng
9868d8d7db Fix some buges:
1. Make getMinValue() returns the right value.
2. Fix the ByteSwap() crash problem.
3. Make Postfix increment work correctly.
4. Fix some bugs in LogBase2, Hi/LoBits and UDiv.

llvm-svn: 34304
2007-02-15 06:36:31 +00:00
Evan Cheng
28eaad250f Use BitVector instead of vector<bool> which can be extremely slow.
llvm-svn: 34302
2007-02-15 05:59:24 +00:00
Reid Spencer
e7ff3305d6 For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.

llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer
a0a2689760 For PR1195:
Change a comment: Packed Type -> Vector Type

llvm-svn: 34299
2007-02-15 03:11:50 +00:00
Reid Spencer
21061dd3df Change an assert that mentions Packed Type -> Vector Type.
llvm-svn: 34298
2007-02-15 03:11:20 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer
ca25d2b273 Fixed packed structure breakage from earlier TargetData patch; applied
Chris Lattner's code style suggestions.

Patch by Scott Michel!

llvm-svn: 34292
2007-02-15 02:11:06 +00:00
Chris Lattner
f9ef252d00 fix a warning
llvm-svn: 34272
2007-02-14 07:34:56 +00:00
Chris Lattner
0c973a02d9 Refix CodeGen/Generic/switch-lower.ll. In contrast to my previous patch,
this doesn't miscompile lots of programs :)

llvm-svn: 34268
2007-02-14 07:18:16 +00:00
Chris Lattner
fc2686da00 From Dan Gohman:
While preparing http://llvm.org/PR1198 I noticed several asserts
protecting unprepared code from i128 types that weren't actually failing
when they should because they were written as assert("foo") instead of
something like assert(0 && "foo"). This patch fixes all the cases that a
quick grep found.

llvm-svn: 34267
2007-02-14 06:20:04 +00:00
Chris Lattner
5cece73ec8 Generalize TargetData strings, to support more interesting forms of data.
Patch by Scott Michel.

llvm-svn: 34266
2007-02-14 05:52:17 +00:00
Reid Spencer
5e1e7c4e59 Use brute-force algorithm for to_string. It doesn't have to be efficient
at this point, it just needs to work so we can test things reliably.

llvm-svn: 34262
2007-02-14 02:52:25 +00:00
Chris Lattner
48b7ed420c better support for i128.
llvm-svn: 34258
2007-02-13 23:57:55 +00:00
Chris Lattner
1b57f8bbdf implement expand of truncate. This allows truncates from i128 to i64 to
be supported on 32-bit hosts.

llvm-svn: 34257
2007-02-13 23:55:16 +00:00
Chris Lattner
c305c08493 Fix PR1198, by adding initial i128 support. Patch by Dan Gohman.
llvm-svn: 34256
2007-02-13 23:41:38 +00:00
Andrew Lenharth
f4bbe64c83 Well this isn't as ugly and it works better. At least gcc bootstraps again
llvm-svn: 34254
2007-02-13 23:41:16 +00:00
Reid Spencer
80ac48cfdf Make some minor improvements to APInt:
1. Make all the operators use uppercase
2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is
   redundant.
3. Turn the class on for compilation.

llvm-svn: 34253
2007-02-13 22:41:58 +00:00
Chris Lattner
67bdb3aae8 add a note
llvm-svn: 34249
2007-02-13 21:44:43 +00:00
Chris Lattner
656f6a6fdd revert my previous switch lowering change, which miscompiles a few programs.
This will break a dj test until I have time to investigate.

llvm-svn: 34247
2007-02-13 20:09:07 +00:00
Lauro Ramos Venancio
81f86314e6 Add space between // and the comment.
llvm-svn: 34246
2007-02-13 20:06:15 +00:00
Lauro Ramos Venancio
ff9f78e230 Add ABI information to ARM subtarget.
llvm-svn: 34245
2007-02-13 19:52:28 +00:00
Lauro Ramos Venancio
7465000f94 Add a space between // and the comment.
llvm-svn: 34244
2007-02-13 18:10:13 +00:00
Lauro Ramos Venancio
02ba8f20e3 According to ARM EABI, 8-bytes function arguments must be 8-bytes aligned.
llvm-svn: 34241
2007-02-13 14:07:13 +00:00
Lauro Ramos Venancio
4aecadf112 Add "original alignment" to function arguments flags.
llvm-svn: 34240
2007-02-13 13:50:08 +00:00
Chris Lattner
4534d3fc6e Switch UnaryOperators to default to passing names up by const char* when possible.
This speeds up bcreading by 1.5%.

llvm-svn: 34233
2007-02-13 07:54:42 +00:00
Chris Lattner
cc543b031e add a setName variant that takes a null-terminated string. This can be
used to avoid std::string allocations in common cases.

llvm-svn: 34232
2007-02-13 07:53:34 +00:00
Chris Lattner
2f015c1ccf Use a SmallVector to reduce heap traffic. This speeds up bcreader 10%
llvm-svn: 34231
2007-02-13 07:28:20 +00:00
Chris Lattner
d7f09146b8 now that we can pass ranges into CallInst ctors, eliminate vector heap traffic
llvm-svn: 34229
2007-02-13 06:30:42 +00:00
Chris Lattner
326271ee46 eliminate instruction ctors that take vectors.
llvm-svn: 34228
2007-02-13 06:22:32 +00:00
Chris Lattner
8038c3c99e eliminate vector-related allocations
llvm-svn: 34223
2007-02-13 06:01:22 +00:00
Chris Lattner
68420e1d7d eliminate a bunch of vector-related heap traffic
llvm-svn: 34222
2007-02-13 05:58:53 +00:00
Chris Lattner
2ad52d5242 eliminate use of vector ctors
llvm-svn: 34221
2007-02-13 05:53:56 +00:00
Chris Lattner
ce2cc6e404 Eliminate use of ctors that take vectors.
llvm-svn: 34219
2007-02-13 02:10:56 +00:00
Chris Lattner
f2d767bbd7 stop passing vector into ctors
llvm-svn: 34218
2007-02-13 01:53:54 +00:00
Evan Cheng
21a7c64466 Allow any MachineBasicBlock (not just the entry block) to have live-in physical
registers. Make sure liveinterval analysis is correctly creating live ranges
for them.

llvm-svn: 34217
2007-02-13 01:30:55 +00:00
Chris Lattner
9ea0b706d9 Fix switch lowering to order cases in zext order, which is how we emit the
comparisons.  This fixes an infinite loop on CodeGen/Generic/switch-lower.ll
and PR1197

llvm-svn: 34216
2007-02-13 01:05:56 +00:00
Chris Lattner
bc384d8d50 Add invokeinst and callinst ctors that don't take vectors.
llvm-svn: 34214
2007-02-13 01:04:01 +00:00
Chris Lattner
94ce3e4550 remove some dead methods.
llvm-svn: 34213
2007-02-13 00:58:44 +00:00
Chris Lattner
c30715d6b4 regenerate
llvm-svn: 34212
2007-02-13 00:58:01 +00:00
Chris Lattner
b1a1662fc6 eliminate use of methods that take vectors as args
llvm-svn: 34211
2007-02-13 00:57:40 +00:00
Chris Lattner
b73ffa20af stop using methods that take vectors.
llvm-svn: 34205
2007-02-12 22:56:41 +00:00
Chris Lattner
97739dcbca more notes
llvm-svn: 34204
2007-02-12 21:20:26 +00:00
Chris Lattner
216d889852 add a note
llvm-svn: 34202
2007-02-12 20:26:34 +00:00
Zhou Sheng
7b47556f5c 1. Make APInt::shl work correctly and more efficiently.
2. Add functions to support the numberical conversion between APInt and
   double/float.

llvm-svn: 34201
2007-02-12 20:02:55 +00:00
Chris Lattner
70af9b98ec avoid creating a temporary string when reading the symbol table for a
module.  This speeds up the bcreader 11%.

llvm-svn: 34198
2007-02-12 18:53:43 +00:00
Chris Lattner
a48bf1bdbf Add new setName accessor which doesn't require creating a string.
llvm-svn: 34197
2007-02-12 18:52:59 +00:00
Chris Lattner
5a58a65c10 Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.

llvm-svn: 34193
2007-02-12 05:18:08 +00:00
Chris Lattner
88ba48fcec regenerate
llvm-svn: 34188
2007-02-11 21:40:10 +00:00
Chris Lattner
26a13f469e add #include
llvm-svn: 34187
2007-02-11 21:39:35 +00:00
Chris Lattner
ce3f5f906a Add support for removing elements out of StringMap.
llvm-svn: 34185
2007-02-11 20:58:00 +00:00
Chris Lattner
3a9d38035f Replace the ugly FindValue method with STL-like find methods.
llvm-svn: 34183
2007-02-11 19:49:41 +00:00
Chris Lattner
676ffe699d fix uninitialized variable
llvm-svn: 34182
2007-02-11 19:12:18 +00:00
Chris Lattner
f1e2e9e259 remove support for stringmap visitors now that iterators exist.
llvm-svn: 34180
2007-02-11 08:22:15 +00:00
Chris Lattner
e98f4bc0ce add support for iterators.
llvm-svn: 34179
2007-02-11 08:20:35 +00:00
Chris Lattner
bbd6f81f3d simplify code by using Value::takeName
llvm-svn: 34177
2007-02-11 01:37:51 +00:00
Chris Lattner
b131b3e07e Simplify code by using value::takename
llvm-svn: 34176
2007-02-11 01:23:03 +00:00
Chris Lattner
fc50a34437 simplify name juggling through the use of Value::takeName.
llvm-svn: 34175
2007-02-11 01:08:35 +00:00
Chris Lattner
50ea7bc913 add an optimization for the case where the src has no name
llvm-svn: 34174
2007-02-11 01:04:09 +00:00
Nick Lewycky
b994bafc0f Fix comments to match names of functions.
llvm-svn: 34173
2007-02-11 00:58:49 +00:00
Chris Lattner
8aafcbb579 simplify this code by using value::takename
llvm-svn: 34172
2007-02-11 00:39:38 +00:00
Chris Lattner
e8dd3c90f1 add a helper method: Value::takeName
llvm-svn: 34171
2007-02-11 00:37:27 +00:00
Reid Spencer
52b0535551 Undo the last patch. It slowed down bcwriter by 1.8% but only sped up
the bc reader by 0.8%. Deemed "not worth it"

llvm-svn: 34169
2007-02-11 00:03:39 +00:00
Chris Lattner
058257bdd2 Switch some std::vector's to SmallVectors. This speeds up -load-vn -gcse
by 6% on tramp3d.

llvm-svn: 34167
2007-02-10 22:15:31 +00:00
Chris Lattner
8dbca590f4 modify CheckGEPInstructions to take a pointer and size instead of a vector.
llvm-svn: 34166
2007-02-10 22:12:53 +00:00
Reid Spencer
8594672a45 Assert that elements of packed are pointer/float/opaque.
llvm-svn: 34165
2007-02-10 22:02:45 +00:00
Chris Lattner
d47f00d794 eliminate use of TargetData::getIndexedOffset that takes a vector
llvm-svn: 34163
2007-02-10 20:35:22 +00:00
Chris Lattner
fd0d12756d completely eliminate a temporary vector
llvm-svn: 34162
2007-02-10 20:33:15 +00:00
Chris Lattner
7223d491cb eliminate temporary vectors.
llvm-svn: 34161
2007-02-10 20:31:59 +00:00
Chris Lattner
d079b34aa0 Switch LayoutInfo to be a DenseMap instead of an std::map. This speeds up
-load-vn -gcse by 2.3%.

llvm-svn: 34160
2007-02-10 20:26:17 +00:00
Chris Lattner
8fa88af5f0 add a typedef
llvm-svn: 34159
2007-02-10 20:18:06 +00:00