Skip to content

Conversation

@jumerckx
Copy link
Collaborator

fixes #1238

Now includes a guard to only apply the rewrite if the SliceOp is the only user of the ExtendOp. (#1296)

@jumerckx jumerckx requested a review from wsmoses August 19, 2025 08:49
// Create the new slice on the original tensor.
auto newSlice = rewriter.create<stablehlo::SliceOp>(
op.getLoc(), operand, new_starts, new_limits, new_strides);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if new_lhs and new_rhs are 0 [even if multiple users], we can just use the sliced operand directly instead of the extend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slice of extend

3 participants