1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[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
This commit is contained in:
Chandler Carruth 2016-03-10 14:16:18 +00:00
parent 2f71b82e0e
commit 695222231c

View File

@ -3403,9 +3403,9 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
}
Loads.push_back(LI);
} else if (auto *SI = dyn_cast<StoreInst>(S.getUse()->getUser())) {
if (!SI ||
S.getUse() != &SI->getOperandUse(SI->getPointerOperandIndex()))
} else if (auto *SI = dyn_cast<StoreInst>(I)) {
if (S.getUse() != &SI->getOperandUse(SI->getPointerOperandIndex()))
// Skip stores *of* pointers. FIXME: This shouldn't even be possible!
continue;
auto *StoredLoad = dyn_cast<LoadInst>(SI->getValueOperand());
if (!StoredLoad || !StoredLoad->isSimple())