Skip to content

[LLHD][SV] Unify the ProceduralRegion trait in CIRCTSupport#10180

Merged
fzi-hielscher merged 2 commits intollvm:mainfrom
fzi-hielscher:common-progreg-trait
Apr 13, 2026
Merged

[LLHD][SV] Unify the ProceduralRegion trait in CIRCTSupport#10180
fzi-hielscher merged 2 commits intollvm:mainfrom
fzi-hielscher:common-progreg-trait

Conversation

@fzi-hielscher
Copy link
Copy Markdown
Contributor

Move the ProceduralRegion operation traits of the LLHD and SV dialects to a common declaration within the CIRCT support library. This should allow us to (temporarily) include procedural operations of one dialect under procedural regions of another dialect during lowering, without triggering an IR verification error. The behavior of the trait within the dialects remains unchanged.

We will have to further consider how the trait should work transitively.
E.g., while this is now legal:

hw.module @foo() {
  llhd.final {
      sv.write "bye"
      llhd.halt
  }
}

This still fails:

hw.module @foo(in %cond: i1) {
  llhd.final {
      scf.if %cond {
        sv.write "bye"
      }
      llhd.halt
  }
}

Move the `ProceduralRegion` operation traits of the LLHD and SV dialects
to a common declaration within the CIRCT support library. This should
allow us to (temporarily) include procedural operations of one dialect
under procedural regions of another dialect during lowering, without
triggering an IR verification error. The behavior of the trait within
the dialects remains unchanged.
@fzi-hielscher
Copy link
Copy Markdown
Contributor Author

CC #10172

Copy link
Copy Markdown
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

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

LGTM, do you have a plan to move ProceduralOp/NonProceduralOp traits as well?

@fzi-hielscher
Copy link
Copy Markdown
Contributor Author

Yeah, but that's the point where I'm not sure how to do it right. I'll create a draft PR later.

@fzi-hielscher fzi-hielscher merged commit 90ea32d into llvm:main Apr 13, 2026
13 of 19 checks passed
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