This is an archive of the discontinued LLVM Phabricator instance.

[mlir][arith] Fold `andi x, not(x)` to zero
ClosedPublic

Authored by zero9178 on Aug 14 2022, 7:32 AM.

Details

Summary

A bitwise and with the bitwise negate of itself is always 0, regardless of the integer type. This patch adds detection of such a pattern in arith.andis fold method.

Diff Detail

Event Timeline

zero9178 created this revision.Aug 14 2022, 7:32 AM
zero9178 requested review of this revision.Aug 14 2022, 7:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2022, 7:32 AM

Friendly ping :)

ftynse accepted this revision.Aug 24 2022, 3:42 AM
This revision is now accepted and ready to land.Aug 24 2022, 3:42 AM
This revision was automatically updated to reflect the committed changes.