alexey-bataev wrote: > LGTM. For future work we can improve the flattening of the add/sub tree for cases when this is a mismatched number of negated and non-negated values. I have some follow-up after this patch https://github.com/llvm/llvm-project/pull/213544