This is a bandage on a wound that needs stitches.
Background/motivation: I was circling back around to https://llvm.org/bugs/show_bug.cgi?id=28296 . I made a simple patch for that and noticed some regressions. I added test cases for those with rL281055, and this is hopefully the minimal fix for just those cases.
But as you can see from the surrounding untouched folds, we are missing commuted patterns all over the place, and of course there are no regression tests to cover any of those cases.
It seems like we could sprinkle "m_c_" dust all over this file and catch most of the missing folds, but then we still wouldn't have test coverage, and we'd still miss some fraction of commuted patterns because they require adjustments to the match order.
Another thought: are there any cases where we do *not* want to match the commuted variants of a pattern? If there are none of those, then could we just change the definitions for all commutative pattern matchers, so "m_c_" becomes automatic?