[all-commits] [llvm/llvm-project] a10bf5: [MemCpyOpt] Add additional tests for memcpy of und...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat Mar 13 11:38:31 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a10bf5572d2ab11f5965e8a940343734b8802797
      https://github.com/llvm/llvm-project/commit/a10bf5572d2ab11f5965e8a940343734b8802797
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-03-13 (Sat, 13 Mar 2021)

  Changed paths:
    M llvm/test/Transforms/MemCpyOpt/memcpy-undef.ll

  Log Message:
  -----------
  [MemCpyOpt] Add additional tests for memcpy of undef (NFC)


  Commit: 55566609711f284581d822576705354444e6a7f0
      https://github.com/llvm/llvm-project/commit/55566609711f284581d822576705354444e6a7f0
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-03-13 (Sat, 13 Mar 2021)

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

  Log Message:
  -----------
  [MemCpyOpt] Handle read from lifetime.start with offset

This fixes a regression from the MemDep-based implementation:
MemDep completely ignores lifetime.start intrinsics that aren't
MustAlias -- this is probably unsound, but it does mean that the
MemDep based implementation successfully eliminated memcpy's from
lifetime.start if the memcpy happens at an offset, rather than
the base address of the alloca.

Add a special case for the case where the lifetime.start spans the
whole alloca (which is pretty much the only kind of lifetime.start
that frontends ever emit), as we don't need to figure out our exact
aliasing relationship in that case, the whole alloca is dead prior
to the call.

If this doesn't cover all practically relevant cases, then it
would be possible to make use of the recently added PartialAlias
clobber offsets to make this more precise.


Compare: https://github.com/llvm/llvm-project/compare/5b825433d785...55566609711f


More information about the All-commits mailing list