llvm-project/llvm
Mehdi Amini 8484f92f7f [Scalarizer] PR28108: Skip over nullptr rather than crashing on it.
Summary:
In Scalarizer::gather we see if we already have a scattered form of Op,
and in that case use the new form.

In the particular case of PR28108, the found ValueVector SV has size 2,
where the first Value is nullptr, and the second is indeed a proper Value.
The nullptr then caused an assert to blow when we tried to do
cast<Instruction>(SV[I]).

With this patch we check SV[I] before doing the cast, and if it's nullptr
we just skip over it.

I don't know the Scalarizer well enough to know if this is the best fix
or if something should be done else where to prevent the nullptr from
being in the ValueVector at all, but at least this avoids the crash
and looking at the test case output it looks reasonable.

Reviewers: hfinkel, frasercrmck, wala, mehdi_amini

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D21518

llvm-svn: 275359
2016-07-14 01:31:25 +00:00
..
bindings [OCaml] Add functions for accessing metadata nodes. 2016-06-22 03:30:24 +00:00
cmake [cmake] Create the LLVM_BUILD_UTILS option. 2016-07-10 02:43:47 +00:00
docs Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind. 2016-07-14 00:41:18 +00:00
examples New Kaleidoscope chapter: Creating object files 2016-07-02 17:01:59 +00:00
include Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind. 2016-07-14 00:41:18 +00:00
lib [Scalarizer] PR28108: Skip over nullptr rather than crashing on it. 2016-07-14 01:31:25 +00:00
projects
resources
runtimes [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
test [Scalarizer] PR28108: Skip over nullptr rather than crashing on it. 2016-07-14 01:31:25 +00:00
tools [Object] Revert r275316, Archive::child_iterator changes, while I update lld. 2016-07-14 00:37:04 +00:00
unittests Fix header comment in unittests/CodeGen/DIEHashTest.cpp. 2016-07-13 18:38:20 +00:00
utils vim: separate the keywords into one per line 2016-07-13 03:47:58 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
CMakeLists.txt [cmake] Create the LLVM_BUILD_UTILS option. 2016-07-10 02:43:47 +00:00
CODE_OWNERS.TXT Transfer ownership of the gold plugin. 2016-07-05 20:49:50 +00:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

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.