[llvm] [GlobalISel] Add GIHasOneUse builtin for combiner match patterns (PR #221804)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 05:18:23 PDT 2026


================
@@ -2234,6 +2229,9 @@ bool CombineRuleBuilder::emitCodeGenInstructionMatchPattern(
   IM.addPredicate<InstructionOpcodeMatcher>(&P.getInst());
   declareInstExpansion(CE, IM, P.getName());
 
+  if (P.hasOneUse())
+    IM.addPredicate<OneUsePredicateMatcher>();
----------------
arsenm wrote:

Why did OneUsePredicateMatcher already exist?

https://github.com/llvm/llvm-project/pull/221804


More information about the llvm-commits mailing list