From 695222231c0c0da1174171f614063d18dfd0dff2 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 10 Mar 2016 14:16:18 +0000 Subject: [PATCH] [SROA] Clean up some really weird code, no functionality changed. We already have the instruction extracted into 'I', just cast that to a store the way we do for loads. Also, we don't enter the if unless SI is non-null, so don't test it again for null. I'm pretty sure the entire test there can be nuked, but this is just the trivial cleanup. llvm-svn: 263112 --- lib/Transforms/Scalar/SROA.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index cee913d243e..a5c2f3067ed 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -3403,9 +3403,9 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) { } Loads.push_back(LI); - } else if (auto *SI = dyn_cast(S.getUse()->getUser())) { - if (!SI || - S.getUse() != &SI->getOperandUse(SI->getPointerOperandIndex())) + } else if (auto *SI = dyn_cast(I)) { + if (S.getUse() != &SI->getOperandUse(SI->getPointerOperandIndex())) + // Skip stores *of* pointers. FIXME: This shouldn't even be possible! continue; auto *StoredLoad = dyn_cast(SI->getValueOperand()); if (!StoredLoad || !StoredLoad->isSimple())