Page MenuHomePhabricator

[PatternMatch] Add support for matching ConstantExpr.
Needs RevisionPublic

Authored by huihuiz on Dec 17 2019, 4:29 PM.

Details

Summary

Motivated in D71389. For scalable vector type, constant folding
will be applied on ConstantExprs. It would be usefull to support
pattern matcher for ConstantExprs.

Diff Detail

Event Timeline

It looks like we've always matched ConstantExprs for binary operators, but not for other operations. It probably makes sense to be more consistent.

If we're going to do this, probably makes sense to change OneOps_match/TwoOps_match at the same time.

Can you add testcases for a few of the existing transforms that are changing? There are too many transforms for it to make sense to cover everything, but it makes sense to illustrate what's actually changing.

lebedev.ri requested changes to this revision.Jan 4 2020, 12:23 AM

It looks like we've always matched ConstantExprs for binary operators, but not for other operations. It probably makes sense to be more consistent.

If we're going to do this, probably makes sense to change OneOps_match/TwoOps_match at the same time.

Can you add testcases for a few of the existing transforms that are changing? There are too many transforms for it to make sense to cover everything, but it makes sense to illustrate what's actually changing.

This revision now requires changes to proceed.Jan 4 2020, 12:23 AM