Skip to content

[PCF] Fix bufferization bugs for generic and loop ops#23446

Merged
qedawkins merged 2 commits intoiree-org:mainfrom
qedawkins:pcf-bufferize-fixes
Feb 18, 2026
Merged

[PCF] Fix bufferization bugs for generic and loop ops#23446
qedawkins merged 2 commits intoiree-org:mainfrom
qedawkins:pcf-bufferize-fixes

Conversation

@qedawkins
Copy link
Contributor

Three independent bug fixes:

  1. Preserve num_leading_args when bufferizing pcf.generic. The builder defaults to 0, but the execute region's block arguments include leading args from the initialize region.

  2. Fix pcf.read_slice bufferization to use the result tensor shape (the slice sizes) instead of the full source sref shape when computing the memref type. This fixes memref.copy shape mismatches.

  3. Use init buffers directly for tied results in pcf.generic and pcf.loop bufferization. This lets the bufferization framework know the result aliases the init, eliminating extraneous memref.copy operations.

Three independent bug fixes:

1. Preserve num_leading_args when bufferizing pcf.generic. The builder
   defaults to 0, but the execute region's block arguments include
   leading args from the initialize region.

2. Fix pcf.read_slice bufferization to use the result tensor shape (the
   slice sizes) instead of the full source sref shape when computing the
   memref type. This fixes memref.copy shape mismatches.

3. Use init buffers directly for tied results in pcf.generic and
   pcf.loop bufferization. This lets the bufferization framework know
   the result aliases the init, eliminating extraneous memref.copy
   operations.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@qedawkins qedawkins enabled auto-merge (squash) February 18, 2026 19:37
@qedawkins qedawkins merged commit 07a95c3 into iree-org:main Feb 18, 2026
55 of 56 checks passed
@qedawkins qedawkins deleted the pcf-bufferize-fixes branch February 19, 2026 14:30
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.

2 participants