You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CIR][CIRGen] Add complex type and its CIRGen support
This patch adds !cir.complex type to model the _Complex type in C. It also
contains support for its CIRGen.
In detail, this patch adds the following CIR types, ops, and attributes:
- The `!cir.complex` type is added to model the _Complex type in C. This type is
parameterized with the type of the components of the complex number, which
must be either an integer type or a floating-point type.
- The `#cir.complex` attribute is added to represent a literal value of _Complex
type.
- The `cir.complex.extract` op is added to extract the real and imaginary part
of a value of `!cir.complex` type.
CIRGen support for the new complex type is also added. Note the implementation
diverges from the original clang CodeGen, where expressions of complex types are
handled differently from scalars and aggregates. Instead, this patch treats
expressions of complex types as scalars, as such expressions can be simply
lowered to a CIR value of `!cir.complex` type.
0 commit comments