Skip to content

Commit 83e37fd

Browse files
committed
fmt
1 parent 6144bd4 commit 83e37fd

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -3790,33 +3790,33 @@ struct BroadcastToReshape final
37903790
else {
37913791
rewriter.replaceOpWithNewOp<stablehlo::ReshapeOp>(op, op.getType(),
37923792
op.getOperand());
3793-
auto NT = op.getType();
3794-
stablehlo::ReshapeOp reshaped = nullptr;
3795-
for (auto u : op.getOperand().getUsers()) {
3796-
auto re = dyn_cast<stablehlo::ReshapeOp>(u);
3797-
if (!re)
3798-
continue;
3799-
if (re.getType() != NT)
3800-
continue;
3801-
reshaped = re;
3802-
break;
3803-
}
3804-
if (!reshaped) {
3805-
rewriter.replaceOpWithNewOp<stablehlo::ReshapeOp>(op, op.getType(),
3806-
op.getOperand());
3807-
} else {
3808-
if (reshaped->getBlock() == op->getBlock()) {
3809-
if (op->isBeforeInBlock(reshaped)) {
3810-
rewriter.modifyOpInPlace(reshaped,
3811-
[&]() { reshaped->moveBefore(op); });
3812-
}
3813-
rewriter.replaceOp(op, reshaped);
3814-
} else {
3793+
auto NT = op.getType();
3794+
stablehlo::ReshapeOp reshaped = nullptr;
3795+
for (auto u : op.getOperand().getUsers()) {
3796+
auto re = dyn_cast<stablehlo::ReshapeOp>(u);
3797+
if (!re)
3798+
continue;
3799+
if (re.getType() != NT)
3800+
continue;
3801+
reshaped = re;
3802+
break;
3803+
}
3804+
if (!reshaped) {
38153805
rewriter.replaceOpWithNewOp<stablehlo::ReshapeOp>(op, op.getType(),
38163806
op.getOperand());
3807+
} else {
3808+
if (reshaped->getBlock() == op->getBlock()) {
3809+
if (op->isBeforeInBlock(reshaped)) {
3810+
rewriter.modifyOpInPlace(reshaped,
3811+
[&]() { reshaped->moveBefore(op); });
3812+
}
3813+
rewriter.replaceOp(op, reshaped);
3814+
} else {
3815+
rewriter.replaceOpWithNewOp<stablehlo::ReshapeOp>(op, op.getType(),
3816+
op.getOperand());
3817+
}
38173818
}
38183819
}
3819-
}
38203820
return success();
38213821
}
38223822
};

0 commit comments

Comments
 (0)