This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Arithmetic] Use common constant fold function in RemSI and RemUI to cover splat.
ClosedPublic

Authored by jacquesguan on Apr 22 2022, 1:19 AM.

Details

Summary

This patch replaces current fold function with the common constant fold funtion in order to cover the situation of constant splat.

Diff Detail

Event Timeline

jacquesguan created this revision.Apr 22 2022, 1:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 1:19 AM
jacquesguan requested review of this revision.Apr 22 2022, 1:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 1:19 AM
ftynse accepted this revision.Apr 22 2022, 1:30 AM
ftynse added inline comments.
mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
455

Nit: I'd keep the explicit b.isNullValue() instead of !b.

mlir/test/Dialect/Arithmetic/canonicalize.mlir
1368

Nit: please add a newline.

This revision is now accepted and ready to land.Apr 22 2022, 1:30 AM

address comment.

This revision was landed with ongoing or failed builds.Apr 22 2022, 2:20 AM
This revision was automatically updated to reflect the committed changes.