Recommit "[InstCombine] Negator: -(X << C) --> X * (-1 << C)"
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 5 Aug 2020 11:55:29 +0000 (14:55 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 5 Aug 2020 12:59:13 +0000 (15:59 +0300)
commitf5df5cd5586ae9cfb2d9e53704dfc76f47aff149
treeb452489f4e584df70b7e044538bf004ff88fffc1
parentcc2612185833a0e4b7a19bfbde801ced9297b0f7
Recommit "[InstCombine] Negator: -(X << C)  -->  X * (-1 << C)"

This reverts commit ac70b37a00dc02bd8923e0a4602d26be4581c570
which reverted commit 8aeb2fe13a4100b4c2e78d6ef75119304100cb1f
because codegen tests got broken and i needed time to investigate.

This shows some regressions in tests, but they are all around GEP's,
so i'm not really sure how important those are.

https://rise4fun.com/Alive/1Gn
llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
llvm/test/CodeGen/AMDGPU/reqd-work-group-size.ll
llvm/test/Transforms/InstCombine/icmp.ll
llvm/test/Transforms/InstCombine/sub-gep.ll
llvm/test/Transforms/InstCombine/sub-of-negatible.ll
llvm/test/Transforms/InstCombine/sub.ll