[APInt] Use isSubsetOf, intersects, and bit counting methods to reduce temporary...
authorCraig Topper <craig.topper@gmail.com>
Tue, 25 Apr 2017 17:46:30 +0000 (17:46 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 25 Apr 2017 17:46:30 +0000 (17:46 +0000)
commitf3dbd17d0a9f286591026a01a026aceec92dcfb7
treeff5f538dbc45c42146175a03b37dbbde80a7e949
parentb3b3c29c875af3246231dd8b2d4b9aade66c1b6c
[APInt] Use isSubsetOf, intersects, and bit counting methods to reduce temporary APInts

This patch uses various APInt methods to reduce temporary APInt creation.

This should be all of the unrelated cleanups that got buried in D32376(creating a KnownBits struct) as well as some pointed out by Simon during the review of that. Plus a few improvements to use counting instead of masking.

I've left out any places where we do something like (KnownZero & KnownOne) != 0 as I plan to add a helper method to KnownBits to ask that question and didn't want to thrash that code an additional time.

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

llvm-svn: 301338
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp