[llvm] r336952 - Remove redundant *_or_null checks; NFC

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 14:56:31 PDT 2018


Author: gbiv
Date: Thu Jul 12 14:56:31 2018
New Revision: 336952

URL: http://llvm.org/viewvc/llvm-project?rev=336952&view=rev
Log:
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().

Modified:
    llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp

Modified: llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp?rev=336952&r1=336951&r2=336952&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp (original)
+++ llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp Thu Jul 12 14:56:31 2018
@@ -331,7 +331,7 @@ void MemorySSAUpdater::fixupDefs(const S
     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(MemoryUseO
                               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.




More information about the llvm-commits mailing list