[llvm] [GlobalISel][TableGen] Adds GIReplaceRegWithUndef MIR builtin pattern. (PR #219410)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 01:30:26 PDT 2026


================
@@ -516,7 +530,7 @@ def unary_undef_to_undef_frags : GICombinePatFrag<
 def unary_undef_to_undef : GICombineRule<
   (defs root:$dst),
   (match (unary_undef_to_undef_frags $dst)),
-  (apply [{ Helper.replaceInstWithUndef(*${dst}.getParent()); }])>;
+  (apply (GIReplaceRegWithUndef $dst))>;
----------------
Pierre-vh wrote:

I just thought about this, but what is the difference with simply doing `(apply (G_IMPLICIT_DEF $dst))` ?
Does it produce the same code or does `replaceRegWithUndef` do more?

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


More information about the llvm-commits mailing list