Add a MachineOperand::isTied() flag.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 28 Aug 2012 18:34:41 +0000 (18:34 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 28 Aug 2012 18:34:41 +0000 (18:34 +0000)
commit4ba6916a98fffd9dedac5945ac51d40c8948069e
tree555c8ea4c58cd03471b85111b618de529b9c0e1c
parent190e342cbcb1456ebb21b53a35cfefa99435bd65
Add a MachineOperand::isTied() flag.

While in SSA form, a MachineInstr can have pairs of tied defs and uses.
The tied operands are used to represent read-modify-write operands that
must be assigned the same physical register.

Previously, tied operand pairs were computed from fixed MCInstrDesc
fields, or by using black magic on inline assembly instructions.

The isTied flag makes it possible to add tied operands to any
instruction while getting rid of (some of) the inlineasm magic.

Tied operands on normal instructions are needed to represent predicated
individual instructions in SSA form. An extra <tied,imp-use> operand is
required to represent the output value when the instruction predicate is
false.

Adding a predicate to:

  %vreg0<def> = ADD %vreg1, %vreg2

Will look like:

  %vreg0<tied,def> = ADD %vreg1, %vreg2, pred:3, %vreg7<tied,imp-use>

The virtual register %vreg7 is the value given to %vreg0 when the
predicate is false. It will be assigned the same physreg as %vreg0.

This commit adds the isTied flag and sets it based on MCInstrDesc when
building an instruction. The flag is not used for anything yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162774 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineOperand.h
lib/CodeGen/MachineInstr.cpp