ConvertStandardToLLVM: replace assertion with graceful failure
authorAlex Zinenko <zinenko@google.com>
Mon, 18 Nov 2019 19:25:52 +0000 (11:25 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 18 Nov 2019 19:26:24 +0000 (11:26 -0800)
commit062dd406b1efd00483961ab3a4e75543e47b4859
treed5d48e0c32496c24bdc6f11105cebcbe0fed7c20
parent68a8da4a938e5489ba915d615352af0b069ae56a
ConvertStandardToLLVM: replace assertion with graceful failure

The assertion was introduced in the early days of dialect conversion
infrastructure when we had the matching function separate from the rewriting
function. The infrastructure evolved to have a common matchAndRewrite function
and the separate matching function was dropped without chaning the rewriting
that became matchAndRewrite. This has led to assertion being triggered. Return
a matchFailure instead of failing an assertion on unsupported types.

Closes tensorflow/mlir#230

PiperOrigin-RevId: 281113741
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp