Giter Site home page Giter Site logo

Optimizations in clangir? about clangir HOT 5 CLOSED

llvm avatar llvm commented on May 25, 2024
Optimizations in clangir?

from clangir.

Comments (5)

lanza avatar lanza commented on May 25, 2024 2

Hey Keyi! What exactly is your project? We certainly don't have as much of the Clang AST supported as Polygeist as of today. We hope to improve the story over the next year, but it'll be a relatively long process.

But the default cir output is unoptimized compared to Polygeist's. For instance, cgeist runs mem2reg and code motion optimizations, which are very helpful for downstream tools to analyze the IR.

Yes, we currently don't run any optimization passes. That's a bit of a "phase 2" topic. For "phase 1" we're prioritizing solving the problem of handling more of Clang's AST and codegen.

May I ask what your project and interest is? We're definitely interested more about it. We have a monthly meeting and the next one is this coming Monday if you'd like to join. @bcardosolopes will be sharing a reminder in https://discourse.llvm.org/tag/clang shortly.

from clangir.

bcardosolopes avatar bcardosolopes commented on May 25, 2024

For instance, cgeist runs mem2reg and code motion optimizations, which are very helpful for downstream tools to analyze the IR.

We currently have WIP support for CIR -> "in-tree MLIR dialects" lowering, so theoretically you could use that output as an input for poligesit already existing mem2reg and other code motion optimizations.

The problem here, as Nathan stated, is that we don't yet cover all AST nodes, which is what we are heavily working atm. Also, CIR -> MLIR in-tree dialects progress is a bit stalled since no one is actively working on it yet, but patches are welcome - and it's the probably best way to connect the two projects.

Is there any plan to add common optimizations to clangir before LLVM lowering pass?

We plan to work on that at some point in the future but it's not the current short-term priority.

from clangir.

bcardosolopes avatar bcardosolopes commented on May 25, 2024

@bcardosolopes will be sharing a reminder in https://discourse.llvm.org/tag/clang shortly

https://discourse.llvm.org/t/mlir-c-c-frontend-working-group-monday-march-27th/69511

from clangir.

Kuree avatar Kuree commented on May 25, 2024

Thanks for the quick response!

May I ask what your project and interest is?

As much as I'd like to talk about it, unfortunately we are not ready to share the project details yet. Sorry about that.

Also, CIR -> MLIR in-tree dialects progress is a bit stalled since no one is actively working on it yet, but patches are welcome - and it's the probably best way to connect the two projects.

That sounds promising, but one potential issue is that Polygesit and clangir use slightly different version of MLIR. It's likely that we need to have two different LLVMs in order to connect these two projects. I will discuss it with my colleagues and see if there is any interest choosing this route.

Thank you again for the information. I will try to attend the Monday meeting.

from clangir.

bcardosolopes avatar bcardosolopes commented on May 25, 2024

That sounds promising, but one potential issue is that Polygesit and clangir use slightly different version of MLIR. It's likely that we need to have two different LLVMs in order to connect these two projects.

Indeed, we try to rebase on ToT often, but at times we might get few months behind, if it helps we can tag specific points in time for others to consume, or open to hear suggestions.

I will discuss it with my colleagues and see if there is any interest choosing this route.

Hit us up if you wanna discuss any piece further!

from clangir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.