Resolves: https://github.com/llvm/llvm-project/issues/174933 The issue goes into a case where fetch_sub(n) is properly optimized but fetch_add(neg(n)) is not optimized to the same code. Although the issue is tagged for x86 I assumed this be best handled outside of the backends so I put this in InstCombine.
This directory contains test cases for the instcombine transformation. The dated tests are actual bug tests, whereas the named tests are used to test for features that the this pass should be capable of performing.