iree icon indicating copy to clipboard operation
iree copied to clipboard

[Codegen] Add PCF Transforms

Open qedawkins opened this issue 4 weeks ago • 3 comments

This adds the transformation passes for the PCF dialect:

  • ConvertForallToLoopsPass: Entry point that converts scf.forall ops with workgroup mapping to pcf.loop
  • FuseConsumersPass: Fuses consumer operations into pcf.loop bodies
  • FusePCFWritesPass: Consolidates pcf.write_slice ops in loop bodies
  • LowerStructuralPCFPass: Lowers pcf.generic/loop to scf.execute_region/forall
  • ConvertSRefToMemRefPass: Converts pcf.sref types to concrete memref types
  • ResolveTokensPass: Resolves sync scope tokens on pcf.sref types

Also includes:

  • Transforms.h/cpp: Shared transformation utilities for PCF
  • ConversionDialectInterface.h: Interface for dialect-specific lowering

qedawkins avatar Dec 03 '25 02:12 qedawkins

This is ready for review, but is kind of large. If reviewers prefer I can split this further by pass (I was just being lazy about figuring out how to split the build deps and rebasing is a lot easier with one PR).

qedawkins avatar Dec 12 '25 17:12 qedawkins

This is ready for review, but is kind of large. If reviewers prefer I can split this further by pass (I was just being lazy about figuring out how to split the build deps and rebasing is a lot easier with one PR).

Yeah can you split it up into a few smaller PRs? It's much easier to care out time to review <1k or ideally <500 LOC...

kuhar avatar Dec 12 '25 19:12 kuhar

This is ready for review, but is kind of large. If reviewers prefer I can split this further by pass (I was just being lazy about figuring out how to split the build deps and rebasing is a lot easier with one PR).

Yeah can you split it up into a few smaller PRs? It's much easier to care out time to review <1k or ideally <500 LOC...

Sure! I can do it pass by pass then, no need to review right now in that case.

qedawkins avatar Dec 12 '25 19:12 qedawkins

Split up at #22911, #22912, #22914, #22915, #22916, #22917, and #22918. #22910 is the base which adds the directory boilerplate which I'll land concurrently with whichever of the others is approved first.

I'm going to leave this open for my own testing during reviews of the other files but will convert to a draft.

qedawkins avatar Dec 15 '25 21:12 qedawkins