clangir
clangir copied to clipboard
Harden operation constraints from AnyType to CIRType
Now that https://github.com/llvm/clangir/issues/81 is fixed, we need to change operations constraints to only accept CIR types, simple example:
...
let arguments = (ins Arg<CmpOpKind, "cmp kind">:$kind,
AnyType:$lhs, AnyType:$rhs);
Should become:
...
let arguments = (ins Arg<CmpOpKind, "cmp kind">:$kind,
CIRType:$lhs, CIRType:$rhs);
And additional changes to CIRDialect.cpp
and whatnots.
Hi. Recently I'm working on this issue. I noticed that clangir does not have floating-point types. C/C++ floating-point values are lowered to MLIR values with the built-in f32
and f64
type, instead of some cir.f32
or cir.f64
type. Is this intentional? I'll have to include AnyFloat
in the CIRType
type constraint which may allow non-CIR floating-point types.
It's not intentional, we actually want CIR specific types for floating point, see https://github.com/llvm/clangir/issues/78. I haven't seen progress in the past couple months, so if you are interested you could work on that too.