clangir icon indicating copy to clipboard operation
clangir copied to clipboard

Harden operation constraints from AnyType to CIRType

Open bcardosolopes opened this issue 1 year ago • 2 comments

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.

bcardosolopes avatar May 26 '23 05:05 bcardosolopes

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.

Lancern avatar Dec 28 '23 01:12 Lancern

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.

bcardosolopes avatar Dec 29 '23 12:12 bcardosolopes