[llvm] [TableGen] HasOneUse builtin predicate on PatFrags (PR #91578)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu May 9 03:09:45 PDT 2024
================
@@ -468,7 +468,23 @@ bool GIMatchTableExecutor::executeMatchTable(
if (handleReject() == RejectAndGiveUp)
return false;
}
+ break;
+ }
+ case GIM_CheckHasOneUse: {
+ uint64_t InsnID = readULEB();
+ DEBUG_WITH_TYPE(TgtExecutor::getName(),
+ dbgs() << CurrentIdx << ": GIM_CheckHasOneUse(MIs["
+ << InsnID << "]\n");
+
+ const MachineInstr *MI = State.MIs[InsnID];
+ assert(MI && "Used insn before defined");
+ assert(MI->getNumDefs() > 0 && "No defs");
+ const Register Res = MI->getOperand(0).getReg();
----------------
arsenm wrote:
We might want an extended variant that can handle multiple defs at some point
https://github.com/llvm/llvm-project/pull/91578
More information about the llvm-commits
mailing list