Commit Graph

153 Commits

Author SHA1 Message Date
Owen Anderson
d94b6a16fe Move some more functionality from MRegisterInfo to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45603 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 23:57:37 +00:00
Owen Anderson
f6372aa1cc Move some more instruction creation methods from RegisterInfo into InstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 21:11:32 +00:00
Chris Lattner
6410552250 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45475 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 01:03:04 +00:00
Owen Anderson
d10fd9791c Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
Machine-level API cleanup instigated by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45470 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-31 06:32:00 +00:00
Chris Lattner
7ed47a1335 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:42 +00:00
Bill Wendling
4be2f7fe57 s/hasSideEffects/hasUnmodelledSideEffects/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 23:19:54 +00:00
Bill Wendling
882d291487 Add "hasSideEffects" method to MachineInstrInfo class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45126 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 21:53:30 +00:00
Bill Wendling
7d9e97c2ac As per feedback, revised comments to (hopefully) make the different side effect
flags clearer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 21:02:07 +00:00
Bill Wendling
6b1da9c39f Add flags to indicate that there are "never" side effects or that there "may be"
side effects for machine instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 01:48:59 +00:00
Evan Cheng
6e141fd048 Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 23:12:09 +00:00
Dan Gohman
8d2ed33f6f Remove a forward-declaration for a non-existant class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44955 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 22:25:09 +00:00
Bill Wendling
8245aab330 Bit masks conflicted. Needed to bump them by one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 01:51:58 +00:00
Bill Wendling
041b3f8356 Reverting 44702. It wasn't correct to rename them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:58:46 +00:00
Bill Wendling
320c630c1b Renaming:
isTriviallyReMaterializable -> hasNoSideEffects
  isReallyTriviallyReMaterializable -> isTriviallyReMaterializable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 07:17:56 +00:00
Owen Anderson
20ab29068d Add a flag for indirect branch instructions.
Target maintainers: please check that the instructions for your target are correctly marked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 07:39:39 +00:00
Evan Cheng
ffddf97e5d Added getNumDefs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41901 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 00:16:29 +00:00
Evan Cheng
b5910820ce Added TargetInstrDescriptor::numDefs - num of results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 00:20:17 +00:00
Christopher Lamb
08d52071ba Add target independent MachineInstr's to represent subreg insert/extract in MBB's. PR1350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40518 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 07:48:21 +00:00
Evan Cheng
ed80ef6089 Add OptionalDefOperand. Remove clobbersPred. Also add DefinesPredicate to be used by if-converter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 18:06:29 +00:00
Dan Gohman
2c8c3e2e31 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38456 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-09 15:15:24 +00:00
Dan Gohman
d45eddd214 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37728 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-26 00:48:07 +00:00
Dan Gohman
82a87a0172 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 01:48:05 +00:00
Evan Cheng
4e6b1e1d99 Replace CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37642 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 01:21:41 +00:00
Evan Cheng
61a2598ebe Added CanBeDuplicated(). It returns true if an instruction can be safely duplicated (e.g. during ifcvt).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37605 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 21:13:54 +00:00
Dale Johannesen
318093b6f8 Do not treat FP_REG_KILL as terminator in branch analysis (X86).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37578 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-14 22:03:45 +00:00
Dan Gohman
c101e95cb6 Add a target hook to allow loads from constant pools to be rematerialized, and an
implementation for x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37576 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-14 20:50:44 +00:00
Evan Cheng
bfd2ec4a8e Add a utility routine to check for unpredicated terminator instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37528 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-08 21:59:56 +00:00
Evan Cheng
f94ab6a662 Add a machine instruction flag indicating the instruction can clobber condition code / register(s) used to predicate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 10:13:55 +00:00
Evan Cheng
f277ee4be7 Add missing const qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37341 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-29 18:35:22 +00:00
Evan Cheng
4f85cd7704 Add a couple of target hooks for predication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-23 07:19:12 +00:00
Evan Cheng
d46a8ea5d5 Consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-22 01:21:58 +00:00
Evan Cheng
b5cdaa257e RemoveBranch() and InsertBranch() now returns number of instructions deleted / inserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-18 00:05:48 +00:00
Evan Cheng
d9e9efb253 Remove. Not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-17 00:11:35 +00:00
Evan Cheng
d60483ef99 Add target hook to specify block size limit for if-conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37134 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-16 23:45:53 +00:00
Evan Cheng
02c602b333 PredicateInstruction returns true if the operation was successful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37124 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-16 21:53:07 +00:00
Evan Cheng
1bccb49082 Rename M_PREDICATED to M_PREDICABLE; Move TargetInstrInfo::isPredicatable() to MachineInstr::isPredicable().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-16 20:43:42 +00:00
Evan Cheng
6c1d2b90e3 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-16 05:09:34 +00:00
Evan Cheng
0402e170e8 Add TargetInstrInfo predication hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37091 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-16 01:58:56 +00:00
Evan Cheng
5de723c118 All operands that made up of the predicate operands are maked M_PREDICATE_OPERAND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-15 01:21:27 +00:00
Evan Cheng
5d5c93f659 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-19 06:19:16 +00:00
Evan Cheng
2864eee7a3 These forward declarations are not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-16 08:41:06 +00:00
Jeff Cohen
fb062ece96 Fix for VS 2005 problem supplied by Morten Ofstad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35098 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-14 15:25:21 +00:00
Jim Laskey
1ee2925742 Make LABEL a builtin opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33537 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 14:34:52 +00:00
Evan Cheng
f2f6a1baf7 Silly assertion. Forgot variable_ops instructions can have arbitrary number of
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32592 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 06:37:08 +00:00
Evan Cheng
cc22a7a2ad Move findTiedToSrcOperand to TargetInstrDescriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:45:48 +00:00
Evan Cheng
3cc3816cd4 Use MI's TargetInstrDescriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32352 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 07:57:56 +00:00
Evan Cheng
6c14147d93 - Add getOperandConstraint() to TargetInstrDescriptor.
- convertToThreeAddress() change to allow single two-address MI to be converted
  into one or more 3-address MIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32094 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 21:46:55 +00:00
Evan Cheng
33247d537d Add opcode to TargetInstrDescriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31802 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 01:36:01 +00:00
Evan Cheng
a1fd6504aa Remove M_2_ADDR_FLAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31583 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 02:22:54 +00:00
Chris Lattner
f6e8e6bace Add a new operand flag to mark which operand is the first predicate operand
of an M_PREDICATED instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31482 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-06 23:53:08 +00:00