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

382 Commits

Author SHA1 Message Date
Dan Gohman
c8097f8c8c Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminating
the need for a flavor operand, and add a new SDNode subclass,
LabelSDNode, for use with them to eliminate the need for a label id
operand.

Change instruction selection to let these label nodes through
unmodified instead of creating copies of them. Teach the MachineInstr
emitter how to emit a MachineInstr directly from an ISD label node.

This avoids the need for allocating SDNodes for the label id and
flavor value, as well as SDNodes for each of the post-isel label,
label id, and label flavor.

llvm-svn: 52943
2008-07-01 00:05:16 +00:00
Evan Cheng
2dfe8c2435 Add option to commuteInstruction() which forces it to create a new (commuted) instruction.
llvm-svn: 52308
2008-06-16 07:33:11 +00:00
Bill Wendling
646f3458c4 Constify the machine instruction passed into the
"is{Trivially,Really}ReMaterializable" methods.

llvm-svn: 51001
2008-05-12 20:54:26 +00:00
Nicolas Geoffray
82baa2d2c6 Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented
llvm-svn: 49809
2008-04-16 20:10:13 +00:00
Evan Cheng
38a755499d Move reMaterialize() from TargetRegisterInfo to TargetInstrInfo.
llvm-svn: 48995
2008-03-31 20:40:39 +00:00
Christopher Lamb
b4f4b41048 Make insert_subreg a two-address instruction, vastly simplifying LowerSubregs pass. Add a new TII, subreg_to_reg, which is like insert_subreg except that it takes an immediate implicit value to insert into rather than a register.
llvm-svn: 48412
2008-03-16 03:12:01 +00:00
Evan Cheng
11d2c09adc Replace all target specific implicit def instructions with a target independent one: TargetInstrInfo::IMPLICIT_DEF.
llvm-svn: 48380
2008-03-15 00:03:38 +00:00
Christopher Lamb
0f1c32eb63 Get rid of a pseudo instruction and replace it with subreg based operation on real instructions, ridding the asm printers of the hack used to do this previously. In the process, update LowerSubregs to be careful about eliminating copies that have side affects.
Note: the coalescer will have to be careful about this too, when it starts coalescing insert_subreg nodes.
llvm-svn: 48329
2008-03-13 05:47:01 +00:00
Evan Cheng
2cb3fd8f72 Added CommuteChangesDestination(). This returns true if commuting the specified
machine instr will change its definition register.

llvm-svn: 47166
2008-02-15 18:21:33 +00:00
Evan Cheng
90f03a0b88 It's not always safe to fold movsd into xorpd, etc. Check the alignment of the load address first to make sure it's 16 byte aligned.
llvm-svn: 46893
2008-02-08 21:20:40 +00:00
Evan Cheng
c57ec111f2 SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.

llvm-svn: 46659
2008-02-02 04:07:54 +00:00
Chris Lattner
bfffa4f21e Simplify the side effect stuff a bit more and make licm/sinking
both work right according to the new flags.

This removes the TII::isReallySideEffectFree predicate, and adds
TII::isInvariantLoad. 

It removes NeverHasSideEffects+MayHaveSideEffects and adds
UnmodeledSideEffects as machine instr flags.  Now the clients
can decide everything they need.

I think isRematerializable can be implemented in terms of the
flags we have now, though I will let others tackle that.

llvm-svn: 45843
2008-01-10 23:08:24 +00:00
Chris Lattner
ba567fa77b split TargetInstrDesc out into its own header file.
llvm-svn: 45696
2008-01-07 07:33:08 +00:00
Chris Lattner
f83aae613c rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.

llvm-svn: 45695
2008-01-07 07:27:27 +00:00
Chris Lattner
c9e870d7c6 remove a dead method.
llvm-svn: 45694
2008-01-07 06:47:10 +00:00
Chris Lattner
57e851edfe Rename all the M_* flags to be namespace qualified enums, and switch
all clients over to using predicates instead of these flags directly.
These are now private values which are only to be used to statically
initialize the tables.

llvm-svn: 45692
2008-01-07 06:42:05 +00:00
Chris Lattner
c745aa59b3 add more and significantly better comments to the rest of the machineinstr
flags that can be set.  Add predicates for the ones lacking it, and switch
some clients over to using the predicates instead of Flags directly.

llvm-svn: 45690
2008-01-07 06:21:53 +00:00
Chris Lattner
1cdb8f4da1 add some mroe comments, add a isImplicitDef() method, add
isConditionalBranch() and isUnconditionalBranch() methods.

llvm-svn: 45688
2008-01-07 05:38:38 +00:00
Chris Lattner
9b987de2c5 rename hasVariableOperands() -> isVariadic(). Add some comments.
Evan, please review the comments I added to getNumDefs to make sure
that they are accurate, thx.

llvm-svn: 45687
2008-01-07 05:19:29 +00:00
Chris Lattner
b0e50db817 Move M_* flags down in the file. Move SchedClass up in the
TargetInstrDescriptor class and shrink to 16-bits, saving a 
word in TargetInstrDescriptor.  Add some comments.

llvm-svn: 45686
2008-01-07 05:06:49 +00:00
Chris Lattner
9d38dfa4a5 Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor
llvm-svn: 45680
2008-01-07 03:13:06 +00:00
Chris Lattner
55343065e3 remove MachineOpCode typedef.
llvm-svn: 45679
2008-01-07 02:48:55 +00:00
Chris Lattner
96d0a93f8e remove some uses of MachineOpCode, move getSchedClass
into TargetInstrDescriptor from TargetInstrInfo.

llvm-svn: 45678
2008-01-07 02:46:03 +00:00
Chris Lattner
93e1e6ee12 Add predicates methods to TargetOperandInfo, and switch all clients
over to using them, instead of diddling Flags directly.  Change the
various flags from const variables to enums.

llvm-svn: 45677
2008-01-07 02:39:19 +00:00
Chris Lattner
f7f96d818f Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into 
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around.  Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.

llvm-svn: 45674
2008-01-07 01:56:04 +00:00
Owen Anderson
f19692b2f6 Move even more functionality from MRegisterInfo into TargetInstrInfo.
Some day I'll get it all moved over...

llvm-svn: 45672
2008-01-07 01:35:02 +00:00
Chris Lattner
14310afe42 rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.
llvm-svn: 45667
2008-01-06 23:38:27 +00:00
Chris Lattner
5489888580 rename isStore -> mayStore to more accurately reflect what it captures.
llvm-svn: 45656
2008-01-06 08:36:04 +00:00
Chris Lattner
06c02cdcbc describe isStore and simplify the implementation of hasUnmodelledSideEffects.
No functionality change. 

llvm-svn: 45651
2008-01-06 05:43:21 +00:00
Owen Anderson
2adf8c5533 Move some more functionality from MRegisterInfo to TargetInstrInfo.
llvm-svn: 45603
2008-01-04 23:57:37 +00:00
Owen Anderson
e6856128ab Move some more instruction creation methods from RegisterInfo into InstrInfo.
llvm-svn: 45484
2008-01-01 21:11:32 +00:00
Chris Lattner
1285ec2ae7 Fix a problem where lib/Target/TargetInstrInfo.h would include and use
a header file from libcodegen.  This violates a layering order: codegen
depends on target, not the other way around.  The fix to this is to 
split TII into two classes, TII and TargetInstrInfoImpl, which defines
stuff that depends on libcodegen.  It is defined in libcodegen, where 
the base is not.

llvm-svn: 45475
2008-01-01 01:03:04 +00:00
Owen Anderson
ae7e2c1e03 Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
Machine-level API cleanup instigated by Chris.

llvm-svn: 45470
2007-12-31 06:32:00 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Bill Wendling
0df69490dd s/hasSideEffects/hasUnmodelledSideEffects/g
llvm-svn: 45133
2007-12-17 23:19:54 +00:00
Bill Wendling
2d672998c5 Add "hasSideEffects" method to MachineInstrInfo class.
llvm-svn: 45126
2007-12-17 21:53:30 +00:00
Bill Wendling
ec8be72a8b As per feedback, revised comments to (hopefully) make the different side effect
flags clearer.

llvm-svn: 45120
2007-12-17 21:02:07 +00:00
Bill Wendling
c8c611e88f Add flags to indicate that there are "never" side effects or that there "may be"
side effects for machine instructions.

llvm-svn: 45022
2007-12-14 01:48:59 +00:00
Evan Cheng
64a1febf9a Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.
llvm-svn: 44960
2007-12-12 23:12:09 +00:00
Dan Gohman
4bf237b584 Remove a forward-declaration for a non-existant class.
llvm-svn: 44955
2007-12-12 22:25:09 +00:00
Bill Wendling
e8eea25ad3 Bit masks conflicted. Needed to bump them by one.
llvm-svn: 44903
2007-12-12 01:51:58 +00:00
Bill Wendling
8d8d9a2f5e Reverting 44702. It wasn't correct to rename them.
llvm-svn: 44727
2007-12-08 23:58:46 +00:00
Bill Wendling
d10837def7 Renaming:
isTriviallyReMaterializable -> hasNoSideEffects
  isReallyTriviallyReMaterializable -> isTriviallyReMaterializable

llvm-svn: 44702
2007-12-08 07:17:56 +00:00
Owen Anderson
aba398a5ce Add a flag for indirect branch instructions.
Target maintainers: please check that the instructions for your target are correctly marked.

llvm-svn: 44012
2007-11-12 07:39:39 +00:00
Evan Cheng
827f269fac Added getNumDefs().
llvm-svn: 41901
2007-09-13 00:16:29 +00:00
Evan Cheng
8f126e59f5 Added TargetInstrDescriptor::numDefs - num of results.
llvm-svn: 40709
2007-08-02 00:20:17 +00:00
Christopher Lamb
9a0d88efde Add target independent MachineInstr's to represent subreg insert/extract in MBB's. PR1350
llvm-svn: 40518
2007-07-26 07:48:21 +00:00
Evan Cheng
6125079452 Add OptionalDefOperand. Remove clobbersPred. Also add DefinesPredicate to be used by if-converter.
llvm-svn: 38499
2007-07-10 18:06:29 +00:00
Dan Gohman
3f7558673e Fix a typo in a comment.
llvm-svn: 38456
2007-07-09 15:15:24 +00:00
Dan Gohman
9cbc3fb1ab Revert the earlier change that removed the M_REMATERIALIZABLE machine
instruction flag, and use the flag along with a virtual member function
hook for targets to override if there are instructions that are only
trivially rematerializable with specific operands (i.e. constant pool
loads).

llvm-svn: 37728
2007-06-26 00:48:07 +00:00
Dan Gohman
b60d8a92c9 Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoad
with a general target hook to identify rematerializable instructions. Some
instructions are only rematerializable with specific operands, such as loads
from constant pools, while others are always rematerializable. This hook
allows both to be identified as being rematerializable with the same
mechanism.

llvm-svn: 37644
2007-06-19 01:48:05 +00:00
Evan Cheng
4358a7f1e9 Replace CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
llvm-svn: 37642
2007-06-19 01:21:41 +00:00
Evan Cheng
34a6cb0b2e Added CanBeDuplicated(). It returns true if an instruction can be safely duplicated (e.g. during ifcvt).
llvm-svn: 37605
2007-06-15 21:13:54 +00:00
Dale Johannesen
62f49dd524 Do not treat FP_REG_KILL as terminator in branch analysis (X86).
llvm-svn: 37578
2007-06-14 22:03:45 +00:00
Dan Gohman
35f2b4d716 Add a target hook to allow loads from constant pools to be rematerialized, and an
implementation for x86.

llvm-svn: 37576
2007-06-14 20:50:44 +00:00
Evan Cheng
1a6c0341fd Add a utility routine to check for unpredicated terminator instruction.
llvm-svn: 37528
2007-06-08 21:59:56 +00:00
Evan Cheng
4de6599e83 Add a machine instruction flag indicating the instruction can clobber condition code / register(s) used to predicate instructions.
llvm-svn: 37464
2007-06-06 10:13:55 +00:00
Evan Cheng
d8b25a2091 Add missing const qualifiers.
llvm-svn: 37341
2007-05-29 18:35:22 +00:00
Evan Cheng
f2d1d0124e Add a couple of target hooks for predication.
llvm-svn: 37306
2007-05-23 07:19:12 +00:00
Evan Cheng
7d3f771e9c Consistency.
llvm-svn: 37274
2007-05-22 01:21:58 +00:00
Evan Cheng
234aab208a RemoveBranch() and InsertBranch() now returns number of instructions deleted / inserted.
llvm-svn: 37192
2007-05-18 00:05:48 +00:00
Evan Cheng
dc9e574073 Remove. Not needed.
llvm-svn: 37139
2007-05-17 00:11:35 +00:00
Evan Cheng
3163b77d5e Add target hook to specify block size limit for if-conversion.
llvm-svn: 37134
2007-05-16 23:45:53 +00:00
Evan Cheng
973f4a19cb PredicateInstruction returns true if the operation was successful.
llvm-svn: 37124
2007-05-16 21:53:07 +00:00
Evan Cheng
3b10540b5e Rename M_PREDICATED to M_PREDICABLE; Move TargetInstrInfo::isPredicatable() to MachineInstr::isPredicable().
llvm-svn: 37115
2007-05-16 20:43:42 +00:00
Evan Cheng
770584a8cd Fix comments.
llvm-svn: 37096
2007-05-16 05:09:34 +00:00
Evan Cheng
7fe6d7cb7e Add TargetInstrInfo predication hooks.
llvm-svn: 37091
2007-05-16 01:58:56 +00:00
Evan Cheng
71c4d42bd7 All operands that made up of the predicate operands are maked M_PREDICATE_OPERAND.
llvm-svn: 37062
2007-05-15 01:21:27 +00:00
Evan Cheng
2081cf96ed Add a TargetInstrDescriptor flag to mark an instruction as "re-materializable".
It means the instruction can be easily re-materialized at any point. e.g.
constant generation, load from constantpool.

llvm-svn: 35158
2007-03-19 06:19:16 +00:00
Evan Cheng
0408dc0d37 These forward declarations are not needed.
llvm-svn: 35120
2007-03-16 08:41:06 +00:00
Jeff Cohen
b19ec59b5c Fix for VS 2005 problem supplied by Morten Ofstad.
llvm-svn: 35098
2007-03-14 15:25:21 +00:00
Jim Laskey
23ed7d2625 Make LABEL a builtin opcode.
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Evan Cheng
e0aa279fc8 Silly assertion. Forgot variable_ops instructions can have arbitrary number of
operands.

llvm-svn: 32592
2006-12-15 06:37:08 +00:00
Evan Cheng
88a55bdd64 Move findTiedToSrcOperand to TargetInstrDescriptor.
llvm-svn: 32366
2006-12-08 18:45:48 +00:00
Evan Cheng
dfec38a575 Use MI's TargetInstrDescriptor.
llvm-svn: 32352
2006-12-08 07:57:56 +00:00
Evan Cheng
d042dac8ab - Add getOperandConstraint() to TargetInstrDescriptor.
- convertToThreeAddress() change to allow single two-address MI to be converted
  into one or more 3-address MIs.

llvm-svn: 32094
2006-12-01 21:46:55 +00:00
Evan Cheng
6f5962e79f Add opcode to TargetInstrDescriptor.
llvm-svn: 31802
2006-11-17 01:36:01 +00:00
Evan Cheng
8743c67826 Remove M_2_ADDR_FLAG.
llvm-svn: 31583
2006-11-09 02:22:54 +00:00
Chris Lattner
b6be2b873f Add a new operand flag to mark which operand is the first predicate operand
of an M_PREDICATED instruction.

llvm-svn: 31482
2006-11-06 23:53:08 +00:00
Chris Lattner
d7138e5f2d add a flag so that predicated instructions can be recognized by branch
folding

llvm-svn: 31479
2006-11-06 21:44:17 +00:00
Evan Cheng
1da5ee8485 Rename
llvm-svn: 31364
2006-11-01 23:18:32 +00:00
Evan Cheng
b1ac9f6c12 Added getTiedToSrcOperand() to check for two-address'ness.
llvm-svn: 31360
2006-11-01 23:00:31 +00:00
Evan Cheng
c566892bd5 Add operand constraints to TargetInstrInfo.
llvm-svn: 31333
2006-11-01 00:27:05 +00:00
Chris Lattner
dcfee77788 add another target hook for branch folding.
llvm-svn: 31262
2006-10-28 17:29:57 +00:00
Chris Lattner
bc4f0e8b56 update comment
llvm-svn: 31165
2006-10-24 17:41:22 +00:00
Rafael Espindola
b35e4b16ae fix assert comment
llvm-svn: 31154
2006-10-24 14:47:28 +00:00
Chris Lattner
7353b07275 expose DWARF_LABEL opcode# so the branch folder can update debug info properly.
llvm-svn: 31024
2006-10-17 22:41:45 +00:00
Chris Lattner
ea84388ac0 update comment
llvm-svn: 31023
2006-10-17 22:12:15 +00:00
Chris Lattner
b441d8e8ce it is easier to implement these when they are virtual
llvm-svn: 30944
2006-10-13 21:02:27 +00:00
Chris Lattner
520bf168f5 allow branch reversal to fail
llvm-svn: 30943
2006-10-13 20:59:31 +00:00
Chris Lattner
f8eaaded24 replace the existing branch inspection/modification APIs with something more
useful and general.

llvm-svn: 30940
2006-10-13 20:44:01 +00:00
Jim Laskey
a67adda697 Use an enumeration to eliminate data relocations.
llvm-svn: 29249
2006-07-21 20:57:35 +00:00
Evan Cheng
6909286861 Clean up
llvm-svn: 28851
2006-06-17 01:42:20 +00:00
Evan Cheng
276a39d956 Avoid undesirable behavior when assert is not enabled.
llvm-svn: 28793
2006-06-15 08:10:27 +00:00
Evan Cheng
07d8ccec50 Instructions with variable operands (variable_ops) can have a number required
operands. e.g.
def CALL32r : I<0xFF, MRM2r, (ops GR32:$dst, variable_ops),
                "call {*}$dst", [(X86call GR32:$dst)]>;
TableGen should emit operand informations for the "required" operands.

Added a target instruction info flag M_VARIABLE_OPS to indicate the target
instruction may have more operands in addition to the minimum required
operands.

llvm-svn: 28791
2006-06-15 07:22:16 +00:00
Evan Cheng
00c1318055 lib/Target/Target.td
llvm-svn: 28386
2006-05-18 20:42:07 +00:00
Evan Cheng
0b8e4bca80 Add capability to scheduler to commute nodes for profit.
If a two-address code whose first operand has uses below, it should be commuted
when possible.

llvm-svn: 28230
2006-05-12 01:58:24 +00:00
Chris Lattner
6a2ec2cd3b Remove a bunch of dead stuff, shrinkifying TargetInstrDescriptor significantly.
llvm-svn: 27897
2006-04-20 18:32:02 +00:00
Chris Lattner
5fd145d9c4 add a hook to insert a noop
llvm-svn: 26560
2006-03-05 23:48:51 +00:00
Chris Lattner
6684ba101f Move isLoadFrom/StoreToStackSlot from MRegisterInfo to TargetInstrInfo,
a far more logical place.  Other methods should also be moved if anyone
is interested. :)

llvm-svn: 25912
2006-02-02 20:11:55 +00:00
Chris Lattner
b234392bc5 Add a common INLINEASM opcode
llvm-svn: 25667
2006-01-26 23:27:02 +00:00
Jim Laskey
4cb1e29b27 Allow itineraries to be passed through the Target Machine.
llvm-svn: 24139
2005-11-01 20:06:59 +00:00
Chris Lattner
49eef12127 Move a bunch of non-deprecated methods above the "deprecated line"
llvm-svn: 23216
2005-09-02 18:16:20 +00:00
Chris Lattner
fd72abe85b Add a new instruction flag
llvm-svn: 23093
2005-08-26 20:31:24 +00:00
Chris Lattner
6fcfaee2fc Add a new field to TargetInstrDescriptor for tracking information about
operands.

llvm-svn: 22908
2005-08-19 16:56:26 +00:00
Misha Brukman
5e38b1e17e Convert tabs to spaces
llvm-svn: 21438
2005-04-22 03:46:24 +00:00
Misha Brukman
58c97e67f3 Remove trailing whitespace
llvm-svn: 21412
2005-04-21 20:59:05 +00:00
Chris Lattner
2a03fa3a5c Add a new method, described in the comment.
llvm-svn: 19683
2005-01-19 06:53:02 +00:00
Chris Lattner
a008165daa Add some bits that can be set on instructions. Renumber existing bits so
they are dense.  Add a virtual method that targets can choose to implement.

llvm-svn: 19242
2005-01-02 02:28:31 +00:00
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
89a80a46f1 Be consistent with our naming
llvm-svn: 16552
2004-09-28 18:37:00 +00:00
Chris Lattner
c92b280e0d Capture information about whether the target instructions have delay slots
llvm-svn: 16550
2004-09-28 18:33:50 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Brian Gaeke
9e089c115d M_DUMMY_PHI_FLAG is no longer used to distinguish V9::PHI. Get rid of it and
its TargetInstrInfo accessor.

llvm-svn: 15907
2004-08-18 20:04:28 +00:00
Brian Gaeke
af14dcae5d M_PSEUDO_FLAG is no longer used. Get rid of it and its accessor.
llvm-svn: 15902
2004-08-18 17:44:17 +00:00
Brian Gaeke
69f47e236f getResultPos() is dead.
llvm-svn: 15484
2004-08-04 08:06:30 +00:00
Chris Lattner
e8b9d3f67c Fix warning
llvm-svn: 15406
2004-08-01 18:17:36 +00:00
Alkis Evlogimenos
e28642a6a5 Change signature to take two basic blocks: the target and the one
where the goto will be appended.

llvm-svn: 15361
2004-07-31 09:37:52 +00:00
Alkis Evlogimenos
b338ca7306 Doxygenify some comments.
llvm-svn: 15360
2004-07-31 08:57:27 +00:00
Alkis Evlogimenos
6308a8a8e0 Remove const from iterators passed by value.
llvm-svn: 15359
2004-07-31 08:55:23 +00:00
Alkis Evlogimenos
2ca8d29454 Add declarations for insertGoto and reverseBranchCondition.
llvm-svn: 15358
2004-07-31 08:52:30 +00:00
Chris Lattner
d46a44390f Add new M_BARRIER_FLAG flag, and isBarrier() method to TargetInstrInfo
opCode -> Opcode

llvm-svn: 15353
2004-07-31 02:06:48 +00:00
Brian Gaeke
99f18cc97f TargetInstrInfo::hasOperandInterlock() is always true, because it is
never overridden by any target.

llvm-svn: 15308
2004-07-28 19:24:48 +00:00
Brian Gaeke
1ec15e0428 ConstantTypeMustBeLoaded has been incorporated into SparcV9PreSelection, its
only user.

llvm-svn: 15294
2004-07-27 21:43:38 +00:00
Brian Gaeke
a71776e676 As it happens, none of these TargetInstrInfo methods which are only
used in the SparcV9 backend really have anything to do with
TargetInstrInfo, so we're converting them into regular old global
functions and moving their declarations to SparcV9InstrSelectionSupport.h.
(They're mostly used as helper functions for SparcV9InstrSelection.)

llvm-svn: 15277
2004-07-27 17:43:22 +00:00
Chris Lattner
b5f0e162c7 Eliminate the distinction between "real" and "unreal" instructions
llvm-svn: 11986
2004-02-29 06:31:16 +00:00
Chris Lattner
e4db708a7c Scrap a huge layer of cruft out of this interface.
llvm-svn: 11980
2004-02-29 05:57:21 +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
Brian Gaeke
7246d4efd0 Fix typos in comments.
llvm-svn: 11333
2004-02-11 19:47:43 +00:00
Alkis Evlogimenos
24b3159dfc Add TargetInstrInfo::isMoveInstr() to support coalescing in register
allocation.

llvm-svn: 10633
2003-12-28 17:35:08 +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
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
4c675245b9 The NOOP instruction is no longer needed. Instead, use the
TargetInstrInfo::isNOPinstr method

llvm-svn: 7530
2003-08-03 18:52:15 +00:00
Vikram S. Adve
b73a1c0085 Unify all constant evaluations that depend on register size
in TargetInstrInfo::ConvertConstantToIntType.

llvm-svn: 7398
2003-07-29 20:30:20 +00:00
Chris Lattner
be4a5081d1 #include <cassert> as necessary...
llvm-svn: 7315
2003-07-25 17:58:41 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Brian Gaeke
6f2c46cd52 Nice tasty llc fixes. These should fix LLC for x86 for everything in
SingleSource except oopack and Oscar.  (Sorry, Oscar.)

include/llvm/Target/TargetInstrInfo.h: Remove virtual print method. Add
 accessors for ImplicitUses/Defs.
lib/Target/TargetInstrInfo.cpp: Remove virtual print method. If you
 really wanted this, just use MI->print(O, TM); instead...
lib/Target/X86:
FloatingPoint.cpp: ...like this.
X86InstrInfo.h: Remove virtual print method. Define the PrintImplUses
 target-specific flag bit.
X86InstrInfo.def: Add the PrintImplUses flag to all the instructions
 which implicitly use CL, because the assembler needs to see the CL in
 order to generate the right instruction.
Printer.cpp: Ditch fnIndex at Chris's request. Now we use CurrentFnName
  to name constants in the constant pool for each function instead. This
  avoids keeping state between runOnMachineFunction() invocations, which
  is a no-no. Having MangledGlobals be global is a bogon I'd like to get
  rid of too, but making it a static member of Printer causes link errors
  (why???).
 Make NumberForBB into a member of Printer instead of a global, too.
 Make printOp and printMemReference into methods of Printer.
 X86InstrInfo::print is now Printer::printMachineInstruction, because
  TargetInstrInfo::print is history. (Because of this, we have to qualify
  the names of some TargetInstrInfo methods we call.)
 Print out the ImplicitUses field of any instruction we print that has
  the PrintImplUses bit set.

llvm-svn: 6924
2003-06-27 00:00:48 +00:00
John Criswell
4781723de6 Included assert.h so that the code compiles under newer versions of GCC.
llvm-svn: 6682
2003-06-11 14:01:36 +00:00
Misha Brukman
6ffaa5b188 Reword to remove reference to how things worked in the past.
llvm-svn: 6323
2003-05-24 01:08:43 +00:00
Misha Brukman
151f7484ab NOP instructions are pseudo-instructions. We should not have them explicitly in
our representation, since they are usually special cases of already-existing
instructions.

This abstracts away methods that let a pass create and verify a NOP instruction,
without relying on a `NOP' enum to be in existence in the target's instruction
info descriptor.

llvm-svn: 6319
2003-05-24 00:08:39 +00:00
Chris Lattner
b27d60ccf1 Rename MachineInstrInfo -> TargetInstrInfo
llvm-svn: 5272
2003-01-14 22:00:31 +00:00
Chris Lattner
5fd0d8f44b * Start renaming MachineInstrInfo -> TargetInstrInfo
* Add new M_TERMINATOR_FLAG

llvm-svn: 5213
2003-01-13 00:21:19 +00:00
Chris Lattner
90d1ea29ab Sparc specific methods default to abort rather than being pure virtual
llvm-svn: 5169
2002-12-28 20:12:54 +00:00
Chris Lattner
b44ebe2588 Add comment
llvm-svn: 5141
2002-12-25 05:01:46 +00:00
Chris Lattner
07cc730ddd Export well known instruction opcodes usable by target independant passes
llvm-svn: 5063
2002-12-15 22:16:08 +00:00
Misha Brukman
bc60f65211 Define the 2-address flag used by X86 instructions (add,sub,and,or,xor) that
need to be declared as such.

llvm-svn: 4975
2002-12-12 23:19:51 +00:00
Chris Lattner
866d635098 Add entries to track information about implicit uses and definitions of
the instructions

llvm-svn: 4875
2002-12-03 05:41:32 +00:00
Chris Lattner
e138d4fbc8 Make sure that print gets a targetmachine
CVS: ----------------------------------------------------------------------

llvm-svn: 4735
2002-11-17 23:21:45 +00:00
Chris Lattner
9971426ca0 Add machine independant printer interface
llvm-svn: 4729
2002-11-17 22:54:55 +00:00
Chris Lattner
19f27845eb * Add new "Target Specific Flags" field to instruction descriptor
* Rename iclass to Flags

llvm-svn: 4439
2002-10-30 01:06:53 +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
4c00b1bb14 Rename opCodeString to Name, add new getName() method
llvm-svn: 4388
2002-10-29 17:35:09 +00:00
Chris Lattner
4cb6ebc9a1 Rename MachineInstrInfo::getDescriptor to MachineInstrInfo::get
llvm-svn: 4387
2002-10-29 17:26:26 +00:00
Chris Lattner
8869c9be36 MachineInstrInfo doesn't need a TargetMachine member
llvm-svn: 4371
2002-10-29 15:44:40 +00:00
Chris Lattner
dce27e5927 Strip a bunch of #includes from the file, move some virtual functions to
.cpp file

llvm-svn: 4364
2002-10-28 23:53:56 +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
c32337fb08 * s/unsigned int/unsigned
* Make MachineInstrDescriptor only keep a const char * instead of a string
  for the opcode name.

llvm-svn: 4335
2002-10-28 04:55:56 +00:00
Chris Lattner
ec393ff469 Make scheduling class variables be 'unsigned' instead of 'int'
llvm-svn: 4334
2002-10-28 04:53:18 +00:00
Misha Brukman
142795fd17 Changed MachineCodeForMethod' to MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner
5ae74dd3ef * Remove unneccesary #includes
* Fix typeo in the (unused) MachineInstrInfo::isArith method

llvm-svn: 4275
2002-10-24 22:34:41 +00:00
Vikram S. Adve
0ab2587056 Minor change to interface for Create{Zero,Sign}ExtensionsInstructions.
llvm-svn: 3979
2002-09-29 21:53:31 +00:00
Vikram S. Adve
ed466a713a Added class MachineOptInfo as interface to target-specific
routines supporting machine code optimization.
Also added method MachineInstrInfo::getNOPOpCode().

llvm-svn: 3845
2002-09-20 00:52:09 +00:00
Vikram S. Adve
59b3b6c07b Add methods to query about the representation of LLVM quantities (e.g.,
constants).  Useful for target-dependent LLVM transformations like
Preselection.

llvm-svn: 3743
2002-09-16 15:56:01 +00:00
Vikram S. Adve
055207a945 Add new function MachineInstrInfo::CreateZeroExtensionInstructions.
llvm-svn: 3582
2002-09-05 18:36:41 +00:00
Vikram S. Adve
4543e3c252 Minor change in comments.
llvm-svn: 2853
2002-07-10 21:29:22 +00:00
Vikram S. Adve
ee3fd3dda9 New function CreateSignExtensionInstructions.
Methods now take MachineCodeForInstruction& as an argument and record
temporary values in it directly, instead of return the temps.
Really simplifies callers.

llvm-svn: 2651
2002-05-19 15:43:31 +00:00
Chris Lattner
c481e92886 Rename Method to Function
llvm-svn: 1957
2002-03-23 22:51:58 +00:00
Vikram S. Adve
6e25a66e75 Added machine-independent value for INVALID_MACHINE_OPCODE.
Just cosmetic changes otherwise.

llvm-svn: 1898
2002-03-18 03:19:38 +00:00
Chris Lattner
71af76aa1d Remove #include
move typedefs here

llvm-svn: 1639
2002-02-03 07:17:37 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Ruchira Sasanka
0b15dd8a88 MachineRegInfo: Added a method to get the size of a register pushed on to stack.
llvm-svn: 1492
2002-01-07 19:17:41 +00:00
Chris Lattner
f6b7da2bb5 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h

llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner
cead7793a7 Move DataTypes.h from llvm/Support to just Support
llvm-svn: 1399
2001-11-26 23:04:08 +00:00
Vikram S. Adve
3baa8cefc0 Add function returning which operand holds immediate constant
for a given opcode.

llvm-svn: 1307
2001-11-14 18:48:36 +00:00
Ruchira Sasanka
d7daf6afcd added isPseudoInstr()
llvm-svn: 1302
2001-11-14 15:35:51 +00:00
Ruchira Sasanka
50880b3791 Changed for adding Phi Elimination code
llvm-svn: 1266
2001-11-12 14:46:00 +00:00
Ruchira Sasanka
da9d0c48ba Made isPhi const
llvm-svn: 1251
2001-11-10 20:58:58 +00:00
Vikram S. Adve
440465ad0e Added class MachineCacheInfo.
Also added function to convert float to int by copying via memory.

llvm-svn: 1221
2001-11-09 02:11:03 +00:00
Vikram S. Adve
45b91e38e5 Add method CreateCodeToCopyIntToFloat.
Include handle to TargetMachine in each Machine...Info object.

llvm-svn: 1200
2001-11-08 05:22:15 +00:00
Ruchira Sasanka
cb3cfedff4 Moved InsertCallerSaveInstr to the SparcRegInfo.cpp and made machine independent
llvm-svn: 1107
2001-11-03 17:14:13 +00:00
Vikram S. Adve
b66fc8ac17 Added virtual function to generate an instruction sequence to
load a constant into a register.

llvm-svn: 862
2001-10-18 00:02:06 +00:00
Vikram S. Adve
ed85a627bc Make class TargetMachine the common interface to all target-dependent
information, including instr, sched, and reg information.
Rename files to match the primary classes they provide.

llvm-svn: 602
2001-09-18 12:38:31 +00:00