[SLP] - Add couple safety checks to TreeEntry::dump(). NFC

Summary: Check for MainOp and AltOp for NULL before dereferencing or issue NULL.

Reviewers: Vasilis, dtemirbulatov, RKSimon, ABataev

Reviewed By: ABataev

Subscribers: mehdi_amini, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69812
This commit is contained in:
Sergey Dmitriev 2019-11-05 08:58:18 -08:00
parent 312932a334
commit 82588e05cc
1 changed files with 12 additions and 5 deletions

View File

@ -1355,14 +1355,21 @@ private:
for (Value *V : Scalars)
dbgs().indent(2) << *V << "\n";
dbgs() << "NeedToGather: " << NeedToGather << "\n";
dbgs() << "MainOp: " << *MainOp << "\n";
dbgs() << "AltOp: " << *AltOp << "\n";
dbgs() << "MainOp: ";
if (MainOp)
dbgs() << *MainOp << "\n";
else
dbgs() << "NULL\n";
dbgs() << "AltOp: ";
if (AltOp)
dbgs() << *AltOp << "\n";
else
dbgs() << "NULL\n";
dbgs() << "VectorizedValue: ";
if (VectorizedValue)
dbgs() << *VectorizedValue;
dbgs() << *VectorizedValue << "\n";
else
dbgs() << "NULL";
dbgs() << "\n";
dbgs() << "NULL\n";
dbgs() << "ReuseShuffleIndices: ";
if (ReuseShuffleIndices.empty())
dbgs() << "Emtpy";