This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Create fold for cmp of ext
ClosedPublic

Authored by wsmoses on Jan 2 2022, 3:28 PM.

Details

Summary

This patch creates folds for cmpi( ext(%x : i1, iN) != 0) -> %x

In essence this matches patterns matching an extension of a boolean, that != 0, which is equivalent to the original condition.

Diff Detail

Event Timeline

wsmoses created this revision.Jan 2 2022, 3:28 PM
wsmoses requested review of this revision.Jan 2 2022, 3:28 PM
This revision is now accepted and ready to land.Jan 2 2022, 4:41 PM
This revision was automatically updated to reflect the committed changes.

@wsmoses This causes a crash for vector types (because of cast<IntegerType>()).