OSDN Git Service

Remove redundant *_or_null checks; NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 12 Jul 2018 21:56:31 +0000 (21:56 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 12 Jul 2018 21:56:31 +0000 (21:56 +0000)
For the first one, we dereference `NewDef` right before the `if` anyway.
For the second, we shouldn't have NULL users().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336952 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemorySSAUpdater.cpp

index 5418477..581fdf5 100644 (file)
@@ -331,7 +331,7 @@ void MemorySSAUpdater::fixupDefs(const SmallVectorImpl<MemoryAccess *> &Vars) {
     auto DefIter = NewDef->getDefsIterator();
 
     // 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);
 
     // 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) {
   // Mark MemoryPhi users of What not to be optimized.
   for (auto *U : What->users())
-    if (MemoryPhi *PhiUser = dyn_cast_or_null<MemoryPhi>(U))
+    if (MemoryPhi *PhiUser = dyn_cast<MemoryPhi>(U))
       NonOptPhis.insert(PhiUser);
 
   // Replace all our users with our defining access.