[llvm] [SelectionDAG] Update MemOp to distinguish memmove from memcpy (PR #206005)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 06:52:16 PDT 2026


=?utf-8?q?Ömer_Sinan_Ağacan?= <omeragacan at gmail.com>,
=?utf-8?q?Ömer_Sinan_Ağacan?= <omeragacan at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/206005 at github.com>


================
@@ -118,21 +118,27 @@ enum Preference : uint8_t {
 // MemOp models a memory operation, either memset or memcpy/memmove.
 struct MemOp {
 private:
+  enum class MemOpKind {
+    Memset,
+    MemsetWithZero, // memset the memory with zeros
+    Memcpy, // copy memory from source to destination, source and destination do
+            // not overlap
+    MemcpyStrSrc, // memcpy source is an in-register constant, so it does not
+                  // need to be loaded
+    Memmove,      // memmove: like memcpy for source and destination regions may
+                  // overlap
+  };
----------------
JonPsson1 wrote:

either "like memcopy but...", or "like memcpy, source and destination..."

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


More information about the llvm-commits mailing list