[PATCH] D114126: [PatternMatch] Create match method to track uses complexity. WIP.
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 18 02:03:50 PST 2021
rampitec added a comment.
A side note: I have initially tried to modify match() methods to accept and calculate complexity arguments and being stateless, just return them. I have then realized that turns into nightmare because a match can restart and retry, and that is nearly impossible to track statelessly. The benefit was obvious: an early termination of a match, but the accounting cost quickly became too high and not stateless anyway. That said I believe only a BinOp and UnOp will have to keep state. Well, combine and/or too likely. The leaf matches like m_Value or constants do not count and have complexity zero anyway. So the new match interface will have to sum final complexity after the whole match has succeeded and states recorded.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114126/new/
https://reviews.llvm.org/D114126
More information about the llvm-commits
mailing list