[PATCH] D48651: [RFC] Pattern matching on schedule trees.
lorenzo chelini via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 3 01:52:47 PDT 2018
chelini added inline comments.
================
Comment at: include/polly/ScheduleOptimizer.h:50
+
+Suggestions on how to do that?
+
----------------
ftynse wrote:
> It depends on what you need exactly. Just one node without specifying a type? Does that mean that the node _does_ exist or _may_ exist? Do you want to skip over multiple levels of the tree? Do you want to skip over multiple siblings? One can go shell-like wildcard way with `?` and `*`. Or some flavor of regular expressions, but this quickly goes out of hand. I'd like to see examples of what needs to be expressed before taking a decision. My feeling after using different flavors of schedule trees is that you probably need some traversal matchers like `hasSibling` or `hasDescendant`
Hi, Indeed `hasSibling` or `hasDescendant` would be really useful. In the case of matrix-multiplication suggested by Michael you may, for example, have two different schedule trees:
-Domain
--Band {/*mat mul op */}
---Leaf
For the simple case without initialization or
-Domain
--Sequence
---Filter
----Band
-----Leaf
---Filter
----Band
-----Leaf
---Filter
----Band {/*mat mul op */}
-----Leaf
For the case with initialization. A possible matchers would look like as Domain(hasDescendant(Band())). Of course, band should have specific properties related to the matmul operation. Do you already have in mind a possible implementation for these traversal matchers?
https://reviews.llvm.org/D48651
More information about the llvm-commits
mailing list