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

4984 Commits

Author SHA1 Message Date
Chris Lattner
068ac4236d Move into the VMCore library
llvm-svn: 10623
2003-12-28 08:30:20 +00:00
Chris Lattner
57ff7c242c Implement the default implementation of the intrinsic lowering class
llvm-svn: 10621
2003-12-28 08:19:41 +00:00
Chris Lattner
a8c942c188 finegrainify namespacification
minor cleanups

llvm-svn: 10619
2003-12-28 07:59:53 +00:00
Chris Lattner
428c27dfbf Merging constants can cause further room for improvement. Iterate until
we converge

llvm-svn: 10618
2003-12-28 07:19:08 +00:00
Chris Lattner
8caf13292a Add a note
llvm-svn: 10617
2003-12-28 04:03:49 +00:00
Chris Lattner
3593bb9dd6 Factor code out of LLI
llvm-svn: 10616
2003-12-26 06:50:30 +00:00
Chris Lattner
5ad07a3fbf minor cleanups
llvm-svn: 10612
2003-12-26 06:16:00 +00:00
Chris Lattner
ddcbddf9e9 No longer run atExit functions from run()
rename run to runFunction
Genericize the runFunction code a little bit, though it still stinks

llvm-svn: 10610
2003-12-26 06:13:47 +00:00
Chris Lattner
d7d8336d73 No longer run atExit functions from run()
rename run to runFunction

llvm-svn: 10609
2003-12-26 06:13:05 +00:00
Alkis Evlogimenos
597e2f3501 Improve debugging output when choosing a register to spill.
llvm-svn: 10604
2003-12-24 18:53:31 +00:00
Alkis Evlogimenos
2c947a4fa0 Do a separate pass to compute spill weights because doing it inline
with live intervals was missing registers that were used before they
were defined (in the arbitrary order live intervals numbers
instructions).

llvm-svn: 10603
2003-12-24 15:44:53 +00:00
Chris Lattner
c09a6f0621 Right, fix the problem with invoke instructions, not just call instructions
llvm-svn: 10599
2003-12-23 22:18:36 +00:00
Chris Lattner
c1dd02538a Do not delete the type holder until after the call instruction has been
constructed!

llvm-svn: 10598
2003-12-23 20:39:17 +00:00
Chris Lattner
defd9ccd73 Minor cleanups, plug a minor memory leak
llvm-svn: 10596
2003-12-23 20:05:15 +00:00
Alkis Evlogimenos
ca57dd1089 Change the way free regusters are computed and perform better
allocation in the presence of preallocated intervals.

llvm-svn: 10595
2003-12-23 18:00:33 +00:00
Chris Lattner
099e1f16b8 rename ClassifyExpression -> ClassifyExpr
llvm-svn: 10592
2003-12-23 08:04:08 +00:00
Chris Lattner
fefdb67375 More minor non-functional changes. This now computes the exit condition, though
it doesn't do anything with it.

llvm-svn: 10590
2003-12-23 07:47:09 +00:00
Chris Lattner
77fe880dcf Remove extraneous #include
finegrainify namespacification

llvm-svn: 10589
2003-12-23 07:43:38 +00:00
Chris Lattner
5780f54596 Finegrainify namespacification
llvm-svn: 10588
2003-12-23 06:44:41 +00:00
Chris Lattner
30fa61ca6c Fix memory corruption bug PR193
llvm-svn: 10586
2003-12-22 23:49:36 +00:00
John Criswell
8740fbd052 Reverted back to revision 1.11. The previous fix doesn't really fix
anything; it just causes the bug to go dormant.

llvm-svn: 10585
2003-12-22 16:22:49 +00:00
Alkis Evlogimenos
10de430568 Fix crash when compiling twolf.
llvm-svn: 10584
2003-12-22 13:54:29 +00:00
Chris Lattner
8ec8b9c28a Don't mind me, I'm just refactoring away. This patch makes room for LFTR, but
contains no functionality changes.

llvm-svn: 10583
2003-12-22 09:53:29 +00:00
Chris Lattner
b0c30fd90f finegrainify namespacification
Implement indvar analysis of getelementptr and sub expressions

llvm-svn: 10582
2003-12-22 05:26:29 +00:00
Chris Lattner
1f0b2be06c Implement IndVarsSimplify/pointer-indvars.ll, transforming pointer
arithmetic into "array subscripts"

llvm-svn: 10580
2003-12-22 05:02:01 +00:00
Chris Lattner
be3440d4e3 finegrainify namespacification
add new getIntPtrType() method

llvm-svn: 10579
2003-12-22 05:01:15 +00:00
Chris Lattner
dfe3e25d89 Fix PR194
llvm-svn: 10573
2003-12-22 03:58:44 +00:00
Misha Brukman
2653aa076a Really release memory used by functions. Patch by Chris.
llvm-svn: 10572
2003-12-22 03:47:58 +00:00
Alkis Evlogimenos
7062ccbc85 Remove verifyIntervals() since it doesn't actually work right now.
llvm-svn: 10570
2003-12-21 20:41:26 +00:00
Alkis Evlogimenos
4401d0a7a3 Change weight into a float so that we can take into account the
nesting level when computing it. Right now the allocator uses:

    w = sum_over_defs_uses( 10 ^ nesting level );

llvm-svn: 10569
2003-12-21 20:19:10 +00:00
Alkis Evlogimenos
0e892b6337 Move FP_REG_KILL closer to the return instruction.
llvm-svn: 10567
2003-12-21 16:47:43 +00:00
Alkis Evlogimenos
4f98b79ef0 Add support for inactive intervals. This effectively reuses registers
for live ranges that fall into assigned registers' holes.

llvm-svn: 10566
2003-12-21 05:43:40 +00:00
John Criswell
80daeb4cdb Fix PR#193.
Modified ReadArchiveBuffer() so that it dynamically allocates the
std::string object used to hold the bytecode object file's name.  This is
necessary because it is passed by reference to the new Module that is
allocated to represent the bytecode object, and previously we were
using a std::string that disappeared on function exit.

llvm-svn: 10565
2003-12-20 22:37:29 +00:00
Alkis Evlogimenos
7b61337ce6 Move FP_REG_KILL closer to the actual branch instruction.
llvm-svn: 10563
2003-12-20 17:28:15 +00:00
Alkis Evlogimenos
41bd8284e3 Remove floating point killer pass. This is now implemented in the
instruction selector by adding a new pseudo-instruction
FP_REG_KILL. This instruction implicitly defines all x86 fp registers
and is a terminator so that passes which add machine code at the end
of basic blocks (like phi elimination) do not add instructions between
it and the branch or return instruction.

llvm-svn: 10562
2003-12-20 16:22:59 +00:00
Chris Lattner
461a62626a Add a new target-independent machine code freeing pass
llvm-svn: 10560
2003-12-20 10:20:58 +00:00
Chris Lattner
ef1bfa35d0 Finally, _actually delete the machine code_ for a function, after it has
been emitted.  Also, since the FPK pass is causing memory access violations,
disable it.

llvm-svn: 10559
2003-12-20 10:20:19 +00:00
Chris Lattner
013d4bee41 This should not be needed anymore
llvm-svn: 10558
2003-12-20 10:19:18 +00:00
Chris Lattner
ea52ffdb10 Fix memory leak in the stackifier, due to the machinebasicblocks not holding
instructions on an ilist

llvm-svn: 10556
2003-12-20 10:12:17 +00:00
Chris Lattner
544d512d4f Finegrainify namespacification
Minor cleanups to killer pass

llvm-svn: 10555
2003-12-20 09:58:55 +00:00
Chris Lattner
5099050009 Hoist some sparc specific code into the sparc target
llvm-svn: 10554
2003-12-20 09:17:40 +00:00
Chris Lattner
d476049d19 * Finegrainify namespacification
* Move sparc specific code out of generic code
* Eliminate the getOffset() method which made INVALID_FRAME_OFFSET
  necessary, which made pulling in MAX_INT as a sentinal necessary.

llvm-svn: 10553
2003-12-20 09:17:07 +00:00
Chris Lattner
edda0e5d4f Implement PR135, lazy emission of global variables
llvm-svn: 10549
2003-12-20 03:36:47 +00:00
Chris Lattner
214005e5fb Simple refactorings to prepare for lazy global emission
Also, add a stat for the number of globals emitted

llvm-svn: 10547
2003-12-20 02:45:37 +00:00
Chris Lattner
d3676d0774 A minor cleanup for better encapsulation
llvm-svn: 10545
2003-12-20 02:03:14 +00:00
Chris Lattner
cd8f92bc62 Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)

llvm-svn: 10544
2003-12-20 01:46:27 +00:00
Chris Lattner
32658dbaf3 Update for changes in the JIT
llvm-svn: 10543
2003-12-20 01:45:17 +00:00
Chris Lattner
1cb1efedb3 Rip JIT specific stuff out of TargetMachine, as per PR176
llvm-svn: 10542
2003-12-20 01:22:19 +00:00
Chris Lattner
e0021ba353 Fix ADCE/2003-12-19-MergeReturn.llx
llvm-svn: 10539
2003-12-19 09:08:34 +00:00
Chris Lattner
399d5ad32e Remove the wierd "Operands" loop, by traversing basicblocks in reverse order
llvm-svn: 10536
2003-12-19 08:18:16 +00:00
Chris Lattner
68db81e684 Implement LICM/sink_multiple.ll, by sinking all possible instructions in the
loop before hoisting any.

llvm-svn: 10534
2003-12-19 07:22:45 +00:00
Chris Lattner
a0b16fb57d Generalize a special case to fix PR187
llvm-svn: 10531
2003-12-19 06:27:08 +00:00
Chris Lattner
e0e1fe84e8 Factor code out into the Utils library
llvm-svn: 10530
2003-12-19 05:58:40 +00:00
Chris Lattner
c1952a1fd6 Add new function
llvm-svn: 10529
2003-12-19 05:56:28 +00:00
Alkis Evlogimenos
9181e0ab5b Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.

llvm-svn: 10520
2003-12-18 22:40:24 +00:00
Chris Lattner
c984af2771 Prune some #includes
Add a statistic for # reloads

llvm-svn: 10518
2003-12-18 20:25:31 +00:00
John Criswell
3304c39869 Reverted back to previous revision - this was previously merged
according to the CVS log messages.

llvm-svn: 10517
2003-12-18 17:19:19 +00:00
John Criswell
0659bb0c4a Merged in RELEASE_11.
llvm-svn: 10516
2003-12-18 16:43:17 +00:00
Alkis Evlogimenos
f6e9dd4942 Modify linear scan register allocator to use the two-address
instruction pass. This also fixes all remaining bugs for this new
allocator to pass all tests under test/Programs.

llvm-svn: 10515
2003-12-18 13:15:02 +00:00
Alkis Evlogimenos
9bb0ad1a37 Fix bug in reserved registers. DH actually aliases DX and EDX which
are not reserved registers.

llvm-svn: 10514
2003-12-18 13:12:18 +00:00
Alkis Evlogimenos
48d20cb328 Modify local register allocator to use the two-address instruction pass.
llvm-svn: 10513
2003-12-18 13:08:52 +00:00
Alkis Evlogimenos
90aeecae42 Add TwoAddressInstructionPass to handle instructions that have two or
more operands and the two first operands are constrained to be the
same. The pass takes an instruction of the form:

        a = b op c

and transforms it into:

        a = b
        a = a op c

and also preserves live variables.

llvm-svn: 10512
2003-12-18 13:06:04 +00:00
Alkis Evlogimenos
befef566f6 Rename LiveIntervals::expired() to LiveIntervals::expiredAt().
llvm-svn: 10511
2003-12-18 08:56:11 +00:00
Alkis Evlogimenos
382bfbffeb When a variable is killed and redifined in a basic block only one
killing instruction is tracked. This causes the LiveIntervals to
create bogus intervals. The workaound is to add a range to the
interval from the redefinition to the end of the basic block.

llvm-svn: 10510
2003-12-18 08:53:43 +00:00
Alkis Evlogimenos
8e2fcc7d79 Handle multiple virtual register definitions gracefully.
Move some of the longer LiveIntervals::Interval method out of the
header and add debug information to them. Fix bug and simplify range
merging code.

llvm-svn: 10509
2003-12-18 08:48:48 +00:00
Chris Lattner
17122cbe7b When we delete instructions from the loop, make sure to remove them from the
AliasSetTracker as well.

llvm-svn: 10507
2003-12-18 08:12:32 +00:00
Chris Lattner
457dd0b6c7 Add a new AliassetTracker::remove method. Because we need to be able to remove
a pointer from an AliasSet, maintain the pointer values on a doubly linked
list instead of a singly linked list, to permit efficient removal from the
middle of the list.

llvm-svn: 10506
2003-12-18 08:11:56 +00:00
Misha Brukman
adac37e69b * Converted C-style comments to C++
* Doxygenified comments
* Reordered #includes

llvm-svn: 10503
2003-12-17 22:08:20 +00:00
Misha Brukman
61860852dc Reordered #includes.
llvm-svn: 10502
2003-12-17 22:06:28 +00:00
Misha Brukman
9f2f87bb6b Doxygenified some comments, reduced extraneous space.
llvm-svn: 10501
2003-12-17 22:06:08 +00:00
Misha Brukman
fe533cc4e6 Reorganized the Sparc backend to be more modular -- each different
implementation of a Target{RegInfo, InstrInfo, Machine, etc} now has a separate
header and a separate implementation file.

This means that instead of a massive SparcInternals.h that forces a
recompilation of the whole target whenever a minor detail is changed, you should
only recompile a few files.

Note that SparcInternals.h is still around; its contents should be minimized.

llvm-svn: 10500
2003-12-17 22:04:00 +00:00
Brian Gaeke
81d68517ea Make getObjectType() smarter about ranlibbed Mac OS X archives.
llvm-svn: 10493
2003-12-17 00:18:18 +00:00
Chris Lattner
062d3a4ab5 Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx
llvm-svn: 10473
2003-12-15 17:34:02 +00:00
Alkis Evlogimenos
657eb40294 Change preserve all claim to just preserve live variables and phielimination.
llvm-svn: 10469
2003-12-15 04:55:38 +00:00
Chris Lattner
5fc36a496f Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
llvm-svn: 10467
2003-12-14 23:57:39 +00:00
Chris Lattner
9047cde657 Finegrainify namespacification
llvm-svn: 10465
2003-12-14 23:25:48 +00:00
Chris Lattner
2fdf5e32aa Finegrainify namespacification
llvm-svn: 10464
2003-12-14 21:35:53 +00:00
Chris Lattner
30ae898eb7 Finegrainify namespacification
Make the Timer code give correct user/system/user+system times when -track-memory is enabled

llvm-svn: 10463
2003-12-14 21:27:33 +00:00
Alkis Evlogimenos
29127b8825 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
b96436e679 Change preserve all claim to just preserve live variables and phielimination.
llvm-svn: 10460
2003-12-14 10:14:23 +00:00
Chris Lattner
0d3a8b1cb4 Do not promote volatile alias sets into registers
llvm-svn: 10458
2003-12-14 04:52:31 +00:00
Chris Lattner
a9d238d598 Finegrainify namespacification
Add capability to represent volatile AliasSet's
Propagate this information from loads&stores into the aliassets

llvm-svn: 10457
2003-12-14 04:52:11 +00:00
Alkis Evlogimenos
d58f58b351 When reserving a preallocated register spill the aliases of this
register too.

llvm-svn: 10450
2003-12-13 11:58:10 +00:00
Alkis Evlogimenos
f84f86137b Ignore non-allocatable physical registers in live interval analysis.
llvm-svn: 10449
2003-12-13 11:11:02 +00:00
Alkis Evlogimenos
18bf6b5ad7 Expire any active intervals left when register allocation is done.
llvm-svn: 10448
2003-12-13 05:50:19 +00:00
Alkis Evlogimenos
225fc9c6db Add instruction numbers to debugging output.
llvm-svn: 10447
2003-12-13 05:48:57 +00:00
Alkis Evlogimenos
5ca15c8f5e Add a floating point killer pass. This pass runs before register
allocaton on the X86 to add information to the machine code denoting
that our floating point stackifier cannot handle virtual point
register that are alive across basic blocks. This pass adds an
implicit def of all virtual floating point register at the end of each
basic block.

llvm-svn: 10446
2003-12-13 05:36:22 +00:00
Alkis Evlogimenos
2a41fcbef3 Handle explicit physical register defs.
llvm-svn: 10445
2003-12-13 05:26:39 +00:00
Alkis Evlogimenos
6e511754e5 Remove unecessary if statements when looping on ImplicitDefs.
llvm-svn: 10444
2003-12-13 01:20:58 +00:00
John Criswell
93c209e4ac Modified cast so that it converts the int to a long before casting to
a pointer.  This evades a warning emitted by GCC when we cast from
unsigned int (32 bit) to void * (64 bit) on SparcV9.

llvm-svn: 10435
2003-12-12 19:57:48 +00:00
Brian Gaeke
84101bcdb8 Dynamically get the right-sized member of a GenericValue to hold a size_t, and
use it to return the result of strlen.

llvm-svn: 10433
2003-12-12 15:38:06 +00:00
Chris Lattner
f58e098889 Implement the ExecutionEngine::getPointerToFunctionOrStub by forwarding the
request on to the TargetMachine if it supports the getJITStubForFunction method

llvm-svn: 10431
2003-12-12 07:12:02 +00:00
Chris Lattner
b750a0cf3a Implement the TargetMachine::getJITStubForFunction method for X86, finegrainify
namespacification.

llvm-svn: 10430
2003-12-12 07:11:18 +00:00
Brian Gaeke
fb0c4c3d39 Since we are using a gep_type_iterator, we apparently must get the type
index by using I.getOperand() here. This was failing an assertion on
basically every struct access.

llvm-svn: 10426
2003-12-12 05:13:05 +00:00
Brian Gaeke
94157211b6 Throw better error messages, by calling strerror(errno) when we
get an error inside the bytecode reader.

llvm-svn: 10415
2003-12-12 00:47:44 +00:00
Chris Lattner
f9c24d19cf Factor out some duplicated code, implement the rest of the cases in
BasicAA/2003-12-11-ConstExprGEP.ll

llvm-svn: 10412
2003-12-11 23:20:16 +00:00
Chris Lattner
2185bd56cc Fix PR86. This makes basicaa _SIGNIFICANLY_ more aggressive with getelementptr's
llvm-svn: 10410
2003-12-11 22:44:13 +00:00
Chris Lattner
1f7737b44f Fix LICM/2003-12-11-SinkingToPHI.ll, and quite possibly all of the other known problems in the universe.
llvm-svn: 10409
2003-12-11 22:23:32 +00:00
Chris Lattner
89c05af2e2 Finegrainify namespacification
Add new -print-cfg-only pass

llvm-svn: 10407
2003-12-11 21:48:18 +00:00
Chris Lattner
bba48ffc66 verifyFunction depends on dominator info, which levelraise does not declare
that it needs.  This is pretty scary code!  This fixes

Regression.Transforms.LevelRaise.2002-07-16-SourceAndDestCrash
Regression.Transforms.LevelRaise.2002-07-31-AssertionFailure

llvm-svn: 10406
2003-12-11 21:47:37 +00:00