diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-09-25 10:20:08 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-09-25 10:20:08 +0000 |
commit | 9f3f4bf377ac93fd32c8b93ae23378a82ad0f353 (patch) | |
tree | f98e9963ce27ab007357856b4c6dda985491659f /lib/Target/SystemZ/SystemZAsmPrinter.cpp | |
parent | c2b840cb7c58e59c68aaa589841c41fb272df66d (diff) | |
download | llvm-9f3f4bf377ac93fd32c8b93ae23378a82ad0f353.tar.gz llvm-9f3f4bf377ac93fd32c8b93ae23378a82ad0f353.tar.bz2 llvm-9f3f4bf377ac93fd32c8b93ae23378a82ad0f353.tar.xz |
[SystemZ] Define the return instruction as a pseudo alias of BR
This is the first of a few patches to reduce the dupliation of encoding
information. The return instruction is a normal BR in which one of the
registers is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZAsmPrinter.cpp')
-rw-r--r-- | lib/Target/SystemZ/SystemZAsmPrinter.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/SystemZAsmPrinter.cpp index 3a57ea0afd..84227614c0 100644 --- a/lib/Target/SystemZ/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/SystemZAsmPrinter.cpp @@ -19,6 +19,7 @@ #include "llvm/CodeGen/MachineModuleInfoImpls.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCInstBuilder.h" #include "llvm/MC/MCStreamer.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Target/Mangler.h" @@ -26,9 +27,16 @@ using namespace llvm; void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) { - SystemZMCInstLower Lower(Mang, MF->getContext(), *this); MCInst LoweredMI; - Lower.lower(MI, LoweredMI); + switch (MI->getOpcode()) { + case SystemZ::Return: + LoweredMI = MCInstBuilder(SystemZ::BR).addReg(SystemZ::R14D); + break; + + default: + SystemZMCInstLower(Mang, MF->getContext(), *this).lower(MI, LoweredMI); + break; + } OutStreamer.EmitInstruction(LoweredMI); } |