diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2016-03-10 14:16:18 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2016-03-10 14:16:18 +0000 |
| commit | d94a5962cceb6d123ad64072310f5c2f3a2b14ff (patch) | |
| tree | 741924b298be371d84834f55fe9d1b0b7fe01bcb | |
| parent | cd9967d160bcc41789e902834e610cf242a28ae1 (diff) | |
| download | bcm5719-llvm-d94a5962cceb6d123ad64072310f5c2f3a2b14ff.tar.gz bcm5719-llvm-d94a5962cceb6d123ad64072310f5c2f3a2b14ff.zip | |
[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
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SROA.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index cee913d243e..a5c2f3067ed 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/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<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()) |

