[Mlir-commits] [mlir] [emitc][mlir] Add an option to cast array type to ptr type (PR #126385)

Simon Camphausen llvmlistbot at llvm.org
Sat Feb 8 13:05:16 PST 2025


================
@@ -247,11 +247,12 @@ LogicalResult emitc::AssignOp::verify() {
 bool CastOp::areCastCompatible(TypeRange inputs, TypeRange outputs) {
   Type input = inputs.front(), output = outputs.front();
 
----------------
simon-camp wrote:

Can you check that the array element type and pointee type match and that the array has rank 1?

```cpp
if (auto arrayType = dyn_cast<emitc::ArrayType>(input))
{
    if (auto pointerType = dyn_cast<emitc::PointerType>(output))
    {
        return ...
    }
}

... original check
```

https://github.com/llvm/llvm-project/pull/126385


More information about the Mlir-commits mailing list