<div dir="ltr">Hi,<div><br></div><div>The attached patch introduces a PatternMatch-like interface for SelectionDAG creatively called DAGPatternMatch.</div><div><br></div><div>While this patch does not address fused operations like ZEXTLOAD nor target specific intrinsics, I do not see that preventing this patch from being considered and committed. I'd love to hear suggestions regarding how they should be handled.</div>
<div><br></div><div>Using DAGPatternMatch, I've identified bugs like hasOneUse() getting called on ConstantSDNodes and I've managed to replace 400 lines of code with 300 lines of code that are simpler to reason about while making other patterns more general and even adding new patterns.</div>
<div><br></div><div>Once this patch is accepted, I'll submit more patches that actually change the DAGCombiner machinery to use the new DAGPatternMatch.</div><div><br></div><div>Thanks!</div><div>-- </div><div>David Majnemer</div>
</div>