Skip to content

Commit b37db11

Browse files
committed
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
1 parent 65fcc0e commit b37db11

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/include/llvm/CodeGen/MachineSSAUpdater.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ class MachineSSAUpdater {
4040
//typedef DenseMap<MachineBasicBlock*, Register> AvailableValsTy;
4141
void *AV = nullptr;
4242

43-
/// VR - Current virtual register whose uses are being updated.
44-
Register VR;
45-
4643
/// VRC - Register class of the current virtual register.
4744
const TargetRegisterClass *VRC;
4845

@@ -65,6 +62,7 @@ class MachineSSAUpdater {
6562
/// Initialize - Reset this object to get ready for a new set of SSA
6663
/// updates.
6764
void Initialize(Register V);
65+
void Initialize(const TargetRegisterClass *RC);
6866

6967
/// AddAvailableValue - Indicate that a rewritten value is available at the
7068
/// end of the specified block with the specified value.

llvm/lib/CodeGen/MachineSSAUpdater.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,18 @@ MachineSSAUpdater::~MachineSSAUpdater() {
5050
}
5151

5252
/// Initialize - Reset this object to get ready for a new set of SSA
53-
/// updates. ProtoValue is the value used to name PHI nodes.
54-
void MachineSSAUpdater::Initialize(Register V) {
53+
/// updates.
54+
void MachineSSAUpdater::Initialize(const TargetRegisterClass *RC) {
5555
if (!AV)
5656
AV = new AvailableValsTy();
5757
else
5858
getAvailableVals(AV).clear();
5959

60-
VR = V;
61-
VRC = MRI->getRegClass(VR);
60+
VRC = RC;
61+
}
62+
63+
void MachineSSAUpdater::Initialize(Register V) {
64+
Initialize(MRI->getRegClass(V));
6265
}
6366

6467
/// HasValueForBlock - Return true if the MachineSSAUpdater already has a value for

0 commit comments

Comments
 (0)