[InstCombine] improve efficiency of isFreeToInvert
authorSanjay Patel <spatel@rotateright.com>
Mon, 23 Aug 2021 18:51:58 +0000 (14:51 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 23 Aug 2021 18:56:14 +0000 (14:56 -0400)
commit5d7d2f0d2e7b137e68337b0b472130b61d9f305e
tree8489f93781c9bec5bccb647e78268e4860448a5f
parente4635e6328c88f1f403b316bd8340fe03f9835a8
[InstCombine] improve efficiency of isFreeToInvert

This is NFC-intended when viewed from outside the pass.
I was trying to make sure that we don't infinite loop
in subtract combines and noticed that we handle the
non-canonical forms of add/sub here, but it should
not be necessary. Coding it this way seems slightly
clearer than mixing all 4 patterns as before.
llvm/include/llvm/Transforms/InstCombine/InstCombiner.h