[PATCH] D48326: [RFC] "Alternative" matches for TableGen DAG patterns

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 07:46:04 PDT 2018


kparzysz added a comment.

For the purposes of matching the main pattern is really the same as the ones specified by `Pat`s.  I am opposed to making this feature specific to the "Pattern" field, (1) because this is a very useful feature to have in general, and (2) because if the implementation is main-pattern-specific, it would need to be replaced to make it work with Pats in the future. The main strength of this feature comes from multiple "source patterns" in a PatFrag.

The main issue you'd encounter is that wherever there is a single pattern in CodeGenDAGPatterns.cpp, there will now have to be a list of them.  The function InlinePatternFragments would create new patterns for each alternative source pattern, so it would no longer be single input -> single output, but single input -> multiple outputs.  Other than that, there shouldn't really be more significant differences.  The patterns are detached from instruction definitions as soon as you add them to the PatternsToMatch list.


Repository:
  rL LLVM

https://reviews.llvm.org/D48326





More information about the llvm-commits mailing list