Attempt to match a sub(X,mul(div(X,Y),Y)) pattern as srem/urem as a last chance to merge into a divrem instruction.
For reference, the DivRemPairs pass explicitly won't merge cases when the sub/mul and div are in the same block:
// If the target supports div+rem and the instructions are in the same block // already, there's nothing to do. The backend should handle this. If the // target does not support div+rem, then we will decompose the rem. if (HasDivRemOp && RemInst->getParent() == DivInst->getParent()) continue;
clang-tidy: warning: invalid case style for variable 'isSigned' [readability-identifier-naming]
not useful