File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
mlir/include/mlir/Dialect/Mesh/Transforms Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,11 @@ void populateAllReduceEndomorphismSimplificationPatterns(
6262 auto isEndomorphismOp = [reduction](Operation *op,
6363 std::optional<Operation *> referenceOp) {
6464 auto allReduceOp = llvm::dyn_cast<AllReduceOp>(op);
65+ if (!allReduceOp)
66+ return false ;
6567 auto inType = cast<ShapedType>(allReduceOp.getInput ().getType ());
6668 auto outType = cast<ShapedType>(allReduceOp.getResult ().getType ());
67- if (!allReduceOp || inType.getElementType () != outType.getElementType () ||
69+ if (inType.getElementType () != outType.getElementType () ||
6870 allReduceOp.getReduction () != reduction) {
6971 return false ;
7072 }
@@ -87,9 +89,7 @@ void populateAllReduceEndomorphismSimplificationPatterns(
8789 return refAllReduceOp->getAttrs () == allReduceOp->getAttrs () &&
8890 inType.getElementType () == refType.getElementType ();
8991 };
90- auto isAlgebraicOp = [](Operation *op) {
91- return static_cast <bool >(llvm::dyn_cast<AlgebraicOp>(op));
92- };
92+ auto isAlgebraicOp = [](Operation *op) { return isa<AlgebraicOp>(op); };
9393
9494 using ConcreteEndomorphismSimplification = EndomorphismSimplification<
9595 std::decay_t <decltype (getEndomorphismOpOperand)>,
You can’t perform that action at this time.
0 commit comments