llvm-6502/lib/Analysis
Rafael Espindola 26c8dcc692 Always compute all the bits in ComputeMaskedBits.
This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcombine
to simplify cases like the one in the included testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 12:51:34 +00:00
..
IPA Handle intrinsics in GlobalsModRef. Fixes pr12351. 2012-03-28 21:31:24 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp
BasicAliasAnalysis.cpp
BlockFrequencyInfo.cpp
BranchProbabilityInfo.cpp
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt Pull the implementation of the code metrics out of the inline cost 2012-03-16 05:51:52 +00:00
CodeMetrics.cpp Initial commit for the rewrite of the inline cost analysis to operate 2012-03-31 12:42:41 +00:00
ConstantFolding.cpp
DbgInfoPrinter.cpp
DebugInfo.cpp Add a line number for the scope of the function (starting at the first 2012-04-03 00:43:49 +00:00
DIBuilder.cpp Add a line number for the scope of the function (starting at the first 2012-04-03 00:43:49 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
InlineCost.cpp Fix a typo reported in IRC by someone reviewing this code. 2012-03-31 13:18:09 +00:00
InstCount.cpp
InstructionSimplify.cpp Revert r153521 as it's causing large regressions on the nightly testers. 2012-03-28 18:42:50 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp Cleanup IVUsers::addUsersIfInteresting. 2012-03-22 17:47:33 +00:00
LazyValueInfo.cpp llvm::SwitchInst 2012-03-11 06:09:17 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp Always compute all the bits in ComputeMaskedBits. 2012-04-04 12:51:34 +00:00
LLVMBuild.txt
Loads.cpp enhance jump threading to preserve TBAA information when PRE'ing loads, 2012-03-13 18:07:41 +00:00
LoopDependenceAnalysis.cpp
LoopInfo.cpp
LoopPass.cpp Take out the debug info probe stuff. It's making some changes to 2012-03-23 03:54:05 +00:00
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PathNumbering.cpp
PathProfileInfo.cpp
PathProfileVerifier.cpp
PHITransAddr.cpp Uniformize the InstructionSimplify interface by ensuring that all routines 2012-03-13 11:42:19 +00:00
PostDominators.cpp
ProfileEstimatorPass.cpp
ProfileInfo.cpp
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp Always compute all the bits in ComputeMaskedBits. 2012-04-04 12:51:34 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp Always compute all the bits in ComputeMaskedBits. 2012-04-04 12:51:34 +00:00

Analysis Opportunities:

//===---------------------------------------------------------------------===//

In test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll, the
ScalarEvolution expression for %r is this:

  {1,+,3,+,2}<loop>

Outside the loop, this could be evaluated simply as (%n * %n), however
ScalarEvolution currently evaluates it as

  (-2 + (2 * (trunc i65 (((zext i64 (-2 + %n) to i65) * (zext i64 (-1 + %n) to i65)) /u 2) to i64)) + (3 * %n))

In addition to being much more complicated, it involves i65 arithmetic,
which is very inefficient when expanded into code.

//===---------------------------------------------------------------------===//

In formatValue in test/CodeGen/X86/lsr-delayed-fold.ll,

ScalarEvolution is forming this expression:

((trunc i64 (-1 * %arg5) to i32) + (trunc i64 %arg5 to i32) + (-1 * (trunc i64 undef to i32)))

This could be folded to

(-1 * (trunc i64 undef to i32))

//===---------------------------------------------------------------------===//