[llvm] [GlobalISel] Remove an old FIXME, pass proper IsVolatile flag to MemOp::Copy (PR #206025)

Ömer Sinan Ağacan via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 03:22:28 PDT 2026


https://github.com/osa1 created https://github.com/llvm/llvm-project/pull/206025

SelectionDAG no longer passes `true` for `IsVolatile`, it always carries the
flag from the memmove/memcpy intrinsic. (in `getMemmoveLoadsAndStores` and
`getMemcpyLoadsAndStores`)

>From 26624a566b463ce116b22a080dbbd7698e76e4d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= <omeragacan at gmail.com>
Date: Fri, 26 Jun 2026 11:15:02 +0100
Subject: [PATCH] [GlobalISel] Remove an old FIXME, pass proper IsVolatile flag
 to MemOp::Copy

The commend was outdated in a few ways:

- The falg is no longer called, it's now `IsVolatile`.

- SelectionDAG no longer passes `true` for `IsVolatile`, it always
  carries the flag from the memmove/memcpy intrinsic. (in
  `getMemmoveLoadsAndStores` and `getMemcpyLoadsAndStores`)
---
 llvm/lib/CodeGen/GlobalISel/Utils.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/Utils.cpp b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
index fbb54d8971502..d1e80d547abe8 100644
--- a/llvm/lib/CodeGen/GlobalISel/Utils.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
@@ -2235,13 +2235,10 @@ bool llvm::canLowerMemCpyFamily(const MachineInstr &MI,
     const auto &SrcMMO = **std::next(MI.memoperands_begin());
     MachinePointerInfo SrcPtrInfo = SrcMMO.getPointerInfo();
     unsigned Limit = TLI.getMaxStoresPerMemmove(OptSize);
-    // FIXME: SelectionDAG always passes false for 'AllowOverlap', apparently
-    // due to a bug in it's findOptimalMemOpLowering implementation. For now do
-    // the same thing here.
     return findGISelOptimalMemOpLowering(
         MemOps, Limit,
         MemOp::Copy(KnownLen, DstAlignCanChange, std::min(DstAlign, SrcAlign),
-                    SrcAlign, /*IsVolatile=*/true),
+                    SrcAlign, IsVolatile),
         DstPtrInfo.getAddrSpace(), SrcPtrInfo.getAddrSpace(),
         MF.getFunction().getAttributes(), TLI);
   }



More information about the llvm-commits mailing list