forked from OSchip/llvm-project
Remove redundant *_or_null checks; NFC
For the first one, we dereference `NewDef` right before the `if` anyway. For the second, we shouldn't have NULL users(). llvm-svn: 336952
This commit is contained in:
parent
3b837b6b63
commit
e7cdb7edf7
|
@ -331,7 +331,7 @@ void MemorySSAUpdater::fixupDefs(const SmallVectorImpl<MemoryAccess *> &Vars) {
|
||||||
auto DefIter = NewDef->getDefsIterator();
|
auto DefIter = NewDef->getDefsIterator();
|
||||||
|
|
||||||
// The temporary Phi is being fixed, unmark it for not to optimize.
|
// The temporary Phi is being fixed, unmark it for not to optimize.
|
||||||
if (MemoryPhi *Phi = dyn_cast_or_null<MemoryPhi>(NewDef))
|
if (MemoryPhi *Phi = dyn_cast<MemoryPhi>(NewDef))
|
||||||
NonOptPhis.erase(Phi);
|
NonOptPhis.erase(Phi);
|
||||||
|
|
||||||
// If there is a local def after us, we only have to rename that.
|
// If there is a local def after us, we only have to rename that.
|
||||||
|
@ -395,7 +395,7 @@ void MemorySSAUpdater::moveTo(MemoryUseOrDef *What, BasicBlock *BB,
|
||||||
WhereType Where) {
|
WhereType Where) {
|
||||||
// Mark MemoryPhi users of What not to be optimized.
|
// Mark MemoryPhi users of What not to be optimized.
|
||||||
for (auto *U : What->users())
|
for (auto *U : What->users())
|
||||||
if (MemoryPhi *PhiUser = dyn_cast_or_null<MemoryPhi>(U))
|
if (MemoryPhi *PhiUser = dyn_cast<MemoryPhi>(U))
|
||||||
NonOptPhis.insert(PhiUser);
|
NonOptPhis.insert(PhiUser);
|
||||||
|
|
||||||
// Replace all our users with our defining access.
|
// Replace all our users with our defining access.
|
||||||
|
|
Loading…
Reference in New Issue