aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86InstrCompiler.td
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-10-26 21:12:27 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-10-26 21:12:27 +0000
commite840e88239cf92a065cbf5f5b9c7d18bc139c0e1 (patch)
tree35284b23a73dec41789d4f75e55078bd4a090c70 /lib/Target/X86/X86InstrCompiler.td
parent75757f9fd13bffc51a6aa30eefe706c4f84d0913 (diff)
downloadexternal_llvm-e840e88239cf92a065cbf5f5b9c7d18bc139c0e1.zip
external_llvm-e840e88239cf92a065cbf5f5b9c7d18bc139c0e1.tar.gz
external_llvm-e840e88239cf92a065cbf5f5b9c7d18bc139c0e1.tar.bz2
This commit introduces two fake instructions MORESTACK_RET and
MORESTACK_RET_RESTORE_R10; which are lowered to a RET and a RET followed by a MOV respectively. Having a fake instruction prevents the verifier from seeing a MachineBasicBlock end with a non-terminator (MOV). It also prevents the rather eccentric case of a MachineBasicBlock ending with RET but having successors nevertheless. Patch by Sanjoy Das. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrCompiler.td')
-rw-r--r--lib/Target/X86/X86InstrCompiler.td18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrCompiler.td b/lib/Target/X86/X86InstrCompiler.td
index da28690..5f9bf16 100644
--- a/lib/Target/X86/X86InstrCompiler.td
+++ b/lib/Target/X86/X86InstrCompiler.td
@@ -150,6 +150,24 @@ def EH_RETURN64 : I<0xC3, RawFrm, (outs), (ins GR64:$addr),
}
//===----------------------------------------------------------------------===//
+// Pseudo instructions used by segmented stacks.
+//
+
+// This is lowered into a RET instruction by MCInstLower. We need
+// this so that we don't have to have a MachineBasicBlock which ends
+// with a RET and also has successors.
+let isPseudo = 1 in {
+def MORESTACK_RET: I<0, Pseudo, (outs), (ins),
+ "", []>;
+
+// This instruction is lowered to a RET followed by a MOV. The two
+// instructions are not generated on a higher level since then the
+// verifier sees a MachineBasicBlock ending with a non-terminator.
+def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (ins),
+ "", []>;
+}
+
+//===----------------------------------------------------------------------===//
// Alias Instructions
//===----------------------------------------------------------------------===//