[all-commits] [llvm/llvm-project] 81febe: [MemCpyOpt] Add test for incorrect optimization ac...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Feb 5 20:41:37 PST 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 81febec8a327ecbe83575ac280c2931718ab5e33
      https://github.com/llvm/llvm-project/commit/81febec8a327ecbe83575ac280c2931718ab5e33
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-02-05 (Fri, 05 Feb 2021)

  Changed paths:
    M llvm/test/Transforms/MemCpyOpt/lifetime.ll

  Log Message:
  -----------
  [MemCpyOpt] Add test for incorrect optimization across lifetime (NFC)

This only affects the MemorySSA-based implementation.


  Commit: 12a772b1a09a1b5c3f43d08c2804973506b8a859
      https://github.com/llvm/llvm-project/commit/12a772b1a09a1b5c3f43d08c2804973506b8a859
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-02-05 (Fri, 05 Feb 2021)

  Changed paths:
    M llvm/lib/Analysis/MemorySSA.cpp
    M llvm/test/Analysis/MemorySSA/lifetime-simple.ll
    M llvm/test/Transforms/MemCpyOpt/lifetime.ll

  Log Message:
  -----------
  [MemorySSA] Don't treat lifetime.end as NoAlias

MemorySSA currently treats lifetime.end intrinsics as not aliasing
anything. This breaks MemorySSA-based MemCpyOpt, because we'll happily
move a read of a pointer below a lifetime.end intrinsic, as no clobber
is reported.

I think the MemorySSA modelling here isn't correct: lifetime.end(p)
has approximately the same effect as doing a memcpy(p, undef), and
should be treated as a clobber.

This patch removes the special handling of lifetime.end, leaving
alias analysis to handle it appropriately.

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


Compare: https://github.com/llvm/llvm-project/compare/4e7933905578...12a772b1a09a


More information about the All-commits mailing list