[PATCH] D43425: [DSE] Don't DSE stores that subsequent memmove calls read from

Richard Smith - zygoloid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 18:40:07 PST 2018


rsmith added inline comments.


================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:513-514
 ///
 ///   memcpy(A <- B)
 ///   memcpy(A <- A)
 ///
----------------
Change these to `memmove` so the second line isn't UB.


================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:524
                                const MemoryLocation &InstStoreLoc,
                                Instruction *DepWrite,
                                const TargetLibraryInfo &TLI,
----------------
Remove unused parameter `DepWrite`?


================
Comment at: test/Transforms/DeadStoreElimination/simple.ll:261
+; locations without invoking undefined behavior.
+
 ; CHECK-LABEL: @test18(
----------------
efriedma wrote:
> See https://bugs.llvm.org/show_bug.cgi?id=11763 .
Gross. Until we figure out what we're going to do about that, perhaps we should just treat `memcpy` the same as `memmove` here.


Repository:
  rL LLVM

https://reviews.llvm.org/D43425





More information about the llvm-commits mailing list