summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-09-13 19:03:12 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-09-13 19:03:12 +0000
commit25dba30017b145910b9f5719a015299b7989f642 (patch)
tree174b2690e2597e629c089910a0283a8980e772d0 /llvm/lib/CodeGen/MachineInstr.cpp
parent81335bec96eb03d70e5ea6cb15afdf0d265d2cb9 (diff)
downloadbcm5719-llvm-25dba30017b145910b9f5719a015299b7989f642.tar.gz
bcm5719-llvm-25dba30017b145910b9f5719a015299b7989f642.zip
AMDGPU: Support commuting a FrameIndex operand
llvm-svn: 281369
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index cc33b1efdbf..e2bbe3cb870 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -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.
OpenPOWER on IntegriCloud