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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 04:08:44 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: Ömer Sinan Ağacan (osa1)

<details>
<summary>Changes</summary>

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

Passing the proper value in GlobalISel also doesn't seem to break
anything.

---
Full diff: https://github.com/llvm/llvm-project/pull/206025.diff


1 Files Affected:

- (modified) llvm/lib/CodeGen/GlobalISel/Utils.cpp (+1-4) 


``````````diff
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);
   }

``````````

</details>


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


More information about the llvm-commits mailing list