Optimize bitwise even/odd test (-x&1 -> x&1) to not use negation.
authorBalaram Makam <bmakam@codeaurora.org>
Thu, 20 Aug 2015 15:35:00 +0000 (15:35 +0000)
committerBalaram Makam <bmakam@codeaurora.org>
Thu, 20 Aug 2015 15:35:00 +0000 (15:35 +0000)
commitb2026a6a18f751474d19094b8d5cd3356c311973
tree06c951d304c577088582af8f578ce037772d0925
parent9a4e2cb3295f286dafc41b7e18619bc150880611
Optimize bitwise even/odd test (-x&1 -> x&1) to not use negation.

Summary: We know that -x & 1 is equivalent to x & 1, avoid using negation for testing if a negative integer is even or odd.

Reviewers: majnemer

Subscribers: junbuml, mssimpso, gberry, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D12156

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245569 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/and2.ll