OSDN Git Service

[InstCombine] Y - ~X --> X + Y + 1 fold (PR42457)
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 3 Jul 2019 09:41:50 +0000 (09:41 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 3 Jul 2019 09:41:50 +0000 (09:41 +0000)
commitd07ba468a4335ac072085519831e896049c5e52c
treea50b6f5579f72d2c8352218041d7de2214e75804
parent74295609318d643877ca9c3f439d6ca52057def6
[InstCombine] Y - ~X --> X + Y + 1 fold (PR42457)

Summary:
I *think* we'd want this new variant, because we obviously
have better handling for `add` as compared to `sub`/`not`.

https://rise4fun.com/Alive/WMn

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=42457 | PR42457 ]]

Reviewers: spatel, nikic, huihuiz, efriedma

Reviewed By: spatel

Subscribers: RKSimon, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63992

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365011 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/fold-sub-of-not-to-inc-of-add.ll