[llvm-branch-commits] [llvm] b557c32 - [MemorySSA, BPF] Use isa instead of dyn_cast (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 31 09:44:32 PST 2020


Author: Kazu Hirata
Date: 2020-12-31T09:39:13-08:00
New Revision: b557c32ae925e0aa39d40e0254380953aad1c78f

URL: https://github.com/llvm/llvm-project/commit/b557c32ae925e0aa39d40e0254380953aad1c78f
DIFF: https://github.com/llvm/llvm-project/commit/b557c32ae925e0aa39d40e0254380953aad1c78f.diff

LOG: [MemorySSA, BPF] Use isa instead of dyn_cast (NFC)

Added: 
    

Modified: 
    llvm/lib/Analysis/MemorySSA.cpp
    llvm/lib/Target/BPF/BPFAdjustOpt.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index c9ad9ffab16e..e728a5f998f4 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -1779,8 +1779,8 @@ MemoryUseOrDef *MemorySSA::createNewAccess(Instruction *I,
 
   bool Def, Use;
   if (Template) {
-    Def = dyn_cast_or_null<MemoryDef>(Template) != nullptr;
-    Use = dyn_cast_or_null<MemoryUse>(Template) != nullptr;
+    Def = isa<MemoryDef>(Template);
+    Use = isa<MemoryUse>(Template);
 #if !defined(NDEBUG)
     ModRefInfo ModRef = AAP->getModRefInfo(I, None);
     bool DefCheck, UseCheck;

diff  --git a/llvm/lib/Target/BPF/BPFAdjustOpt.cpp b/llvm/lib/Target/BPF/BPFAdjustOpt.cpp
index 6afd2d77485d..928b591b2274 100644
--- a/llvm/lib/Target/BPF/BPFAdjustOpt.cpp
+++ b/llvm/lib/Target/BPF/BPFAdjustOpt.cpp
@@ -221,7 +221,7 @@ bool BPFAdjustOptImpl::avoidSpeculation(Instruction &I) {
     }
   }
 
-  if (!dyn_cast<LoadInst>(&I) && !dyn_cast<CallInst>(&I))
+  if (!isa<LoadInst>(&I) && !isa<CallInst>(&I))
     return false;
 
   // For:


        


More information about the llvm-branch-commits mailing list