[all-commits] [llvm/llvm-project] e2fc6a: [MemCpyOpt] Preserve MemorySSA.

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Sep 4 01:06:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e2fc6a31d347dc96c2dec6acb72045150f525630
      https://github.com/llvm/llvm-project/commit/e2fc6a31d347dc96c2dec6acb72045150f525630
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-09-04 (Fri, 04 Sep 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    A llvm/test/Transforms/MemCpyOpt/preserve-memssa.ll

  Log Message:
  -----------
  [MemCpyOpt] Preserve MemorySSA.

This patch updates MemCpyOpt to preserve MemorySSA. It uses the
MemoryDef at the insertion point of the builder and inserts the new def
after that def.

In some cases, we just modify a memory instruction. In that case, get
the defining access, then remove the memory access and add a new one.
If the defining access is in a different block, insert a new def at the
beginning of the current block, otherwise after the defining access.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D86651




More information about the All-commits mailing list