-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add an CIR analysis-only pipeline that uses traditional codegen #633
Comments
Hi Chuanqi. This should be a first-class use case of clangir. You can pass clangir already has a PoC implementation of a lifetime checker, which can be found at https://github.com/llvm/clangir/blob/main/clang/lib/CIR/Dialect/Transforms/LifetimeCheck.cpp (but for now it might be a bit out-of-date). One can run this analysis pass via: clang++ -cc1 -fclangir -emit-cir -fclangir-lifetime-check -o output.cir input.cpp I like your idea about an "analysis-only" pipeline. The problem with the above pipeline is that it still run some passes that are required for |
Hi, the interface looks like not the one I want. What I want is:
That is, it is just normal compilation except we add some new analysis. If we can do this, it is much easier to enable CIR for real world users. |
Hi @ChuanqiXu9, thanks for clarifying your question. Right now, if you use We don't have anything like that right now because none of our users have that usecase, and we avoid adding things that there are no uses for, but nothing prevents it being added at some point. It'd be useful for instance when running the lifetime checker without changing the existing codegen path. To summarize: we have no plans or intention to change |
-fclangir-analysis-only
)
-fclangir-analysis-only
)-fclangir-analysis-only
)
-fclangir-analysis-only
)
Fair enough summary. I'd like to see if I can make a simple patch. |
Close llvm#633. See the issue for details.
Sent #638 BTW, when I test it with a real world project (https://github.com/alibaba/async_simple), I met some crashes when generating the CIR. I'd like to work on it. |
@ChuanqiXu9 thanks the PR, will take a look soon. I bet it crashes cause we still have lots of C++ stuff to support, but being able to build |
Close llvm#633. See the issue for details.
Close #633. This patch introduces `-fclangir-analysis-only` option to allow the users to consume the AST to the CIR (and potential analysis passes, this can be done by specifying `-Xclang -fclangir-lifetime-check=""` now or some default value in following patches) and also generating the LLVM IR by the traditional code gen path. This will be helpful to use CIR with real world projects without worrying the correctness and completeness of CIR CodeGen part.
Close llvm/clangir#633. This patch introduces `-fclangir-analysis-only` option to allow the users to consume the AST to the CIR (and potential analysis passes, this can be done by specifying `-Xclang -fclangir-lifetime-check=""` now or some default value in following patches) and also generating the LLVM IR by the traditional code gen path. This will be helpful to use CIR with real world projects without worrying the correctness and completeness of CIR CodeGen part.
Close llvm#633. See the issue for details.
Close llvm#633. This patch introduces `-fclangir-analysis-only` option to allow the users to consume the AST to the CIR (and potential analysis passes, this can be done by specifying `-Xclang -fclangir-lifetime-check=""` now or some default value in following patches) and also generating the LLVM IR by the traditional code gen path. This will be helpful to use CIR with real world projects without worrying the correctness and completeness of CIR CodeGen part.
Close llvm#633. This patch introduces `-fclangir-analysis-only` option to allow the users to consume the AST to the CIR (and potential analysis passes, this can be done by specifying `-Xclang -fclangir-lifetime-check=""` now or some default value in following patches) and also generating the LLVM IR by the traditional code gen path. This will be helpful to use CIR with real world projects without worrying the correctness and completeness of CIR CodeGen part.
Close llvm#633. This patch introduces `-fclangir-analysis-only` option to allow the users to consume the AST to the CIR (and potential analysis passes, this can be done by specifying `-Xclang -fclangir-lifetime-check=""` now or some default value in following patches) and also generating the LLVM IR by the traditional code gen path. This will be helpful to use CIR with real world projects without worrying the correctness and completeness of CIR CodeGen part.
Close #633. This patch introduces `-fclangir-analysis-only` option to allow the users to consume the AST to the CIR (and potential analysis passes, this can be done by specifying `-Xclang -fclangir-lifetime-check=""` now or some default value in following patches) and also generating the LLVM IR by the traditional code gen path. This will be helpful to use CIR with real world projects without worrying the correctness and completeness of CIR CodeGen part.
This comes from https://discourse.llvm.org/t/rfc-upstreaming-clangir/76587/53
It may be helpful to have an analysis only pipeline so that users can try to use CIR actually without worrying the correctness and completeness of the
CIR to LLVM IR
part.The pattern may look like:
So we can have multiple consumers for the parsed AST. One the traditional code gen part. The other one is the new introduced CIR part. We generate CIR from AST and we can perform analysis on the CIR. We can also perform some transformation passes on the CIR if these transformation passes are helpful to the analysis.
Is it possible to do so? If not, would we love to do? I think it will be pretty helpful to get more users for CIR.
The text was updated successfully, but these errors were encountered: