This can land before D98050 (or any other fma combine) but for a review it might be easier to see src modifiers in .ll tests than .mir.
If this is accepted before, we can commit it without .ll tests.
Does this need to be a separate patch with a unit test?
Looks like the logic is mostly copied from selectiondag, so I guess it's OK.
Does this match exactly one copy? Would it be more useful to skip zero or more copies?
I think these three lines can be replaced with IsFMA ? !Subtarget->hasFmaMixInsts() : !Subtarget->hasMadMixInsts()
m_Copy matches exactly one copy. This matches zero or one copy. Renamed to m_IgnoreCopy, StripCopy was a little misleading.
It could be easily changed to zero or more, but I did not run into a case where that was necessary.
I feel like it would be better to match multiple copies, kind of like getDefIgnoringCopies. You'll probably run into multiple copies one day, and chances are you'll want to walk past them too.
Updated IgnoreCopy matcher to skip through multiple copies.
IR has matchers like m_TruncOrSelf and m_ZExtOrSelf which match one or zero of those nodes. So I guess it's not unprecedented to have a matcher like this.
Maybe rename to m_CopyOrSelf?
The practical case where you would want to use this is when you know you can ignore cross bank copies, which I think should only ever see 1 copy
Really this copy shouldn't be here, but regbankselect and the post-regbank combiner don't optimally handle constants. For an inline constant we should always have the constant appear directly with the result regbank. Can you add a fix to remove this?