summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2019-09-03 11:21:12 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2019-09-03 11:21:12 +0000
commitf12415812c0807d9f05e09463a3bf2cf3ced3068 (patch)
tree1afcf463b3e132941d0ad997c28d99a53dd3ee40 /llvm/lib/Target/SystemZ
parent61973d978bf95059cacb7d91ef558046d349eacd (diff)
downloadbcm5719-llvm-f12415812c0807d9f05e09463a3bf2cf3ced3068.tar.gz
bcm5719-llvm-f12415812c0807d9f05e09463a3bf2cf3ced3068.zip
[SystemZ] Add support for fentry.
SystemZAsmPrinter now properly emits function calls to __fentry__. Review: Ulrich Weigand llvm-svn: 370743
Diffstat (limited to 'llvm/lib/Target/SystemZ')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp14
-rw-r--r--llvm/lib/Target/SystemZ/SystemZAsmPrinter.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
index ef378e4ade7..f03ed2014e4 100644
--- a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
@@ -501,6 +501,10 @@ void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
break;
+ case TargetOpcode::FENTRY_CALL:
+ LowerFENTRY_CALL(*MI, Lower);
+ return;
+
case TargetOpcode::STACKMAP:
LowerSTACKMAP(*MI);
return;
@@ -546,6 +550,16 @@ static unsigned EmitNop(MCContext &OutContext, MCStreamer &OutStreamer,
}
}
+void SystemZAsmPrinter::LowerFENTRY_CALL(const MachineInstr &MI,
+ SystemZMCInstLower &Lower) {
+ MCContext &Ctx = MF->getContext();
+ MCSymbol *fentry = Ctx.getOrCreateSymbol("__fentry__");
+ const MCSymbolRefExpr *Op =
+ MCSymbolRefExpr::create(fentry, MCSymbolRefExpr::VK_PLT, Ctx);
+ OutStreamer->EmitInstruction(MCInstBuilder(SystemZ::BRASL)
+ .addReg(SystemZ::R0D).addExpr(Op), getSubtargetInfo());
+}
+
void SystemZAsmPrinter::LowerSTACKMAP(const MachineInstr &MI) {
const SystemZInstrInfo *TII =
static_cast<const SystemZInstrInfo *>(MF->getSubtarget().getInstrInfo());
diff --git a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.h b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.h
index aa5d3ca78e6..d01a17c2ebe 100644
--- a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.h
+++ b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.h
@@ -46,6 +46,7 @@ public:
}
private:
+ void LowerFENTRY_CALL(const MachineInstr &MI, SystemZMCInstLower &MCIL);
void LowerSTACKMAP(const MachineInstr &MI);
void LowerPATCHPOINT(const MachineInstr &MI, SystemZMCInstLower &Lower);
};
OpenPOWER on IntegriCloud