[llvm] [GVN] Teach GVN simple masked load/store forwarding (PR #157689)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 02:55:49 PDT 2025


================
@@ -2734,6 +2779,11 @@ bool GVNPass::processInstruction(Instruction *I) {
     return false;
   }
 
+  if (auto *II = dyn_cast<IntrinsicInst>(I))
+    if (II && II->getIntrinsicID() == Intrinsic::masked_load)
----------------
MDevereau wrote:

I'm not sure this is an improvement since m_Intrinsic cannot bind the intrinsic to a variable, and `I` would still need to be explicitly casted to an IntrinsicInst before passing it into processMaskedLoad.

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


More information about the llvm-commits mailing list