From 1a14ab01567f14d6b9053a2a540b00f8c63c41c0 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 12 Jul 2018 21:56:31 +0000 Subject: [PATCH] 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(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336952 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/MemorySSAUpdater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/MemorySSAUpdater.cpp b/lib/Analysis/MemorySSAUpdater.cpp index 54184775e97..581fdf50d8b 100644 --- a/lib/Analysis/MemorySSAUpdater.cpp +++ b/lib/Analysis/MemorySSAUpdater.cpp @@ -331,7 +331,7 @@ void MemorySSAUpdater::fixupDefs(const SmallVectorImpl &Vars) { auto DefIter = NewDef->getDefsIterator(); // The temporary Phi is being fixed, unmark it for not to optimize. - if (MemoryPhi *Phi = dyn_cast_or_null(NewDef)) + if (MemoryPhi *Phi = dyn_cast(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(U)) + if (MemoryPhi *PhiUser = dyn_cast(U)) NonOptPhis.insert(PhiUser); // Replace all our users with our defining access. -- 2.11.0