Skip to content

Commit 62bcbe6

Browse files
committed
[llvm-mca] Use MCRegister::id() to remove an implicit conversion. NFC
It might be worth plumbing MCRegister through this code, but it's very often used as a index and would require many more calls to id().
1 parent fffa68a commit 62bcbe6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/MCA/InstrBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ InstrBuilder::createInstruction(const MCInst &MCI,
735735
// Skip non-register operands.
736736
if (!Op.isReg())
737737
continue;
738-
RegID = Op.getReg();
738+
RegID = Op.getReg().id();
739739
} else {
740740
// Implicit read.
741741
RegID = RD.RegisterID;
@@ -800,8 +800,8 @@ InstrBuilder::createInstruction(const MCInst &MCI,
800800
unsigned WriteIndex = 0;
801801
Idx = 0U;
802802
for (const WriteDescriptor &WD : D.Writes) {
803-
RegID = WD.isImplicitWrite() ? MCRegister(WD.RegisterID)
804-
: MCI.getOperand(WD.OpIndex).getReg();
803+
RegID = WD.isImplicitWrite() ? WD.RegisterID
804+
: MCI.getOperand(WD.OpIndex).getReg().id();
805805
// Check if this is a optional definition that references NoReg or a write
806806
// to a constant register.
807807
if ((WD.IsOptionalDef && !RegID) || MRI.isConstant(RegID)) {

0 commit comments

Comments
 (0)