[Mlir-commits] [mlir] [MLIR] Fix VectorEmulateNarrowType constant op mask bug (PR #116064)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Nov 13 13:32:27 PST 2024


https://github.com/banach-space commented:

Thanks for the fix!

I think that the logic in `getCompressedMaskOp` could benefit from a high level refactor. In particular, why not replace:
```cpp
f (createMaskOp) {
} else if (constantMaskOp) {
} else if (constantOp) {
}
```

with (pseudo syntax):
```cpp
TypeSwitch<Operation *op>(maskOp).
Case<CreateMaskOp>[&](){}
Case<ConstantMaskOp>[&](){}
Case<ConstantOp>[&](){}
```

and then every case should be implemented in a dedicated hook.

More comments inline.

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


More information about the Mlir-commits mailing list