1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[VPlanSLP] Don't dereference a cast_or_null<VPInstruction> result. NFCI.

The static analyzer is warning about a potential null dereference of the cast_or_null result, I've split the cast_or_null check from the ->getUnderlyingInstr() call to avoid this, but it appears that we weren't seeing any null pointers in the dumped bundles in the first place.

llvm-svn: 371975
This commit is contained in:
Simon Pilgrim 2019-09-16 11:22:44 +00:00
parent e13e496c29
commit 6ddc38e0ff

View File

@ -346,11 +346,14 @@ SmallVector<VPlanSlp::MultiNodeOpTy, 4> VPlanSlp::reorderMultiNodeOps() {
void VPlanSlp::dumpBundle(ArrayRef<VPValue *> Values) {
dbgs() << " Ops: ";
for (auto Op : Values)
if (auto *Instr = cast_or_null<VPInstruction>(Op)->getUnderlyingInstr())
dbgs() << *Instr << " | ";
else
dbgs() << " nullptr | ";
for (auto Op : Values) {
if (auto *VPInstr = cast_or_null<VPInstruction>(Op))
if (auto *Instr = VPInstr->getUnderlyingInstr()) {
dbgs() << *Instr << " | ";
continue;
}
dbgs() << " nullptr | ";
}
dbgs() << "\n";
}