[llvm] [TableGen][GISel] Reuse `importNodeRenderer` for `OperandWithDefaultOps` (PR #121285)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 29 06:12:43 PST 2024
================
@@ -1300,11 +1299,24 @@ Error GlobalISelEmitter::importLeafNodeRenderer(
if (const auto *DI = dyn_cast<DefInit>(N.getLeafValue())) {
const Record *R = DI->getDef();
- if (R->isSubClassOf("Register")) {
+ if (R->isSubClassOf("Register") || R->getName() == "zero_reg") {
MIBuilder.addRenderer<AddRegisterRenderer>(Target, R);
return Error::success();
}
+ if (R->getName() == "undef_tied_input") {
+ std::optional<LLTCodeGen> OpTyOrNone = MVTToLLT(N.getSimpleType(0));
+ unsigned TempRegID = M.allocateTempRegID();
+ M.insertAction<MakeTempRegisterAction>(InsertPt, *OpTyOrNone, TempRegID);
----------------
arsenm wrote:
Unchecked optional us?
https://github.com/llvm/llvm-project/pull/121285
More information about the llvm-commits
mailing list