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

307 Commits

Author SHA1 Message Date
Chris Lattner
7cdfccd573 Inline 4 methods
llvm-svn: 15000
2004-07-19 07:52:35 +00:00
Reid Spencer
7f33869f9b bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage

llvm-svn: 14953
2004-07-18 00:44:37 +00:00
Reid Spencer
14243817ec bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14950
2004-07-18 00:38:32 +00:00
Reid Spencer
2610477ab2 bug 122:
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14949
2004-07-18 00:37:35 +00:00
Chris Lattner
9b03d18729 IA64 compat
llvm-svn: 14867
2004-07-16 00:08:28 +00:00
Chris Lattner
c4888ccda7 Patches towards fixing PR341
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Brian Gaeke
4dc7caee0e Add Machine-CFG edges to SparcV9 MachineBasicBlocks.
llvm-svn: 14806
2004-07-14 05:40:50 +00:00
Chris Lattner
6331eb6bbe Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.

llvm-svn: 14756
2004-07-11 04:17:10 +00:00
Chris Lattner
b67e3b01bc Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner
2ada866a78 Auto-registrate target
llvm-svn: 14745
2004-07-11 02:48:49 +00:00
Reid Spencer
50ec3f9325 Add #include <iostream> since Value.h does not #include it any more.
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Brian Gaeke
b92c136437 Add M_TERMINATOR_FLAG to terminator instructions (branches and returns).
Also, the RETURN instructions are not used in the sparcv9 backend.

llvm-svn: 14559
2004-07-02 04:57:37 +00:00
Brian Gaeke
62ceddefe8 RETURN instructions are not used in the sparc backend.
When in doubt, stamp it out!!

llvm-svn: 14558
2004-07-02 04:57:35 +00:00
Chris Lattner
680ff7de4a There is no reason to print ValueType here
llvm-svn: 14425
2004-06-26 19:36:34 +00:00
Brian Gaeke
908208bc50 Make the most commonly preselected instructions add to the names of the
instructions they augment, instead of replacing them.  It's good for debugging,
and it's OK for the sparcv9 backend.

llvm-svn: 14353
2004-06-23 21:41:32 +00:00
Chris Lattner
cc465361d9 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Brian Gaeke
21e2dd53d8 Make -print-machineinstrs even stronger. You get to see the final code after
peepholing, and make it work the same way in the JIT as in LLC.

llvm-svn: 14170
2004-06-14 05:05:45 +00:00
Brian Gaeke
c5bb88c934 Turn loads of ConstantPointerNulls into loads of zero... don't spill
them into the constant pool.

llvm-svn: 14128
2004-06-11 02:03:48 +00:00
Brian Gaeke
9cf9c6e184 Encode %fsr correctly; don't fail an assertion.
llvm-svn: 14103
2004-06-09 21:54:59 +00:00
Brian Gaeke
badbc7476a Fix encoding of ST*FSR instructions.
llvm-svn: 14102
2004-06-09 21:54:58 +00:00
Brian Gaeke
8e446cf7a2 Fix assertion failure message to have the right method name.
llvm-svn: 14101
2004-06-09 20:44:42 +00:00
Brian Gaeke
91a3d0f55f Fix a minor bug in the map - since this pass adds a global symbol, it must be
accounted for in the map (at least, in its current format).

llvm-svn: 14075
2004-06-08 20:08:30 +00:00
Brian Gaeke
4b0b12c188 Add a TmpInstruction ctor that doesn't take a MCFI.
llvm-svn: 14073
2004-06-08 18:52:46 +00:00
Brian Gaeke
c6715bec89 Fix up some spacing & fix a typo in an assertion in cpValue2Value.
llvm-svn: 14027
2004-06-04 20:51:40 +00:00
Brian Gaeke
4f0fc86456 Add new internal-global-symbol mapping info pass... may its life be short
and sweet.

llvm-svn: 13983
2004-06-03 05:03:37 +00:00
Brian Gaeke
e3a1c92896 Add new mapping info pass, when EmitMappingInfo is on.
llvm-svn: 13981
2004-06-03 05:03:01 +00:00
Brian Gaeke
ceb3e78152 Fix big mistake in my last checkin... the big question is, how did I ever
get this to link before?

llvm-svn: 13980
2004-06-03 05:03:00 +00:00
Brian Gaeke
a960c641e0 Add decl. for new mapping info pass factory method.
llvm-svn: 13979
2004-06-03 05:02:59 +00:00
Brian Gaeke
e3e792cefa Collapse together the abstract superclass TargetRegInfo and SparcV9RegInfo, its
only concrete implementation.

llvm-svn: 13977
2004-06-03 02:45:09 +00:00
Chris Lattner
5ad9eaab1a Convert to the new TargetMachine interface.
llvm-svn: 13952
2004-06-02 05:55:25 +00:00
Brian Gaeke
8b022564d2 There is no "mcff" here; delete the confusing comments that refer to it.
llvm-svn: 13911
2004-05-30 08:29:16 +00:00
Brian Gaeke
18006c7075 Transform an occurrence of if(...) { assert (0) }.
llvm-svn: 13908
2004-05-30 07:34:01 +00:00
Brian Gaeke
f2f7cc0d50 Reduce the amount of LLVM Values for which we save reg. allocator
state. Also, save the state for the incoming register of each phi
node.

llvm-svn: 13906
2004-05-30 07:08:43 +00:00
Brian Gaeke
7f4ad50481 Rename verifySavedState to dumpSavedState. Give it a new comment.
Call it at a more appropriate point.

llvm-svn: 13905
2004-05-30 04:22:24 +00:00
Brian Gaeke
b4f49d8da5 Insert machine instructions generated for Phi nodes into their
corresponding MachineCodeForInstruction vectors.

I need to be able to get the register allocated for the thing which is
called PhiCpRes in this code; this should make that task easier, plus,
Phi nodes are no longer "special" in the sense that their
MachineCodeForInstruction is empty.

llvm-svn: 13904
2004-05-30 03:33:49 +00:00
Brian Gaeke
8daa49f754 Remove unused #include.
llvm-svn: 13899
2004-05-29 23:26:13 +00:00
Brian Gaeke
7d68f2e9b0 Add comments.
llvm-svn: 13898
2004-05-29 23:10:20 +00:00
Brian Gaeke
3913fdf0e9 Trim whitespace.
llvm-svn: 13897
2004-05-29 22:49:51 +00:00
Brian Gaeke
608e0b76e1 Give InsertCodeForPhis() a new documentation comment.
llvm-svn: 13896
2004-05-29 22:20:59 +00:00
Brian Gaeke
403be90321 Give PhiCp nodes better names in many cases.
Simplify InsertPhiElimInstructions(), and give it a better doxygen comment.

llvm-svn: 13880
2004-05-28 19:34:00 +00:00
Brian Gaeke
2bd005cb45 Make debugging output with -print-machineinstrs more useful: always print out
the transformed LLVM code which is the input to the instruction selector.

llvm-svn: 13879
2004-05-28 19:33:59 +00:00
Brian Gaeke
76a1ec7f00 Make comment lines stick out less.
llvm-svn: 13858
2004-05-27 21:41:48 +00:00
Brian Gaeke
fd48b88dfa Add a (not very meaningful) default constructor for AllocInfo objects.
llvm-svn: 13773
2004-05-25 20:43:47 +00:00
Reid Spencer
65559ced22 Remove use of Type::TypeTy from an assert. It will go away soon.
llvm-svn: 13748
2004-05-25 08:50:52 +00:00
Chris Lattner
1e22b42cb6 Add support for accurate garbage collection to the LLVM code generators
llvm-svn: 13696
2004-05-23 21:23:35 +00:00
Brian Gaeke
12ab4a0357 Fix a typo in a comment.
llvm-svn: 13643
2004-05-23 05:10:06 +00:00
Brian Gaeke
ac9ce5d851 Fix a bug in outputting branches to constant PCs. Since the PC is supplied as
a full 64-bit address, it must be adjusted to fit in the branch instruction's
immediate field. (This is only used in the reoptimizer, for now.)

llvm-svn: 13608
2004-05-20 07:43:40 +00:00
Brian Gaeke
1d6c0881ce Minor simplification: eliminate a dyn_cast.
Fix a typo in a debug message.

llvm-svn: 13607
2004-05-19 21:30:01 +00:00
Brian Gaeke
c9ca9d6625 Missing piece of fix for Bug 333
llvm-svn: 13362
2004-05-04 21:41:45 +00:00
Brian Gaeke
28d81c4d0d Correctly mangle function names when they are used as part of a
constant pool member's name.
This is intended to address Bug 333.

Also, fix an anachronistic usage of "M" as a parameter of type Function *.

llvm-svn: 13357
2004-05-04 21:09:02 +00:00
Brian Gaeke
7ce5ef244a Integrate the rest of my random sparcv9 scribblings into this file
llvm-svn: 13204
2004-04-27 22:04:03 +00:00
Chris Lattner
02c65b5395 Changes to fix up the inst_iterator to pass to boost iterator checks. This
patch was graciously contributed by Vladimir Prus.

llvm-svn: 13185
2004-04-27 15:13:33 +00:00
Brian Gaeke
1e049bdc77 Fix file header comments and include guards -- many files have been moved or
renamed since they were last spiffed up, or they just never had proper comments
in the first place.

llvm-svn: 13148
2004-04-25 07:04:49 +00:00
Brian Gaeke
c3857275f9 Add a getRegisterInfo() accessor just like on the X86 target.
llvm-svn: 13147
2004-04-25 06:32:28 +00:00
Brian Gaeke
6e21a0858c Regularize file header comment and include guard.
Include SparcV9RegisterInfo.h.
Add a getRegisterInfo() accessor and SparcV9RegisterInfo instance, just like
on the X86 target.

llvm-svn: 13146
2004-04-25 06:32:16 +00:00
Brian Gaeke
a36743c473 Add MRegisterInfo subclass for the SparcV9 target (containing only stub
functions for now). This automatically turns on the printing of machine
registers using their own real names, instead of goofy things like %mreg(42),
and allows us to migrate code incrementally to the new interface as we see fit.

The register file description it uses is hand-written, so that the register
numbers will match the ones that the SparcV9 target already uses.
Perhaps someday we'll tablegen it.

llvm-svn: 13145
2004-04-25 06:32:05 +00:00
Brian Gaeke
6ed3b116bc Fix a typo.
llvm-svn: 13136
2004-04-23 21:45:02 +00:00
Brian Gaeke
7fba37bb96 Merge TargetRegInfo.h into SparcV9RegInfo.h, which is its only subclass.
This prepares us to be able to de-virtualize and de-abstract it, and
take the register allocator bits out and move them into the register allocator
proper...

llvm-svn: 13127
2004-04-23 18:15:48 +00:00
Brian Gaeke
40c7e110a5 Include SparcV9RegInfo.h instead of TargetRegInfo.h.
llvm-svn: 13126
2004-04-23 18:15:47 +00:00
Brian Gaeke
07344c1367 Get rid of the old byte-at-a-time emission code used when the Sparc JIT was
being tested on X86, as per Chris's request.

llvm-svn: 13124
2004-04-23 18:10:38 +00:00
Brian Gaeke
255d0d9b26 Emit SPARC machine code a word at a time instead of a byte at a time.
Use emitWordAt() to emit forward-branch fixups.

llvm-svn: 13119
2004-04-23 17:11:15 +00:00
Brian Gaeke
51b16fc65a Make SparcV9RegInfo::getRegType() return the right answer for registers
of IntCC, FloatCC, and Special types.

Make SparcV9RegInfo::getRegClassIDOfRegType() return the right answer
if you ask for the class corresponding to SpecialRegType.

llvm-svn: 13095
2004-04-21 17:53:58 +00:00
Brian Gaeke
3727c760ed Make it legal to ask for the type of a specialreg
llvm-svn: 13078
2004-04-20 20:12:57 +00:00
Brian Gaeke
047739f8d8 Make it legal to request a load or store of %fsr.
llvm-svn: 13073
2004-04-19 19:12:12 +00:00
Brian Gaeke
3dfe9f19ea Regularize include guards and remove some excess whitespace.
llvm-svn: 13071
2004-04-19 18:53:44 +00:00
Brian Gaeke
d7fa9142a3 Tighten up SparcV9FloatCCRegClass::getRegName()'s assertion - if you ask it for
the name of %fsr (as the comment in SparcV9RegClassInfo.h used to suggest)
you would walk off the end of the FloatCCRegName array.

llvm-svn: 13070
2004-04-19 18:53:43 +00:00
Brian Gaeke
5bcbc23fc1 Regularize include guards, remove some excess whitespace and fix some comments.
Remove the extra %fsr register from SparcV9FloatCCRegClass.

llvm-svn: 13069
2004-04-19 18:53:42 +00:00
Brian Gaeke
e708b1d5ef Give SparcV9CodeEmitter a head-of-file comment and a PassName.
llvm-svn: 12967
2004-04-15 20:23:13 +00:00
Brian Gaeke
36093cb38c We don't need to insert TargetData into the PassManager here.
llvm-svn: 12874
2004-04-12 21:46:31 +00:00
Brian Gaeke
bd29266df4 Don't include InstrSelectionSupport.h.
llvm-svn: 12766
2004-04-07 20:55:32 +00:00
Brian Gaeke
c48a77d1ba Move ChooseRegOrImmed() prototype here, from InstrSelectionSupport.h.
llvm-svn: 12765
2004-04-07 20:38:57 +00:00
Brian Gaeke
54245d895a Don't include InstrSelectionSupport.h.
llvm-svn: 12764
2004-04-07 20:38:56 +00:00
Brian Gaeke
1193590133 Fix insertion of SelectInsts.
llvm-svn: 12760
2004-04-07 18:31:47 +00:00
Chris Lattner
c69fd63e82 In the perhaps not-to-distant future, we might support gep instructions that
have non-long indices for sequential types.  In order to avoid trying to figure
out how the v9 backend works, we'll just hack it in the preselection pass.

llvm-svn: 12647
2004-04-04 20:44:05 +00:00
Brian Gaeke
73afcebba1 Only strip symbols if emitting bytecode to the assembly file.
Move lowerselect pass to come after preselection.  Move machine
code construction and stack slots pass to come right before instruction
selection. This is to help fix perlbmk.

Update comments.

Make the sequence of passes in addPassesToJITCompile look more like
the sequence of passes in addPassesToEmitAssembly, including support
for -print-machineinstrs.

llvm-svn: 12614
2004-04-02 17:52:40 +00:00
Brian Gaeke
3fb4f87195 Add support for constant select expressions. Clarify the assertion failure msg.
llvm-svn: 12613
2004-04-02 17:52:29 +00:00
Chris Lattner
bfe4dd0f90 MBB::remove should not modify the iterator passed in
llvm-svn: 12572
2004-03-31 21:59:59 +00:00
Brian Gaeke
98c323dedd Factor out getStaticStackSize from InsertPrologCode(), so that I can more
easily steal it for a separate use in the reoptimizer.

llvm-svn: 12568
2004-03-31 20:58:37 +00:00
Chris Lattner
87479998f2 Add the select lowering pass to get initial support for select instructions
llvm-svn: 12541
2004-03-30 18:41:59 +00:00
Brian Gaeke
610cfaa7fd Don't warn about a null live range if the Value is a ConstantIntegral.
Otherwise, if you're in debugging mode, you get warnings for (apparently)
every immediate constant in the function during reg. allocation.

llvm-svn: 12538
2004-03-29 21:58:41 +00:00
Chris Lattner
4e7ea3671c Fix PR299: [Sparc] Code generator asserts on alloc of zero size type
llvm-svn: 12504
2004-03-19 04:21:43 +00:00
Chris Lattner
f7bc6fd913 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.

llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Brian Gaeke
5bc633f691 Make -print-machineinstrs show us the code both before and after reg. alloc.
llvm-svn: 12344
2004-03-12 21:19:08 +00:00
Brian Gaeke
ede938b425 Get rid of the abort in PhyRegAlloc::finishSavingState().
Make an explicit call to it from runOnFunction() if we know we're supposed to
write into the global. This is lame (esp. the const_cast), but it solves
the problem.

llvm-svn: 12291
2004-03-11 19:46:30 +00:00
Brian Gaeke
e6916ff3b4 Give pass a name
llvm-svn: 12290
2004-03-11 19:23:15 +00:00
Brian Gaeke
b3f9f99ff2 In PhyRegAlloc::saveState(), dump Arguments' saved-state, and try to
make the output more compact.

Divorce state-saving from the doFinalization method; for some reason it's not
getting called when I want it to, at Reoptimizer time. Put the guts in
PhyRegAlloc::finishSavingState(). Put an abort() in it so that I can be really
really sure that it's getting called.

Update comments.

llvm-svn: 12286
2004-03-11 06:45:52 +00:00
Brian Gaeke
a3ed4044b0 Move all the SaveState options and stuff inton one spot at the top of the file.
De-constify SaveStateToModule; we have to set both it and SaveRegAllocState
explicitly in the reoptimizer.
Make SaveRegAllocState an 'external location' option.

llvm-svn: 12278
2004-03-10 22:21:03 +00:00
Brian Gaeke
8af4555830 Only call verifySavedState if SaveRegAllocState is set AND debugging flag is on.
llvm-svn: 12277
2004-03-10 22:01:59 +00:00
Brian Gaeke
57269b0c32 Change PhyRegAlloc::saveStateForValue()'s arg type to deal with
AllocInfo.Instruction becoming an int.

llvm-svn: 12247
2004-03-08 23:22:03 +00:00
Brian Gaeke
ed741b87c2 Save argument list alloc state by recording it as the operands of Instruction
#-1. Other minor changes to deal with AllocInfo.Instruction becoming an int.

llvm-svn: 12246
2004-03-08 23:22:02 +00:00
Brian Gaeke
b9b20ad428 Make AllocInfo's Instruction an int, so that we can overload it for arguments.
(Instruction #-1's operands = argument list).

llvm-svn: 12245
2004-03-08 23:22:01 +00:00
Brian Gaeke
0b913593ae make -print-machineinstrs work for both SparcV9 and X86
llvm-svn: 12122
2004-03-04 19:16:23 +00:00
Chris Lattner
4d192a2674 Add this back, as its absence introduces assertions, and it seems to work now
that Instructions are annotable again

llvm-svn: 12045
2004-03-01 15:28:27 +00:00
Tanya Lattner
b22016f21b fix bug in previous checkin
llvm-svn: 12044
2004-03-01 15:05:17 +00:00
Brian Gaeke
b78f8498f0 TargetCacheInfo has been removed; its only uses were to propagate a constant
(16) into certain areas of the SPARC V9 back-end. I'm fairly sure the US IIIi's
dcache has 32-byte lines, so I'm not sure where the 16 came from. However, in
the interest of not breaking things any more than they already are, I'm going
to leave the constant alone.

llvm-svn: 12043
2004-03-01 06:43:29 +00:00
Chris Lattner
4c7ed6793e Remove public header. It's been moved to lib/Target/SparcV9
llvm-svn: 12004
2004-02-29 19:13:20 +00:00
Chris Lattner
fe38629411 Move the private MachineInstrAnnot.h into a private directory.
llvm-svn: 12003
2004-02-29 19:12:51 +00:00
Brian Gaeke
8303cb575e Remove dead member variables of SparcV9SchedInfo and TargetSchedInfo
llvm-svn: 11994
2004-02-29 08:40:03 +00:00
Chris Lattner
c2977ac665 Adjust to change in TII ctor arguments
llvm-svn: 11987
2004-02-29 06:31:44 +00:00
Chris Lattner
dd752eec34 Remove a TON of flags that noone cares about
llvm-svn: 11983
2004-02-29 05:58:30 +00:00
Chris Lattner
d80ff1bdc0 Noone calls these virtual methods
llvm-svn: 11982
2004-02-29 05:58:16 +00:00
Chris Lattner
dded7ad224 This is the only file in the system that uses this enum. eliminate it.
llvm-svn: 11981
2004-02-29 05:57:59 +00:00
Brian Gaeke
6afa0813d2 Turn off the SparcV9MachineCodeDestructionPass for now, because it's buggy
llvm-svn: 11930
2004-02-27 21:15:40 +00:00
Brian Gaeke
0e74ff91a0 Correct DestroyMachineFunction's getPassName
llvm-svn: 11929
2004-02-27 21:01:14 +00:00
Brian Gaeke
c6de948cd1 Great renaming part II: Sparc --> SparcV9 (also includes command-line options and Makefiles)
llvm-svn: 11827
2004-02-25 19:08:12 +00:00
Brian Gaeke
965df0b91b Great renaming: Sparc --> SparcV9
llvm-svn: 11826
2004-02-25 18:44:15 +00:00