[Mlir-commits] [mlir] a4c8952 - Microoptimize dominance a bit - NFC.

Chris Lattner llvmlistbot at llvm.org
Sat May 1 12:48:51 PDT 2021


Author: Chris Lattner
Date: 2021-05-01T12:40:13-07:00
New Revision: a4c8952e6d4c67cca8387e6951e41c1bd4d5960e

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

LOG: Microoptimize dominance a bit - NFC.

Don't get RegionKindInterface if we won't use it. Noticed by inspection.

Added: 
    

Modified: 
    mlir/lib/IR/Dominance.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/Dominance.cpp b/mlir/lib/IR/Dominance.cpp
index 6bc2d5aceaf6..16c98d6bc679 100644
--- a/mlir/lib/IR/Dominance.cpp
+++ b/mlir/lib/IR/Dominance.cpp
@@ -27,9 +27,10 @@ template class llvm::DomTreeNodeBase<Block>;
 /// Return true if the region with the given index inside the operation
 /// has SSA dominance.
 static bool hasSSADominance(Operation *op, unsigned index) {
+  if (!op->isRegistered()) return false;
+
   auto kindInterface = dyn_cast<RegionKindInterface>(op);
-  return op->isRegistered() &&
-         (!kindInterface || kindInterface.hasSSADominance(index));
+  return !kindInterface || kindInterface.hasSSADominance(index);
 }
 
 //===----------------------------------------------------------------------===//


        


More information about the Mlir-commits mailing list