1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Transforms
Mehdi Amini eabbdab4f5 [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
..
Hello Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
InstCombine Move a transform from InstCombine to InstSimplify. 2016-07-13 23:32:53 +00:00
Instrumentation Remove unused variable to fix bot failure from r275216 2016-07-12 21:29:05 +00:00
IPO Print remarks from WholeProgramDevirt pass for each call site. 2016-07-12 02:38:37 +00:00
ObjCARC Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
Scalar [Scalarizer] PR28108: Skip over nullptr rather than crashing on it. 2016-07-14 01:31:25 +00:00
Utils Reverting r275284 due to platform-specific test failures 2016-07-13 19:09:16 +00:00
Vectorize Extended LoadStoreVectorizer to vectorize subchains. 2016-07-13 21:20:01 +00:00
CMakeLists.txt
LLVMBuild.txt