Commit Graph

4955 Commits

Author SHA1 Message Date
Reid Spencer
84b4eeccc7 getActiveWords should return the number of words, not the index of the
highest active words. Increment its result by one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:20:49 +00:00
Evan Cheng
36230cdda4 Make requiresRegisterScavenging determination on a per MachineFunction basis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:59:19 +00:00
Evan Cheng
37f15a6d48 MRegisterInfo disowns RegScavenger. It's immutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:17:36 +00:00
Reid Spencer
9d3c519233 Add some syntactic sugar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 23:47:33 +00:00
Evan Cheng
898218cc5e Some more code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:58:43 +00:00
Evan Cheng
8cab162e03 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:10:52 +00:00
Reid Spencer
681dcd14e9 Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize
the bit width of negative numbers by computing the minimum bit width for a
negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:59:26 +00:00
Evan Cheng
bb6fb3357d RegScavenger interface change to make it more flexible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:09:48 +00:00
Evan Cheng
171eed5334 Let MRegisterInfo owns RegScavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:08:07 +00:00
Evan Cheng
659ba970e3 Pass IsImp, IsKill, and IsDead to ChangeToRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:06:57 +00:00
Reid Spencer
66ed1099ff Improve APInt interface:
1. Add unsigned and signed versions of methods so a "bool" argument doesn't
   need to be passed in.
2. Make the various getMin/getMax functions all be inline since they are
   so simple.
3. Simplify sdiv and srem code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34680 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 20:24:31 +00:00
Reid Spencer
409f092766 Allow the RoundDoubleToAPInt function to specify a width to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34672 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 18:22:31 +00:00
Devang Patel
84da80d10b Make getPassManagerType() const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 15:00:39 +00:00
Chris Lattner
13513b7a50 Minor refactoring of CC Lowering interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 05:13:54 +00:00
Chris Lattner
362e98a5f5 move CC Lowering stuff to its own public interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 04:43:02 +00:00
Evan Cheng
ed570dedad forward() should not increment internal iterator. Its client may insert instruction between now and next forward() call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 01:58:48 +00:00
Reid Spencer
532d0ce208 For PR1205:
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 23:54:03 +00:00
Evan Cheng
edeffb37dc Joining an interval with a dead copy instruction. Shorten the live range to the last use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34645 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 21:37:37 +00:00
Reid Spencer
946bca5bae Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34643 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 21:06:05 +00:00
Reid Spencer
31a81f0190 1. Split getValue() into getSExtValue() and getZExtValue() to match
ConstantInt better.
2. Add a getHashValue() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34641 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 20:57:12 +00:00
Reid Spencer
f99705e898 Implement inline methods that make transition of ConstantInt to use APInt
easier to comprehend and might be useful elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34635 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 17:50:32 +00:00
Reid Spencer
ebf4ebd691 Make isNegative() a const function since it doesn't modify the APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34630 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 07:45:40 +00:00
Reid Spencer
dcffd5c3d9 Add an isNegative method to determine if the APInt's value is negative.
This is much less expensive than a test against zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34619 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 01:20:59 +00:00
Chris Lattner
1cf5574636 Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
exprs hanging off a global, even if the global is not otherwise dead.  This
requires some tricky iterator gymnastics.

This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 21:06:13 +00:00
Reid Spencer
c68c2243dc Fix clearUnusedBits to not depend on "undefined behavior" of >> operator
when the bit size is equal to the word size. This happens to work out okay
on x86, but might not on other platforms. The change just detects when
there are no bits to clear (because BitWidth is a multiple of the word size)
and returns early.

Also, move some comments from .cpp file into header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34602 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 19:26:01 +00:00
Reid Spencer
20b1f5db1e Add a private constructor for efficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34580 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 07:29:03 +00:00
Reid Spencer
d03d012ad9 Improve documentation.
Make divide function internal (it was briefly external for testing).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34557 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 09:50:13 +00:00
Chris Lattner
910c80a075 Refactor the setName stuff, moving it down the inheritance hierarchy, to
solve a crash in -instcombine -debug that was hit while investigating PR1217


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 00:55:48 +00:00
Devang Patel
4b2646326b Loop passes are set up to accept pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34527 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 17:53:17 +00:00
Evan Cheng
5b7d5964c2 Temporay hook to enable register scavening for specific targets only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34513 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:07:04 +00:00
Evan Cheng
76d7e76c15 Use findRegisterUseOperand to find a kill of particular register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34512 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:04:26 +00:00
Evan Cheng
96fa612373 Initial check in of register scavenger. Its only current functionality is tracking live registers per MBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:01:19 +00:00
Devang Patel
bfd5905584 Teach LoopPass to assign itself one Loop Pass Manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 00:36:57 +00:00
Devang Patel
8ded5852fe Add facility that allows LoopPass to re-insert a loop into
Loop Pass Manager's queue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 00:16:44 +00:00
Devang Patel
5afdc7d785 Add LPPassManager interface that LoopPass can use to skip
rest of the passes in the queue for a loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 00:10:16 +00:00
Evan Cheng
7d35c0e2b9 Copy and paste silliness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34507 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 23:52:23 +00:00
Devang Patel
d0e6e33043 Add LoopQueue. This is used by loop pass manager to manage loop nest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 23:30:07 +00:00
Evan Cheng
30cac02a92 Remove unnecessary isKill properties if a live range has been lengthened due to coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 23:03:39 +00:00
Jim Laskey
f033833109 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:40:10 +00:00
Jim Laskey
033c9715d9 Remove isAccessable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34497 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:39:03 +00:00
Jim Laskey
2bc210d99f Simplify lowering and selection of exception ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34491 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 15:37:19 +00:00
Jim Laskey
2ad9f17fee Simplify lowering and selection of exception ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34488 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 14:56:36 +00:00
Devang Patel
16a31c4ebf Add Loop Pass Manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34487 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 08:56:17 +00:00
Jim Laskey
62819f3144 Support to provide exception and selector registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34482 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:54:50 +00:00
Jim Laskey
bda9b0ec7b Add support for changes in DwarfWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34478 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:47:38 +00:00
Jim Laskey
a15be8ce3a Add TAI field for exception table section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34477 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:43:40 +00:00
Jim Laskey
9b25b8ca24 Allow for live in registers for eh landing pads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34475 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:41:17 +00:00
Jim Laskey
30b8e51add Add a flag to MBBs to indicate whether it is an eh landing pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34474 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:39:52 +00:00
Jim Laskey
59667fe203 Add structures used for collecting eh information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:38:31 +00:00
Jim Laskey
f09f2e304d Add new instructions for handling data passed into eh landing pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:37:22 +00:00