I initially tried giving IR predicates to each primop individually. Unfortunately, that means we have to pattern-match on every allowable primop when we do an IR-changing transformation, so that GHC knows that you've handled all the required cases. Previously we could have a fallback case, but that no longer typechecks. With the grouped design, you still have to pattern-match on each top-level case, but you can handle entire subtrees generically.
I initially tried giving IR predicates to each primop individually. Unfortunately, that means we have to pattern-match on every allowable primop when we do an IR-changing transformation, so that GHC knows that you've handled all the required cases. Previously we could have a fallback case, but that no longer typechecks. With the grouped design, you still have to pattern-match on each top-level case, but you can handle entire subtrees generically.