Skip to content

Commit

Permalink
Microoptimize dominance a bit - NFC.
Browse files Browse the repository at this point in the history
Don't get RegionKindInterface if we won't use it. Noticed by inspection.
  • Loading branch information
lattner committed May 1, 2021
1 parent 2b93c9c commit a4c8952
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mlir/lib/IR/Dominance.cpp
Expand Up @@ -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);
}

//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit a4c8952

Please sign in to comment.