From: Nicolai Hähnle Date: Mon, 18 May 2020 14:28:34 +0000 (+0200) Subject: MachineSSAUpdater: Allow initialization with just a register class X-Git-Tag: llvmorg-13-init~14037 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b37db11d95d87aa53426ce753410677407974a85;p=platform%2Fupstream%2Fllvm.git MachineSSAUpdater: Allow initialization with just a register class The register class is required for inserting PHIs, but the "current virtual register" isn't actually used for anything, so let's remove it while we're at it. Differential Revision: https://reviews.llvm.org/D85602 Change-Id: I1e647f31570ef21a7ea8e20db3454178e98a6a8b --- diff --git a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h index df972e1..0af356e 100644 --- a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h +++ b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h @@ -40,9 +40,6 @@ private: //typedef DenseMap AvailableValsTy; void *AV = nullptr; - /// VR - Current virtual register whose uses are being updated. - Register VR; - /// VRC - Register class of the current virtual register. const TargetRegisterClass *VRC; @@ -65,6 +62,7 @@ public: /// Initialize - Reset this object to get ready for a new set of SSA /// updates. void Initialize(Register V); + void Initialize(const TargetRegisterClass *RC); /// AddAvailableValue - Indicate that a rewritten value is available at the /// end of the specified block with the specified value. diff --git a/llvm/lib/CodeGen/MachineSSAUpdater.cpp b/llvm/lib/CodeGen/MachineSSAUpdater.cpp index b12557d..462082d 100644 --- a/llvm/lib/CodeGen/MachineSSAUpdater.cpp +++ b/llvm/lib/CodeGen/MachineSSAUpdater.cpp @@ -50,15 +50,18 @@ MachineSSAUpdater::~MachineSSAUpdater() { } /// Initialize - Reset this object to get ready for a new set of SSA -/// updates. ProtoValue is the value used to name PHI nodes. -void MachineSSAUpdater::Initialize(Register V) { +/// updates. +void MachineSSAUpdater::Initialize(const TargetRegisterClass *RC) { if (!AV) AV = new AvailableValsTy(); else getAvailableVals(AV).clear(); - VR = V; - VRC = MRI->getRegClass(VR); + VRC = RC; +} + +void MachineSSAUpdater::Initialize(Register V) { + Initialize(MRI->getRegClass(V)); } /// HasValueForBlock - Return true if the MachineSSAUpdater already has a value for