-
Notifications
You must be signed in to change notification settings - Fork 146
Add canonicalization passes for cir.complex.create #726
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
Labels
enhancement
New feature or request
Comments
bcardosolopes
pushed a commit
that referenced
this issue
Aug 8, 2024
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address #726 .
Close as completed. |
Hugobros3
pushed a commit
to shady-gang/clangir
that referenced
this issue
Oct 2, 2024
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address llvm#726 .
smeenai
pushed a commit
to smeenai/clangir
that referenced
this issue
Oct 9, 2024
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address llvm#726 .
smeenai
pushed a commit
to smeenai/clangir
that referenced
this issue
Oct 9, 2024
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address llvm#726 .
keryell
pushed a commit
to keryell/clangir
that referenced
this issue
Oct 19, 2024
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address llvm#726 .
lanza
pushed a commit
that referenced
this issue
Nov 5, 2024
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address #726 .
lanza
pushed a commit
that referenced
this issue
Mar 18, 2025
This PR adds folders for `cir.complex.create`, `cir.complex.real`, and `cir.complex.imag`. This PR adds a new attribute `#cir.complex` that represents a constant complex value. Besides, the CIR dialect does not have a constant materializer yet; this PR adds it. Address #726 .
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Consider the following example:
CIRGen emits code similar to the following:
Then LLVMIR lowering pass further emits code similar to the following:
The
insertvalue
instruction is required to lowercir.complex.create
because complex values are lowered to LLVM aggregate values, and thus we need to construct the aggregate value entirely in LLVM registers. But this is not the way the upstream CodeGen currently handles complex values. For the C code listed above, the upstream CodeGen would emit code like the following:Basically the upstream CodeGen breaks the big store of aggregate values down to small stores of fields. To keep consistent LLVM IR codegen, we need further canonicalization passes to track the data flow of SSA values created by the
cir.complex.create
operation and breaks it into its real part and imaginary part. To give an example, after the canonicalization, the code generated by CIRGen above should be similar to:The text was updated successfully, but these errors were encountered: