[llvm-branch-commits] [llvm] 95ea865 - [PGO] Use isa instead of dyn_cast (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 30 17:50:39 PST 2020


Author: Kazu Hirata
Date: 2020-12-30T17:45:38-08:00
New Revision: 95ea86587c54240b3f1b7ed5a18d2f3660cb7573

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

LOG: [PGO] Use isa instead of dyn_cast (NFC)

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index 480de5483358..9efc7d1ac500 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -269,7 +269,7 @@ class PGOCounterPromoter {
     // FIXME: add other heuristics to detect long running loops.
     if (SkipRetExitBlock) {
       for (auto BB : ExitBlocks)
-        if (dyn_cast<ReturnInst>(BB->getTerminator()) != nullptr)
+        if (isa<ReturnInst>(BB->getTerminator()))
           return false;
     }
 

diff  --git a/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp b/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
index 7acbdb9f55b7..55a93b6152dc 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
@@ -254,7 +254,7 @@ class MemOPSizeOpt : public InstVisitor<MemOPSizeOpt> {
     LibFunc Func;
     if (TLI.getLibFunc(CI, Func) &&
         (Func == LibFunc_memcmp || Func == LibFunc_bcmp) &&
-        !dyn_cast<ConstantInt>(CI.getArgOperand(2))) {
+        !isa<ConstantInt>(CI.getArgOperand(2))) {
       WorkList.push_back(MemOp(&CI));
     }
   }


        


More information about the llvm-branch-commits mailing list