diff options
Diffstat (limited to 'contrib/llvm-project/llvm/include/llvm/Target/TargetInstrPredicate.td')
-rw-r--r-- | contrib/llvm-project/llvm/include/llvm/Target/TargetInstrPredicate.td | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/Target/TargetInstrPredicate.td b/contrib/llvm-project/llvm/include/llvm/Target/TargetInstrPredicate.td index 5623461c648d..9f2cde9d9230 100644 --- a/contrib/llvm-project/llvm/include/llvm/Target/TargetInstrPredicate.td +++ b/contrib/llvm-project/llvm/include/llvm/Target/TargetInstrPredicate.td @@ -11,7 +11,7 @@ // MCInstPredicate definitions are used by target scheduling models to describe // constraints on instructions. // -// Here is an example of an MCInstPredicate definition in tablegen: +// Here is an example of an MCInstPredicate definition in TableGen: // // def MCInstPredicateExample : CheckAll<[ // CheckOpcode<[BLR]>, @@ -126,6 +126,11 @@ class CheckRegOperand<int Index, Register R> : CheckOperandBase<Index> { // Check if register operand at index `Index` is the invalid register. class CheckInvalidRegOperand<int Index> : CheckOperandBase<Index>; +// Return true if machine operand at position `Index` is a valid +// register operand. +class CheckValidRegOperand<int Index> : + CheckNot<CheckInvalidRegOperand<Index>>; + // Check that the operand at position `Index` is immediate `Imm`. // If field `FunctionMapper` is a non-empty string, then function // `FunctionMapper` is applied to the operand value, and the return value is then @@ -254,6 +259,20 @@ class CheckFunctionPredicate<string MCInstFn, string MachineInstrFn> : MCInstPre string MachineInstrFnName = MachineInstrFn; } +// Similar to CheckFunctionPredicate. However it assumes that MachineInstrFn is +// a method in TargetInstrInfo, and MCInstrFn takes an extra pointer to +// MCInstrInfo. +// +// It Expands to: +// - TIIPointer->MachineInstrFn(MI) +// - MCInstrFn(MI, MCII); +class CheckFunctionPredicateWithTII<string MCInstFn, string MachineInstrFn, string +TIIPointer = "TII"> : MCInstPredicate { + string MCInstFnName = MCInstFn; + string TIIPtrName = TIIPointer; + string MachineInstrFnName = MachineInstrFn; +} + // Used to classify machine instructions based on a machine instruction // predicate. // @@ -300,8 +319,8 @@ class DepBreakingClass<list<Instruction> opcodes, MCInstPredicate pred, // - A list of subtarget hooks (Delegates) that are called from this function. // class STIPredicateDecl<string name, MCInstPredicate default = FalsePred, - bit overrides = 1, bit expandForMC = 1, - bit updatesOpcodeMask = 0, + bit overrides = true, bit expandForMC = true, + bit updatesOpcodeMask = false, list<STIPredicateDecl> delegates = []> { string Name = name; @@ -336,7 +355,7 @@ class STIPredicate<STIPredicateDecl declaration, // Convenience classes and definitions used by processor scheduling models to // describe dependency breaking instructions and move elimination candidates. -let UpdatesOpcodeMask = 1 in { +let UpdatesOpcodeMask = true in { def IsZeroIdiomDecl : STIPredicateDecl<"isZeroIdiom">; |