AMDGPU: Support commuting a FrameIndex operand

llvm-svn: 281369
This commit is contained in:
Matt Arsenault
2016-09-13 19:03:12 +00:00
parent 81335bec96
commit 25dba30017
4 changed files with 44 additions and 9 deletions

View File

@@ -175,6 +175,16 @@ void MachineOperand::ChangeToMCSymbol(MCSymbol *Sym) {
Contents.Sym = Sym;
}
void MachineOperand::ChangeToFrameIndex(int Idx) {
assert((!isReg() || !isTied()) &&
"Cannot change a tied operand into a FrameIndex");
removeRegFromUses();
OpKind = MO_FrameIndex;
setIndex(Idx);
}
/// ChangeToRegister - Replace this operand with a new register operand of
/// the specified value. If an operand is known to be an register already,
/// the setReg method should be used.