[PATCH] D150967: [MemCpyOpt] precommit test for memcpy removal for immutable arguments from attributes (NFC)

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 4 22:24:31 PDT 2023


khei4 added a comment.

I think if the dest is unescaped alloca, allocasize and memcpy length corresponding is unnecessary, because

- If alloca length < memcpy length, memcpy is UB so we could transform it anyway?
- If memcpy length < alloca length, if the alloca is unescaped transformation will widen the dereferenceability for param, but dereferenceable(bigger) subsumes dereferenceable(smaller) so, some UB will non-UB, but inverse doesn't happens. This will be valid?

example: https://llvm.godbolt.org/z/Pd383eo46

But I feel like it’s a little bit too detailed to consider before merging the general case ;)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150967/new/

https://reviews.llvm.org/D150967



More information about the llvm-commits mailing list