OSDN Git Service

[InstCombine] add nsw/nuw X, signbit --> or X, signbit
authorSanjay Patel <spatel@rotateright.com>
Sat, 18 Feb 2017 22:20:09 +0000 (22:20 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 18 Feb 2017 22:20:09 +0000 (22:20 +0000)
commit2b341046dd34c3c8e381a4c5e312fee5f02c56fb
tree87c7172f639020bfd856f9cb2998f33dab04566b
parent132ef2be48e9204e8fe4947996fa9df153bea6e4
[InstCombine] add nsw/nuw X, signbit --> or X, signbit

Changing to 'or' (rather than 'xor' when no wrapping flags are set)
allows icmp simplifies to happen as expected.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295574 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/add.ll
test/Transforms/InstCombine/icmp-add.ll