diff options
author | Nikita Popov <npopov@redhat.com> | 2022-04-20 11:14:20 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-09-15 09:10:15 +0200 |
commit | 07460b66666403fc86e01d3fed6b77c1baf94cb1 (patch) | |
tree | bfb9a7732c24595008535ed2019b3a3aeac8d3ab /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | 5d3489e940d47fcf2108c518b630670c3183e1c1 (diff) | |
download | llvm-07460b66666403fc86e01d3fed6b77c1baf94cb1.zip llvm-07460b66666403fc86e01d3fed6b77c1baf94cb1.tar.gz llvm-07460b66666403fc86e01d3fed6b77c1baf94cb1.tar.bz2 |
[MemCpyOpt] Avoid infinite loop in processMemSetMemCpyDependence (PR54983)
This adds an additional transform to drop zero-size memcpys, also in
the case where the size is only zero after instruction simplification.
The motivation is the case from PR54983 where the size is non-trivially
zero, and processMemSetMemCpyDependence() keeps trying to reduce the
memset size by zero bytes.
This fix it's not really principled. It only works on the premise that
if InstSimplify doesn't realize the size is zero, then AA also won't.
The principled approach would be to instead add a isKnownNonZero()
guard to the processMemSetMemCpyDependence() transform, but I
suspect that would render that optimization mostly useless (at least
it breaks all the existing test coverage -- worth noting that the
constant size case is also handled by DSE, so I think this transform
is primarily about the dynamic size case).
Fixes https://github.com/llvm/llvm-project/issues/54983.
Fixes https://github.com/llvm/llvm-project/issues/64886.
Differential Revision: https://reviews.llvm.org/D124078
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions