Skip to content

Conversation

@Scheremo
Copy link
Contributor

Add support for converting moore.class.classdecl operations into identified LLVM struct types during the MooreToCore lowering.

  • Introduced ClassTypeCache for mapping class symbols to LLVM structs and field paths.
  • Added utilities:
    • mangleClassName generates moore.class.<name> identifiers.
    • getOrCreateOpaqueStruct creates identified LLVM struct types.
  • Implemented resolveClassStructBody to:
    • Lay out classes in base-first order.
    • Convert class properties to LLVM member types.
    • Inherit base field paths.
  • Added ClassDeclOpConversion to handle class lowering and removal.
  • Extended type conversion:
    • ClassHandleType -> !llvm.ptr
  • Integrated cache handling into MooreToCorePass.

@Scheremo Scheremo force-pushed the pr-moore-classes-decl-lowering branch from 76f8681 to b4b774e Compare October 29, 2025 12:49
@Scheremo Scheremo changed the title [MooreToCore] Implement ClassDeclOp -> LLVMStructType conversion [MooreToCore] [1/2] Implement ClassDeclOp -> LLVMStructType conversion Oct 29, 2025
@Scheremo Scheremo marked this pull request as ready for review October 29, 2025 13:09
@Scheremo Scheremo changed the title [MooreToCore] [1/2] Implement ClassDeclOp -> LLVMStructType conversion [MooreToCore] [1/3] Implement ClassDeclOp -> LLVMStructType conversion Oct 29, 2025
@Scheremo Scheremo force-pushed the pr-moore-classes-decl-lowering branch from b4b774e to 6efdd37 Compare October 29, 2025 14:23
@Scheremo Scheremo changed the title [MooreToCore] [1/3] Implement ClassDeclOp -> LLVMStructType conversion [MooreToCore] [1/4] Implement ClassDeclOp -> LLVMStructType conversion Oct 29, 2025
@Scheremo Scheremo force-pushed the pr-moore-classes-decl-lowering branch 2 times, most recently from 04da412 to a02d30e Compare October 30, 2025 07:49
@Scheremo Scheremo force-pushed the pr-moore-classes-decl-lowering branch 4 times, most recently from cdeaaae to d8520fd Compare October 31, 2025 08:16
Add support for converting `moore.class.classdecl` operations into
identified LLVM struct types during the MooreToCore lowering.

- Introduced **`ClassTypeCache`** for mapping class symbols to LLVM structs and field paths.
- Added utilities:
  - `mangleClassName` generates `moore.class.<name>` identifiers.
  - `getOrCreateOpaqueStruct` creates identified LLVM struct types.
- Implemented `resolveClassStructBody` to:
  - Lay out classes in **base-first** order.
  - Convert class properties to LLVM member types.
  - Inherit base field paths.
- Added `ClassDeclOpConversion` to handle class lowering and removal.
- Extended type conversion:
  - `ClassHandleType` -> `!llvm.ptr`
- Integrated cache handling into `MooreToCorePass`.
@Scheremo Scheremo force-pushed the pr-moore-classes-decl-lowering branch from d8520fd to c0199d2 Compare October 31, 2025 08:18
Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

Really nice, LGTM! Thanks a lot for getting us closer to SV classes support 😃

@Scheremo Scheremo merged commit 41f8e51 into llvm:main Nov 1, 2025
7 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