[InstCombine] canonicalize 'not' ahead of bitcast+sext
authorSanjay Patel <spatel@rotateright.com>
Tue, 24 Jan 2023 20:30:29 +0000 (15:30 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 24 Jan 2023 20:46:46 +0000 (15:46 -0500)
commit0bb7be5ff61e910addc5d8a7887f54d78a2d43ae
treeb7014b3bffd5951ba3a35c06aad9e4ce7291abea
parentdfb8a0c99d7aae71382d4ca63d7a356663283a76
[InstCombine] canonicalize 'not' ahead of bitcast+sext

not (bitcast (sext i1 X)) --> bitcast (sext (not i1 X))

https://alive2.llvm.org/ce/z/-6Ygkd

This shows up as a potential regression if we change
canonicalization of ashr+not to icmp+sext.
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/not.ll