-
Notifications
You must be signed in to change notification settings - Fork 124
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
[CIR][LLVMLowering] Add LLVM lowering for complex operations #723
Conversation
This patch adds LLVM lowering for the following operations related to complex numbers: 1) `cir.complex.create`, 2) `cir.complex.real_ptr`, and 3)`cir.complex.imag_ptr`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will merge after the question below
The LLVM IR generated for
cir.complex.create
is a bit ugly since it includes theinsertvalue
instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try foldingcir.complex.create
.
Awesome! Is the insertvalue
solely because we need better canonicalization at the CIR level? Can you please create an issue with the examples that need to be improved? Perhaps such canonicalization can be done in ComplexCreateOp::fold
.
Yes, we currently cannot avoid this unless we could eliminate
Created #726 to track this. |
This PR adds LLVM lowering for the following operations related to complex numbers: - `cir.complex.create`, - `cir.complex.real_ptr`, and - `cir.complex.imag_ptr`. The LLVM IR generated for `cir.complex.create` is a bit ugly since it includes the `insertvalue` instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try folding `cir.complex.create`.
This PR adds LLVM lowering for the following operations related to complex numbers: - `cir.complex.create`, - `cir.complex.real_ptr`, and - `cir.complex.imag_ptr`. The LLVM IR generated for `cir.complex.create` is a bit ugly since it includes the `insertvalue` instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try folding `cir.complex.create`.
This PR adds LLVM lowering for the following operations related to complex numbers: - `cir.complex.create`, - `cir.complex.real_ptr`, and - `cir.complex.imag_ptr`. The LLVM IR generated for `cir.complex.create` is a bit ugly since it includes the `insertvalue` instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try folding `cir.complex.create`.
This PR adds LLVM lowering for the following operations related to complex numbers: - `cir.complex.create`, - `cir.complex.real_ptr`, and - `cir.complex.imag_ptr`. The LLVM IR generated for `cir.complex.create` is a bit ugly since it includes the `insertvalue` instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try folding `cir.complex.create`.
This PR adds LLVM lowering for the following operations related to complex numbers: - `cir.complex.create`, - `cir.complex.real_ptr`, and - `cir.complex.imag_ptr`. The LLVM IR generated for `cir.complex.create` is a bit ugly since it includes the `insertvalue` instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try folding `cir.complex.create`.
This PR adds LLVM lowering for the following operations related to complex numbers:
cir.complex.create
,cir.complex.real_ptr
, andcir.complex.imag_ptr
.The LLVM IR generated for
cir.complex.create
is a bit ugly since it includes theinsertvalue
instruction, which typically is not generated in upstream CodeGen. Later we may need further CIR canonicalization passes to try foldingcir.complex.create
.