[llvm] [VPlan] Handle some VPInstructions in may{Read,Write}FromMemory (PR #120058)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 15:15:27 PST 2025


================
@@ -1351,6 +1351,27 @@ class VPInstruction : public VPRecipeWithIRFlags,
     }
   }
 
+  /// Returns true if the underlying opcode may read from or write to memory.
+  bool opcodeMayReadOrWriteFromMemory() const {
+    if (Instruction::isBinaryOp(getOpcode()))
----------------
lukel97 wrote:

I think I tried making it private/protected earlier, but then it means we can't access it from `VPRecipeBase::mayWriteToMemory`/`VPRecipeBase::mayReadToMemory`. Unless we override those instead in VPInstruction?

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


More information about the llvm-commits mailing list