llvm-project/llvm
Fraser Cormack 7fb66d4035 [MemCpyOpt] Fix a variety of scalable-type crashes
This patch fixes a variety of crashes resulting from the `MemCpyOptPass`
casting `TypeSize` to a constant integer, whether implicitly or
explicitly.

Since the `MemsetRanges` requires a constant size to work, all but one
of the fixes in this patch simply involve skipping the various
optimizations for scalable types as cleanly as possible.

The optimization of `byval` parameters, however, has been updated to
work on scalable types in theory. In practice, this optimization is only
valid when the length of the `memcpy` is known to be larger than the
scalable type size, which is currently never the case. This could
perhaps be done in the future using the `vscale_range` attribute.

Some implicit casts have been left as they were, under the knowledge
they are only called on aggregate types. These should never be
scalably-sized.

Reviewed By: nikic, tra

Differential Revision: https://reviews.llvm.org/D109329
2021-09-08 11:21:36 +01:00
..
benchmarks
bindings [NFC][C API] Make LLVMSetInstrParamAlignment's index param type LLVMAttributeIndex 2021-09-07 15:13:45 -07:00
cmake [CMake] Don't add -Wnon-virtual-dtor if affected by GCC PR102168 2021-09-07 23:36:47 -07:00
docs Mention OpenBSD in the documentation 2021-09-07 04:38:52 -04:00
examples [examples] Fix Kaleidoscope for Windows 2021-08-19 13:20:51 +10:00
include [MemCpyOpt] Fix a variety of scalable-type crashes 2021-09-08 11:21:36 +01:00
lib [MemCpyOpt] Fix a variety of scalable-type crashes 2021-09-08 11:21:36 +01:00
projects
resources
runtimes [libomptarget][amdcgn] Only add opt/llvm-link dependency if TARGET is available 2021-08-30 17:32:11 +02:00
test [MemCpyOpt] Fix a variety of scalable-type crashes 2021-09-08 11:21:36 +01:00
tools [UseListOrder] Fix use list order for function operands 2021-09-07 20:59:12 +02:00
unittests [Support] Automatically support `hash_value` when `HashBuilder` support is available. 2021-09-07 09:56:11 -07:00
utils Revert "[gn build] Add a file that should have been in cfe02847496b856aa" 2021-09-07 17:01:48 -04:00
.clang-format
.clang-tidy
.gitattributes Fix: [MCParser] Correctly handle CRLF line ends when consuming line comments 2021-08-17 16:16:19 +01:00
.gitignore
CMakeLists.txt [CMake] Add targets for generating coverage reports 2021-09-03 10:45:55 -05:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.