Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: venom IR roadmap #3980

Open
6 of 17 tasks
harkal opened this issue Apr 29, 2024 · 1 comment
Open
6 of 17 tasks

meta: venom IR roadmap #3980

harkal opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
documentation Documentation

Comments

@harkal
Copy link
Collaborator

harkal commented Apr 29, 2024

Roadmap for the Venom Intermediate Representation Language

Overview

The "Venom" intermediate representation (IR) language is an initiative to enhance the compilation process of the Vyper compiler. The goal is to transition from the existing s-expression based IR to a more efficient, flexible and optimized Venom IR.

Current Status

Currently, "Venom" is being developed as a new form of IR that translates from the existing s-expression based IR. This approach allows for incremental refinement and integration into the existing compilation pipeline.

Proposed Roadmap

Phase 1: Venom IR Development

  • Develop the initial structure and capabilities of Venom IR by translating from the existing s-expression based IR.
  • Key Tasks:
    • Define Venom's data structures and operations.
    • Implement utility data structures and algorithms, like dominator trees, dominance frontier calculation, etc
    • Implement translation mechanisms from s-expression IR to Venom IR.
    • Pass the complete compiler test suite

Phase 2: Implement Basic Optimizations

  • Apply Data Flow Optimizations in order to accommodate for better stack management and variable usage
  • Key Tasks:
    • Utilize Static Single Assignment (SSA) form in Venom to optimize data flow and variable usage.
    • Optimize stack scheduling
  • Introduce basic optimizations to the new Venom IR to demonstrate immediate benefits.
  • Key Tasks:
    • Apply dead code elimination and constant folding within Venom IR.
    • Optimize function calling convention
    • Start replacing segments of s-expression IR with Venom in less critical paths to test and refine the new IR.

Phase 3: Advanced Optimizations and Transition

  • Control Flow Optimizations
  • Key Tasks:
    • Implement loop unrolling and strength reduction directly in Venom.
    • Enhance branch prediction strategies within the new IR framework.
  • Gradually phase out s-expression IR, replacing it with Venom IR in all compiler processes.
  • Key Tasks:
    • Incrementally replace all instances of s-expression IR with Venom.
    • Validate and ensure the stability and performance of Venom across the compiler.

Phase 4: Performance Testing and Benchmarking

  • Thoroughly benchmark Venom IR to measure and optimize its performance.
  • Key Tasks:
    • Establish benchmarks specifically designed for Venom's optimizations.
    • Continuously refine Venom based on real-world data and performance feedback.

Phase 5: Full Integration and Decommission of s-expression IR

  • Fully replace the s-expression IR with Venom and enable direct AST to Venom compilation.
  • Key Tasks:
    • Finalize the translation logic for direct AST to Venom generation.
    • Ensure comprehensive compatibility and remove all dependencies on the old IR.

Contributing

We welcome contributors to participate at all stages, particularly in the areas of optimization development and testing. Please refer to the project's GitHub repository for detailed contribution guidelines.

@harkal harkal added the documentation Documentation label Apr 29, 2024
@harkal harkal self-assigned this Apr 29, 2024
@harkal harkal changed the title Roadmap for the **Venom** Immediate Representation Language Roadmap for the Venom Intermediate Representation Language Apr 29, 2024
@charles-cooper charles-cooper changed the title Roadmap for the Venom Intermediate Representation Language Venom IR roadmap Apr 29, 2024
@charles-cooper charles-cooper changed the title Venom IR roadmap meta: venom IR roadmap Apr 29, 2024
@charles-cooper
Copy link
Member

we should get the venom optimizer to feature parity with the IRnode optimizer, so we can disable the IRnode optimizer without any performance regressions

@charles-cooper charles-cooper pinned this issue Oct 18, 2024
@vyperlang vyperlang deleted a comment from Saraeutsza Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation
Projects
None yet
Development

No branches or pull requests

2 participants