[llvm] [TableGen][GISel] Create untyped registers during instruction selection (PR #121270)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 03:33:19 PST 2025
================
@@ -1485,15 +1485,28 @@ bool GIMatchTableExecutor::executeMatchTable(
propagateFlags();
return true;
}
- case GIR_MakeTempReg: {
+ case GIR_MakeGenericTempReg: {
uint64_t TempRegID = readULEB();
int TypeID = readS8();
State.TempRegisters[TempRegID] =
MRI.createGenericVirtualRegister(getTypeFromIdx(TypeID));
- DEBUG_WITH_TYPE(TgtExecutor::getName(),
- dbgs() << CurrentIdx << ": TempRegs[" << TempRegID
- << "] = GIR_MakeTempReg(" << TypeID << ")\n");
+ DEBUG_WITH_TYPE(TgtExecutor::getName(), {
+ dbgs() << CurrentIdx << ": TempRegs[" << TempRegID
+ << "] = GIR_MakeGenericTempReg(" << TypeID << ")\n";
+ });
+ break;
+ }
+ case GIR_MakeVirtualTempReg: {
+ uint64_t TempRegID = readULEB();
+
+ Register Reg = MRI.createIncompleteVirtualRegister();
----------------
s-barannikov wrote:
The class is set by `constrainOperandRegClass()` called when executing a subsequent `GIR_ConstrainOperandRC` or `GIR_[Root]ConstrainSelectedInstOperands` action. This function doesn't seem to query a virtual register's type, but it calls a few TII / TRI hooks (e.g. `TRI.getConstrainedRegClassForOperand()`) that might in theory do that.
https://github.com/llvm/llvm-project/pull/121270
More information about the llvm-commits
mailing list