1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/Transforms/Utils
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
..
AddDiscriminators.cpp
ASanStackFrameLayout.cpp
BasicBlockUtils.cpp Reverts commit r301424, r301425 and r301426 2017-04-26 16:37:05 +00:00
BreakCriticalEdges.cpp
BuildLibCalls.cpp
BypassSlowDivision.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
CloneFunction.cpp Reverts commit r301424, r301425 and r301426 2017-04-26 16:37:05 +00:00
CloneModule.cpp
CMakeLists.txt
CmpInstAnalysis.cpp
CodeExtractor.cpp [CodeExtractor]: Fixup use refs of the old phi. 2017-04-25 04:51:19 +00:00
CtorUtils.cpp
DemoteRegToStack.cpp
EscapeEnumerator.cpp
Evaluator.cpp
FlattenCFG.cpp
FunctionComparator.cpp
FunctionImportUtils.cpp
GlobalStatus.cpp
ImportedFunctionsInliningStatistics.cpp
InlineFunction.cpp
InstructionNamer.cpp
IntegerDivision.cpp
LCSSA.cpp
LibCallsShrinkWrap.cpp
LLVMBuild.txt
Local.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
LoopSimplify.cpp
LoopUnroll.cpp Reverts commit r301424, r301425 and r301426 2017-04-26 16:37:05 +00:00
LoopUnrollPeel.cpp
LoopUnrollRuntime.cpp
LoopUtils.cpp Revert "Compute safety information in a much finer granularity." 2017-04-24 18:25:07 +00:00
LoopVersioning.cpp
LowerInvoke.cpp
LowerMemIntrinsics.cpp
LowerSwitch.cpp
Mem2Reg.cpp
MetaRenamer.cpp
ModuleUtils.cpp
NameAnonGlobals.cpp
PredicateInfo.cpp
PromoteMemoryToRegister.cpp
SanitizerStats.cpp
SimplifyCFG.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
SimplifyIndVar.cpp Reverts commit r301424, r301425 and r301426 2017-04-26 16:37:05 +00:00
SimplifyInstructions.cpp Convert SimplifyInstructions to use the SimplifyQuery version of SimplifyInstruction 2017-04-26 13:52:16 +00:00
SimplifyLibCalls.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
SplitModule.cpp
SSAUpdater.cpp
StripGCRelocates.cpp
StripNonLineTableDebugInfo.cpp
SymbolRewriter.cpp
UnifyFunctionExitNodes.cpp
Utils.cpp
ValueMapper.cpp
VNCoercion.cpp