[llvm] [SystemZ] Improve handling of memmoves. (PR #196285)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 26 03:21:04 PDT 2026


================
@@ -1470,6 +1470,14 @@ bool SystemZTargetLowering::findOptimalMemOpLowering(
   assert(Limit != ~0U &&
          "Expected EmitTargetCodeForMemXXX() to handle AlwaysInline cases.");
 
+  if (Op.isMemmove()) {
+    if (Op.size() >= 16 &&
+        (!Op.isAligned(Align(8)) || (Op.size() >= 25 && Op.size() <= 31)))
+      return false;
+    return TargetLowering::findOptimalMemOpLowering(
+        Context, MemOps, Limit, Op, DstAS, SrcAS, FuncAttributes, LargestVT);
+  }
----------------
JonPsson1 wrote:

yes, that is better and works now that isMemcpy() does not return true for a memmove.


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


More information about the llvm-commits mailing list