[all-commits] [llvm/llvm-project] 7662d1: [MemCpyOpt] Check all access for MemoryUses in wri...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Feb 21 08:55:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7662d1687b09505106718d412a40a0db8149e0bf
      https://github.com/llvm/llvm-project/commit/7662d1687b09505106718d412a40a0db8149e0bf
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    M llvm/test/Transforms/MemCpyOpt/memcpy-byval-forwarding-clobbers.ll

  Log Message:
  -----------
  [MemCpyOpt] Check all access for MemoryUses in writtenBetween.

Currently writtenBetween can miss clobbers of Loc between End and Start,
if End is a MemoryUse.

To guarantee we see all write clobbers of Loc between Start and End
for MemoryUses, restrict to Start and End being in the same block
and check all accesses between them.

This fixes 2 mis-compiles illustrated in
llvm/test/Transforms/MemCpyOpt/memcpy-byval-forwarding-clobbers.ll

Reviewed By: nikic

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




More information about the All-commits mailing list