hanchenye-llvm-project/llvm
Robert Lougher d469133f95 [Evaluator] Walk initial elements when handling load through bitcast
When evaluating a store through a bitcast, the evaluator tries to move the
bitcast from the pointer onto the stored value. If the cast is invalid, it
tries to "introspect" the type to get a valid cast by obtaining a pointer to
the initial element (if the type is nested, this may require walking several
initial elements).

In some situations it is possible to get a bitcast on a load (e.g. with
unions, where the bitcast may not be the same type as the store). However,
equivalent logic to the store to introspect the type is missing. This patch
add this logic.

Note, when developing the patch I was unhappy with adding similar logic
directly to the load case as it could get out of step. Instead, I have
abstracted the "introspection" into a helper function, with the specifics
being handled by a passed-in lambda function.

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

llvm-svn: 359205
2019-04-25 17:00:01 +00:00
..
benchmarks
bindings [OCaml] Update api to account for FNeg and CallBr instructions 2019-04-16 15:00:19 +00:00
cmake [CMake] Use add_dependencies in add_llvm_install_targets 2019-04-23 21:59:07 +00:00
docs [Remarks] Fix documentation indentation 2019-04-24 00:27:59 +00:00
examples [JITLink] Update BuildingAJIT tutorials to account for API changes in r358818. 2019-04-20 17:35:28 +00:00
include [GlobalISel] Add a G_FNEARBYINT opcode 2019-04-25 16:36:03 +00:00
lib [Evaluator] Walk initial elements when handling load through bitcast 2019-04-25 17:00:01 +00:00
projects
resources
runtimes [CMake] Replace the sanitizer support in runtimes build with multilib 2019-04-22 23:31:39 +00:00
test [Evaluator] Walk initial elements when handling load through bitcast 2019-04-25 17:00:01 +00:00
tools [yaml2obj] - Don't crash on invalid inputs. 2019-04-25 09:59:55 +00:00
unittests [Support] Add JSON streaming output API, faster where the heavy value types aren't needed. 2019-04-25 12:51:42 +00:00
utils gn build: Document llvm_enable_dia_sdk variable better 2019-04-25 14:56:56 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt 2019-04-23 02:37:48 +00:00
LICENSE.TXT
LLVMBuild.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.