Commit 2ff6995e authored by Diego Caballero's avatar Diego Caballero Committed by Scott Cyphers

[MLIR] Disable support for boolean type in MLIR (#3434)

* [MLIR] Disable support for boolean type in MLIR

Ops on boolean types are currently not supported by MLIR Compiler until
the proper i1<->i8 type conversion mechanism is in place.

* Add example.

* Fix typo
parent 5d6d20d6
......@@ -272,6 +272,15 @@ bool MLIRSubgraphExtractionPass::run_on_function(std::shared_ptr<Function> func)
bool MLIRSubgraphExtractionPass::is_supported_mlir_op(std::shared_ptr<Node> node)
{
// Disable any op using boolean type until we have support for i1<->i8 conversion in MLIR.
// Otherwise, we would generate code like this:
// %0 = icmp %a, %b : i1
// store %0, %c[%arg1] : i8 // Type error: trying to store an i1 into an i8.
if (((element::Type_t)node->get_element_type()) == element::Type_t::boolean)
{
return false;
}
if (TI(Parameter) == TI(*node) || TI(Result) == TI(*node))
{
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment