Skip to content

Commit

Permalink
fix unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Mar 22, 2024
1 parent b4d0efc commit e9140cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3539,6 +3539,8 @@ stablehlo::Tensor evalSliceOp(const stablehlo::Tensor &operand,
Builder builder(operand.getType().getContext());
auto inferStatus = hlo::inferSliceOp({}, operand.getType(), start, limit,
strides, inferredTypes);
(void)inferStatus;
assert(!failed(inferStatus));

return stablehlo::evalSliceOp(operand, start, strides,
inferredTypes[0].cast<mlir::ShapedType>());
Expand Down Expand Up @@ -3624,7 +3626,6 @@ struct GatherSimplify final : OpRewritePattern<mlir::stablehlo::GatherOp> {
PatternRewriter &rewriter) const override {

auto operand = op.getOperand();
auto startIndiices = op.getStartIndices();
auto offsetDims = op.getDimensionNumbers().getOffsetDims();
auto collapsedSliceDims = op.getDimensionNumbers().getCollapsedSliceDims();
auto startIndexMap = op.getDimensionNumbers().getStartIndexMap();
Expand All @@ -3638,7 +3639,7 @@ struct GatherSimplify final : OpRewritePattern<mlir::stablehlo::GatherOp> {

{
DenseIntElementsAttr operandVals;
if (matchPattern(op.getOperand(), m_Constant(&operandVals))) {
if (matchPattern(operand, m_Constant(&operandVals))) {
auto out = myevalGatherOp(
stablehlo::evalConstantOp(operandVals),
stablehlo::evalConstantOp(startIndicesCst),
Expand Down

0 comments on commit e9140cc

Please sign in to comment.