From d5a9c2d551a7c7a888b1fc009815cff571d97dbb Mon Sep 17 00:00:00 2001 From: Jonas Paulsson Date: Wed, 15 Aug 2018 15:04:49 +0000 Subject: [PATCH] [SystemZ] New CL option to enable subreg liveness This option is needed to enable subreg liveness tracking during register allocation. Review: Ulrich Weigand https://reviews.llvm.org/D50779 llvm-svn: 339776 --- llvm/lib/Target/SystemZ/SystemZSubtarget.cpp | 10 ++++++++++ llvm/lib/Target/SystemZ/SystemZSubtarget.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp b/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp index 9cd09b0f911e..fb030a207bc7 100644 --- a/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp +++ b/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp @@ -19,6 +19,11 @@ using namespace llvm; #define GET_SUBTARGETINFO_CTOR #include "SystemZGenSubtargetInfo.inc" +static cl::opt UseSubRegLiveness( + "systemz-subreg-liveness", + cl::desc("Enable subregister liveness tracking for SystemZ (experimental)"), + cl::Hidden); + // Pin the vtable to this file. void SystemZSubtarget::anchor() {} @@ -54,6 +59,11 @@ SystemZSubtarget::SystemZSubtarget(const Triple &TT, const std::string &CPU, TargetTriple(TT), InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this), TSInfo(), FrameLowering() {} + +bool SystemZSubtarget::enableSubRegLiveness() const { + return UseSubRegLiveness; +} + bool SystemZSubtarget::isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const { // PC32DBL accesses require the low bit to be clear. Note that a zero diff --git a/llvm/lib/Target/SystemZ/SystemZSubtarget.h b/llvm/lib/Target/SystemZ/SystemZSubtarget.h index 8285b4277d11..cb6b21a1d465 100644 --- a/llvm/lib/Target/SystemZ/SystemZSubtarget.h +++ b/llvm/lib/Target/SystemZ/SystemZSubtarget.h @@ -102,6 +102,9 @@ public: // Always enable the early if-conversion pass. bool enableEarlyIfConversion() const override { return true; } + // Enable tracking of subregister liveness in register allocator. + bool enableSubRegLiveness() const override; + // Automatically generated by tblgen. void ParseSubtargetFeatures(StringRef CPU, StringRef FS);