This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add conversion from Complex to Standard dialect for NotEqualOp.
ClosedPublic

Authored by akuegel on May 21 2021, 12:18 AM.

Details

Summary

We can use a common templatized conversion for EqualOp and NotEqualOp.
This allows to reuse most of the logic for the conversion of EqualOp.

Diff Detail

Event Timeline

akuegel created this revision.May 21 2021, 12:18 AM
akuegel requested review of this revision.May 21 2021, 12:18 AM
pifon2a accepted this revision.May 21 2021, 12:35 AM
pifon2a added inline comments.
mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
72

Would it make sense to get rid of this if statement and just pass the replacement op type, like

ComparisonOpConversion<complex::EqualOp, CmpFPredicate::OEQ, AndOp>?

or even better, make AndOp the function of typename ComparisonOp.

This revision is now accepted and ready to land.May 21 2021, 12:35 AM
akuegel updated this revision to Diff 346947.May 21 2021, 1:06 AM

Derive result combination op type via std::conditional_t from comparison op type.

mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
72

Thanks, learned now about std::conditional_t
Done.