1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Transforms/InstCombine
Craig Topper c5d014c133 [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits
This patch introduces a new KnownBits struct that wraps the two APInt used by computeKnownBits. This allows us to treat them as more of a unit.

Initially I've just altered the signatures of computeKnownBits and InstCombine's simplifyDemandedBits to pass a KnownBits reference instead of two separate APInt references. I'll do similar to the SelectionDAG version of computeKnownBits/simplifyDemandedBits as a separate patch.

I've added a constructor that allows initializing both APInts to the same bit width with a starting value of 0. This reduces the repeated pattern of initializing both APInts. Once place default constructed the APInts so I added a default constructor for those cases.

Going forward I would like to add more methods that will work on the pairs. For example trunc, zext, and sext occur on both APInts together in several places. We should probably add a clear method that can be used to clear both pieces. Maybe a method to check for conflicting information. A method to return (Zero|One) so we don't write it out everywhere. Maybe a method for (Zero|One).isAllOnesValue() to determine if all bits are known. I'm sure there are many other methods we can come up with.

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

llvm-svn: 301432
2017-04-26 16:39:58 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineAndOrXor.cpp [InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B) 2017-04-25 15:19:04 +00:00
InstCombineCalls.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineCasts.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineCompares.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineInternal.h [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineLoadStoreAlloca.cpp [InstCombine] Reduce visitLoadInst() code duplication. NFCI. 2017-04-19 17:26:57 +00:00
InstCombineMulDivRem.cpp [APInt] Rename getSignBit to getSignMask 2017-04-20 16:56:25 +00:00
InstCombinePHI.cpp [InstCombine] Support folding a subtract with a constant LHS into a phi node 2017-04-14 19:20:12 +00:00
InstCombineSelect.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineShifts.cpp [APInt] Rename getSignBit to getSignMask 2017-04-20 16:56:25 +00:00
InstCombineSimplifyDemanded.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineVectorOps.cpp InstCombine: Use the InstSimplify hook for shufflevector 2017-04-04 04:47:57 +00:00
InstructionCombining.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
LLVMBuild.txt