Skip to content

Commit

Permalink
Don't fold constants in affine_apply.fold.
Browse files Browse the repository at this point in the history
This sometimes (rarely) fails with "folder reused existing op
for one result but constant materialization failed for another
result". Not sure why, but it's just a not very important
runtime optimization
anyway.

PiperOrigin-RevId: 636530184
  • Loading branch information
jreiffers authored and tensorflower-gardener committed May 23, 2024
1 parent 6f61468 commit fd87fab
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,6 @@ mlir::LogicalResult ApplyIndexingOp::fold(
results.push_back(getOperand(dim.getPosition()));
} else if (auto sym = mlir::dyn_cast<mlir::AffineSymbolExpr>(expr)) {
results.push_back(getOperand(map.getNumDims() + sym.getPosition()));
} else if (auto cst = mlir::dyn_cast<mlir::AffineConstantExpr>(expr)) {
results.push_back(OpBuilder(getContext()).getIndexAttr(cst.getValue()));
} else {
results.clear();
return failure();
Expand Down

0 comments on commit fd87fab

Please sign in to comment.