[PATCH] D129650: [InstCombine] change conditions for transform of sub to xor

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 14:08:39 PDT 2022


bjope added a comment.

Thanks! Verified that it solves the regressions that I mentioned in D128123 <https://reviews.llvm.org/D128123>.

For future follow-ups: Maybe value/bit tracking implementations for sub can be taught about this kind of sub being an xor in disguise to get the wanted bit tracking also without transforming to sub? It is probably easier to deal with "known bits" of the non-constant operand while doing value/bit tracking compared to doing it during SCEV analysis (for the reverse - i.e. understanding that an xor is a sub in disguise).

This patch LGTM. But since @nikic had comments earlier I think you need to wait for an accept from Nikita as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129650/new/

https://reviews.llvm.org/D129650



More information about the llvm-commits mailing list