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

251 Commits

Author SHA1 Message Date
Brian Gaeke
6f6eb93de3 Make debugging dumps w/ multiple MachineBBs for a given LLVM BB readable.
llvm-svn: 14205
2004-06-17 22:26:53 +00:00
Chris Lattner
0046ea7105 Adjust to new TargetMachine interface
llvm-svn: 13956
2004-06-02 05:57:12 +00:00
Tanya Lattner
55477a5af1 Changed clone to be const.
Changed copy constructor to set parent, prev, and next pointers to null.

llvm-svn: 13706
2004-05-24 03:14:18 +00:00
Tanya Lattner
e755fc6689 Fixed up my changes to add support for cloning Machine Instructions.
llvm-svn: 13665
2004-05-23 20:58:02 +00:00
Tanya Lattner
2848065a29 Adding support to clone MachineInstr
llvm-svn: 13661
2004-05-23 19:35:12 +00:00
Brian Gaeke
aa96ff7926 Make MachineOperand's value named 'contents'. Make really, really sure
it is always completely initialized and copied.
Also, fix up many comments and asserts.

llvm-svn: 12100
2004-03-03 19:07:27 +00:00
Chris Lattner
8b7ac81d2e int64_t -> int
llvm-svn: 11977
2004-02-29 05:07:02 +00:00
Alkis Evlogimenos
3093de5bfb Fix crash caused by passing register 0 to
MRegisterInfo::isPhysicalRegister().

llvm-svn: 11894
2004-02-27 01:52:34 +00:00
Chris Lattner
82e1a3657d Fix bugs in finegrainification
llvm-svn: 11758
2004-02-23 18:40:08 +00:00
Chris Lattner
1bf9dde4a1 Finegrainify namespacification
llvm-svn: 11757
2004-02-23 18:38:20 +00:00
Chris Lattner
8a9be6b652 Fix a __LONG__ term annoyance of mine: symbolic registers weren't being printed
by operator<< on MachineInstr's, and looking up what register "24" is all of the
time was greatly annoying.

llvm-svn: 11623
2004-02-19 16:17:08 +00:00
Alkis Evlogimenos
790b000aa7 Add LeakDetection to MachineInstr.
Move out of line member functions of MachineBasicBlock to
MachineBasicBlock.cpp.

llvm-svn: 11497
2004-02-16 07:17:43 +00:00
Alkis Evlogimenos
6d6ab846af Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +00:00
Brian Gaeke
44cc73b6f2 Add head-of-file comments and Doxygen comments. Tighten up a lot of whitespace.
Rename SetMachineOperandConst's formal parameters to match other methods here.
Mark some methods as being used only by the SPARC back-end.
Fix a missing-paren bug in OutputValue().

llvm-svn: 11363
2004-02-13 04:39:32 +00:00
Alkis Evlogimenos
3ecdcd18c5 Add parent pointer to MachineInstr that points to owning
MachineBasicBlock. Also change opcode to a short and numImplicitRefs
to an unsigned char so that overall MachineInstr's size stays the
same.

llvm-svn: 11357
2004-02-12 18:49:07 +00:00
Chris Lattner
ef375052c6 Rename the opCode instance variable to Opcode
llvm-svn: 11348
2004-02-12 16:09:53 +00:00
Chris Lattner
bda81f88b7 This field is never read
llvm-svn: 11346
2004-02-12 16:04:49 +00:00
Alkis Evlogimenos
676e5b8997 Modify the two address instruction pass to remove the duplicate
operand of the instruction and thus simplify the register allocation.

llvm-svn: 11124
2004-02-04 22:17:40 +00:00
Alkis Evlogimenos
5e78d4bd75 When an instruction like: A += B had both A and B virtual registers
spilled, A was loaded from its stack location twice. This fixes the bug.

llvm-svn: 11093
2004-02-03 01:13:07 +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
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Misha Brukman
9708959677 Fixed spelling.
llvm-svn: 8588
2003-09-17 21:34:23 +00:00
Vikram S. Adve
bc05294ada Fix assertion in MachineInstr::substituteValue().
llvm-svn: 7675
2003-08-07 15:01:48 +00:00
Chris Lattner
a826c8d485 Do not insert physical regsiters into the regsUsed set
llvm-svn: 7617
2003-08-05 21:55:20 +00:00
Chris Lattner
b047a0d449 All callers of these methods actually wanted them to preserve the flags,
so get rid of the def/use parameters that were getting passed in.

**** This now changes the semantics of these methods to preserve the flags,
     not clobber them!

llvm-svn: 7602
2003-08-05 16:58:46 +00:00
Chris Lattner
5dca2ea4bc Simplify code, eliminating the need for the X86 isVoid target instr flag
llvm-svn: 7534
2003-08-03 21:51:45 +00:00
Chris Lattner
eba995d624 Remove using decl
llvm-svn: 7531
2003-08-03 20:24:29 +00:00
Vikram S. Adve
6aa3abf7fa Change interface to MachineInstr::substituteValue to specify more precisely
which args can be substituted: defsOnly, defsAndUses or usesOnly.

llvm-svn: 7154
2003-07-10 19:45:07 +00:00
Vikram S. Adve
b2bb0dd8ca Allow explicit physical registers for implicit operands.
llvm-svn: 6468
2003-05-31 07:39:06 +00:00
Vikram S. Adve
681b3c77fa (1) Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
    from SparcReg{Class,}Info.

(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
    and related functions and flags.  Fixed several bugs where only
    "isDef" was being checked, not "isDefAndUse".

llvm-svn: 6341
2003-05-27 00:05:23 +00:00
Chris Lattner
cfa7a8f9a2 Remove obsolete ctor
llvm-svn: 5301
2003-01-15 19:47:02 +00:00
Chris Lattner
b27d60ccf1 Rename MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5272
2003-01-14 22:00:31 +00:00
Chris Lattner
acef9340fe Add support for 3 new forms of MachineOperand
llvm-svn: 5217
2003-01-13 00:23:24 +00:00
Chris Lattner
831939c09a * Add printing support for FrameIndex operands
llvm-svn: 5194
2002-12-28 20:37:37 +00:00
Chris Lattner
dd307412c4 Implement printing of MBB arguments
llvm-svn: 5053
2002-12-15 20:35:25 +00:00
Chris Lattner
3afc487fba Print is const!
llvm-svn: 4737
2002-11-17 23:22:13 +00:00
Chris Lattner
8ac4eea84b Remove only uses of markDef/markDefAndUse methods
llvm-svn: 4719
2002-11-17 22:14:08 +00:00
Chris Lattner
8fa0840abd Remove fixme
llvm-svn: 4447
2002-10-30 02:02:37 +00:00
Chris Lattner
98e6bad1ee Add special code to make printing SSA form machine instructions nicer
llvm-svn: 4446
2002-10-30 01:55:38 +00:00
Chris Lattner
8dfb0ef7b0 Use MRegisterInfo, if available, to print symbolic register names
llvm-svn: 4438
2002-10-30 00:58:19 +00:00
Chris Lattner
2cfa08e4bf Implement structured machine code printing
llvm-svn: 4435
2002-10-30 00:48:05 +00:00
Chris Lattner
64fa3f3e97 Implement autoinserting ctor
llvm-svn: 4426
2002-10-29 23:19:00 +00:00
Vikram S. Adve
4acb69b4ea Remove separate vector of implicit refs from MachineInstr, and
instead record them as extra operands in the operands[] vector.
Also, move CallArgsDescriptor into this class instead of making it an
annotation on the machine instruction.

llvm-svn: 4399
2002-10-29 19:41:18 +00:00
Chris Lattner
b49e35e745 Move TargetInstrDescriptors extern to the one .cpp file that refers to it:
MachineInstr.cpp

llvm-svn: 4392
2002-10-29 17:40:30 +00:00
Chris Lattner
fa303f1bb7 Use higher level methods, don't use TargetInstrDescriptors directly!
llvm-svn: 4389
2002-10-29 17:35:39 +00:00
Chris Lattner
566b2147f9 Remove all traces of the "Opcode Mask" field in the MachineInstr class
llvm-svn: 4359
2002-10-28 21:17:20 +00:00
Chris Lattner
11f52470a0 Remove more default arguments that are never used
llvm-svn: 4358
2002-10-28 21:02:40 +00:00
Chris Lattner
990e074c2e Remove default operands that are never used
llvm-svn: 4357
2002-10-28 20:59:49 +00:00
Chris Lattner
de6ac9b0ff * Make MachineOperand ctors private, so MachineOperand can only be created
by MachineInstr.
* Add a bunch of new methods to allow incremental addition of operands to the
  machine instr instance.

llvm-svn: 4356
2002-10-28 20:48:39 +00:00
Chris Lattner
74f9160190 Remove two arguments that are never specified
llvm-svn: 4348
2002-10-28 19:46:59 +00:00
Chris Lattner
7000bbb63f Fairly major overhaul of MachineInstr & Operand classes
- Inline methods that are mostly a single line anyway
  - Eliminate several methods that were never called
  - Group methods a bit more consistently

llvm-svn: 4329
2002-10-28 04:24:49 +00:00
Chris Lattner
dd22b9e8b6 Add #includes now that MachineInstr.h doesn't include llvm/Target/MachineInstrInfo.h
llvm-svn: 4327
2002-10-28 02:28:39 +00:00
Chris Lattner
dfc8fbf16b - Two minor improvements to the MachineInstr class to reduce footprint and
overhead: Merge 3 parallel vectors into 1, change regsUsed hash_set to be a
    bitvector.  Sped up LLC a little less than 10% in a debug build!

llvm-svn: 4261
2002-10-22 23:16:21 +00:00
Vikram S. Adve
47303cde2d Add method MachineInstr::replace to rewrite a machine instruction in place.
llvm-svn: 3843
2002-09-20 00:47:49 +00:00
Vikram S. Adve
3d9c3e8751 Dump routine now writes out allocated register numbers if available.
llvm-svn: 3737
2002-09-16 15:18:53 +00:00
Vikram S. Adve
87928f2098 Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.

llvm-svn: 3306
2002-08-14 16:52:58 +00:00
Chris Lattner
8a4787495a * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3278
2002-08-09 20:08:06 +00:00
Chris Lattner
05fe67c0d2 *** empty log message ***
llvm-svn: 3075
2002-07-25 06:17:51 +00:00
Vikram S. Adve
62f569e4ea Add support for marking each operand as a %hh, %hm, %lm or %lo.
Represent previous bools and these ones with flags in a single byte
per operand.

llvm-svn: 2860
2002-07-10 21:45:04 +00:00
Vikram S. Adve
a110ccca19 Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.{cpp,h}.
An (explicit or implicit) operand may now be both a def and a use.
Also add a set of regs used by each instruction.
dump() no longer takes an optional argument, which doesn't work in gdb.

llvm-svn: 2821
2002-07-08 22:38:45 +00:00
Vikram S. Adve
ad382a01be Improve printing during dumps.
llvm-svn: 2311
2002-04-25 04:31:18 +00:00
Chris Lattner
cd3575a5cf s/method/function
llvm-svn: 2177
2002-04-08 22:01:15 +00:00
Vikram S. Adve
edc1adae11 Bug fix in setting CC register.
Also use distinct names for the three types of SetMachineOperand
to avoid painful overloading problems and errors.

llvm-svn: 1904
2002-03-18 03:35:24 +00:00
Chris Lattner
b8b17dc6dc * Prune #includes
* Remove MachineCodeFor(Method|VMInstr) code to their own .cpp files

llvm-svn: 1649
2002-02-03 07:46:01 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
c4a5815033 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()

llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Ruchira Sasanka
647337ad60 Added naming to inserted phi copy values - for easy debugging
llvm-svn: 1325
2001-11-15 20:46:40 +00:00
Vikram S. Adve
bcd2ba2fea Modify AllocateLocalVar method to take a size argument.
llvm-svn: 1318
2001-11-15 15:22:26 +00:00
Ruchira Sasanka
7b4fe5d51b Small changed to printing a machine operand - It the operand is a def, it prints
a star after it - only for debugging

llvm-svn: 1309
2001-11-14 20:05:23 +00:00
Vikram S. Adve
0bd498dd38 Bug fix in offset alignment computations: don't subtract the padding
value from size *before* subtracting size from offset!

llvm-svn: 1283
2001-11-12 23:26:23 +00:00
Vikram S. Adve
1fc185b8e7 Improved printing routines.
llvm-svn: 1263
2001-11-12 14:19:47 +00:00
Vikram S. Adve
31372d2b26 Adjust all stack variable offsets to be aligned by size.
llvm-svn: 1261
2001-11-12 05:17:23 +00:00
Vikram S. Adve
51265e7072 Fix errors in computing downgrowing offsets, and in
computing size of extra outgoing args.

llvm-svn: 1256
2001-11-11 21:23:33 +00:00
Vikram S. Adve
2cdcbfb6e0 Major overhaul of stack frame management.
llvm-svn: 1185
2001-11-08 04:47:06 +00:00
Vikram S. Adve
24fbd417a0 Make reg. numbers signed ints.
llvm-svn: 1137
2001-11-05 03:56:02 +00:00
Vikram S. Adve
c63a39ae14 Added class MachineCodeForMethod.
llvm-svn: 947
2001-10-22 13:51:33 +00:00
Ruchira Sasanka
33e147a7d0 Added implict operand printing for operator( ostream, MachineInstr&)
llvm-svn: 912
2001-10-18 22:40:02 +00:00
Vikram S. Adve
34b17e8a37 1. Add a bottom-up pass on BURG trees that is used to fix constant operands.
Needs to be bottom up because constant values may be forward-substituted
   to their uses (i.e., into the parent in the BURG tree).
2. Move most of the constant-fixup code into machine-indepedent file
   InstrSelectionSupport.cpp.

llvm-svn: 859
2001-10-17 23:57:50 +00:00
Vikram S. Adve
34c44524a7 Moved code generation support routines to InstrSelectionSupport.cpp.
llvm-svn: 717
2001-10-10 20:49:07 +00:00
Chris Lattner
ad1b0a1a83 Convert more code to use new style casts
Eliminate old style casts from value.h

llvm-svn: 696
2001-10-01 20:11:19 +00:00
Vikram S. Adve
7b68e7247a Improved dump for disp type operand.
llvm-svn: 679
2001-09-30 23:44:19 +00:00
Vikram S. Adve
296070fa2c Minor changes.
llvm-svn: 613
2001-09-18 12:56:28 +00:00
Ruchira Sasanka
3706ce9f36 added setRegForValue to MachineOperand class
llvm-svn: 591
2001-09-15 19:07:45 +00:00
Chris Lattner
70439801a6 Eliminate MainTreeNode function
llvm-svn: 550
2001-09-11 23:22:43 +00:00
Chris Lattner
52084c119f Fix a bug I introduced (assertion failed: Unknown operand type), and convert to predicate style for type checks
llvm-svn: 531
2001-09-10 19:43:38 +00:00
Chris Lattner
3bce6b369a Implement the subset of the GetConstantValueAsSignedInt function that is needed, locally.
llvm-svn: 524
2001-09-09 23:01:32 +00:00
Chris Lattner
d681b883a6 Fix problems with freeing memory twice
llvm-svn: 520
2001-09-09 22:26:29 +00:00
Chris Lattner
2e74f6ba1f Fix build breakage. :(
llvm-svn: 511
2001-09-09 19:52:23 +00:00
Chris Lattner
e1acc842ba The header file for a translation unit should always be included first
System headers should be last

llvm-svn: 475
2001-09-07 17:18:30 +00:00
Vikram S. Adve
89228a786c Moved function PrintMachineInstructions here.
llvm-svn: 392
2001-08-28 23:02:39 +00:00
Vikram S. Adve
33b366f516 Always set isDef for operand in position resultPos.
llvm-svn: 357
2001-08-13 16:32:45 +00:00
Ruchira Sasanka
af7ba34d58 Changed SetMachineOpernad calls in Set3OperandsFromInstr so that the
result position is a def (i.e., added true to the end of call) -- Ruchira

llvm-svn: 356
2001-08-13 16:26:28 +00:00
Ruchira Sasanka
a6cea3a426 *** empty log message ***
llvm-svn: 351
2001-08-07 21:01:23 +00:00
Ruchira Sasanka
01c14da143 added a default isDef arg to SetMachineOperand method - Ruchira
llvm-svn: 350
2001-08-07 20:16:52 +00:00
Vikram S. Adve
46dd49a011 Allow machine instructions with variable numbers of arguments.
This is used only by Phi for now.

llvm-svn: 336
2001-07-31 21:49:28 +00:00
Vikram S. Adve
a6bcc3a47e Eliminate separate enum for operand register type.
Use union for alternative data for different operand types.
Add iterator over Value* operands in a MachineInstr.

llvm-svn: 307
2001-07-28 04:06:37 +00:00
Chris Lattner
a601339af2 Eliminated the Unique class in favor of NonCopyable and NonCopyableV
llvm-svn: 280
2001-07-23 18:26:21 +00:00
Chris Lattner
9329758c8c Eliminate lots of unnecessary #includes and forward decls
there are probably more to kill

llvm-svn: 261
2001-07-21 23:24:48 +00:00
Chris Lattner
f1a2e3b6bb Renamed include/llvm/Codegen to include/llvm/CodeGen
llvm-svn: 253
2001-07-21 20:58:30 +00:00
Vikram S. Adve
7145b98c93 Instruction selection via pattern matching on instruction trees using BURG.
llvm-svn: 231
2001-07-21 12:41:50 +00:00