Currently the best instruction pattern is selected by counting how many cfg nodes it covers.
This sometimes creates non-optimal pattern coverage as some patterns are a specification of another ones - for example PushPattern and PushRegPattern.
A potential solution for this issue is to add priority field to patterns and make matcher select maximum (coveredNodes, patternPriority).
Currently the best instruction pattern is selected by counting how many cfg nodes it covers.
This sometimes creates non-optimal pattern coverage as some patterns are a specification of another ones - for example
PushPatternandPushRegPattern.A potential solution for this issue is to add
priorityfield to patterns and make matcher select maximum(coveredNodes, patternPriority).