Skip to content

Commit 5e6bb1f

Browse files
authored
[TableGen][Target] Add documentation to Constraints. (#85951)
This patch adds some basic documentation for `Constraints`, along with some "see also" pointers for backend writers to learn more.
1 parent 5ea1520 commit 5e6bb1f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

llvm/include/llvm/Target/Target.td

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,20 @@ class Instruction : InstructionEncoding {
697697
// Scheduling information from TargetSchedule.td.
698698
list<SchedReadWrite> SchedRW;
699699

700-
string Constraints = ""; // OperandConstraint, e.g. $src = $dst.
700+
/// Support for operand constraints. There are currently two kinds:
701+
/// "$src = $dst"
702+
/// Ensures that the operands are allocated to the same register.
703+
///
704+
/// "@earlyclobber $rd"
705+
/// Ensures that LLVM will not use the same register for any inputs (other
706+
/// than an input tied to this output).
707+
///
708+
/// See also:
709+
/// - MC/MCInstrDesc.h:OperandConstraint::{TIED_TO, EARLY_CLOBBER}.
710+
/// - CodeGen/MachineOperand.h:MachineOperand::{TiedTo, IsEarlyClobber}.
711+
/// - The LLVM IR specification: Section `Output constraints` in the
712+
/// discussion of inline assembly constraint strings.
713+
string Constraints = "";
701714

702715
/// DisableEncoding - List of operand names (e.g. "$op1,$op2") that should not
703716
/// be encoded into the output machineinstr.

0 commit comments

Comments
 (0)