1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/lib/Analysis
Manuel Jacob f125133498 Change ConstantFoldInstOperands to take Instruction instead of opcode and type. NFC.
Summary:
The previous form, taking opcode and type, is moved to an internal
helper and the new form, taking an instruction, is a wrapper around this
helper.

Although this is a slight cleanup on its own, the main motivation is to
refactor the constant folding API to ease migration to opaque pointers.
This will be follow-up work.

Reviewers: eddyb

Subscribers: dblaikie, llvm-commits

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

llvm-svn: 258391
2016-01-21 06:33:22 +00:00
..
AliasAnalysis.cpp fix formatting; NFC 2016-01-13 22:17:13 +00:00
AliasAnalysisEvaluator.cpp [OperandBundles] Have GlobalsModRef play nice with operand bundles 2015-12-23 09:58:46 +00:00
AliasSetTracker.cpp
Analysis.cpp
AssumptionCache.cpp
BasicAliasAnalysis.cpp [opaque pointer types] [NFC] GEP: replace get(Pointer)ElementType uses with get{Source,Result}ElementType. 2016-01-19 17:28:00 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp
CallGraph.cpp
CallGraphSCCPass.cpp Recommit r256952 "Filtering IR printing for print-after-all/print-before-all" 2016-01-06 22:55:03 +00:00
CallPrinter.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp
CGSCCPassManager.cpp
CMakeLists.txt
CodeMetrics.cpp
ConstantFolding.cpp Change ConstantFoldInstOperands to take Instruction instead of opcode and type. NFC. 2016-01-21 06:33:22 +00:00
CostModel.cpp Implemented cost model for masked gather and scatter operations 2015-12-28 20:10:59 +00:00
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp
DivergenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
EHPersonalities.cpp [WinEH] Rename CatchReturnInst::getParentPad, NFC 2016-01-15 21:16:19 +00:00
GlobalsModRef.cpp GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
InlineCost.cpp Change ConstantFoldInstOperands to take Instruction instead of opcode and type. NFC. 2016-01-21 06:33:22 +00:00
InstCount.cpp
InstructionSimplify.cpp Change ConstantFoldInstOperands to take Instruction instead of opcode and type. NFC. 2016-01-21 06:33:22 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyCallGraph.cpp [lcg] Fix a few more formatting goofs found by clang-format. NFC. 2015-12-28 01:54:20 +00:00
LazyValueInfo.cpp
Lint.cpp GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
LLVMBuild.txt
Loads.cpp Push isDereferenceableAndAlignedPointer down into isSafeToLoadUnconditionally 2016-01-17 12:35:29 +00:00
LoopAccessAnalysis.cpp [LAA] Include function name in debug output 2016-01-18 21:16:33 +00:00
LoopInfo.cpp fix variable names; NFC 2016-01-17 23:18:05 +00:00
LoopPass.cpp LoopInfo: Simplify ownership of Loop objects 2016-01-08 19:08:53 +00:00
Makefile
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp Update to use new name alignTo(). 2016-01-14 21:06:47 +00:00
MemoryDependenceAnalysis.cpp [MDA] Don't be quite as conservative for noalias functions 2016-01-05 00:49:14 +00:00
MemoryLocation.cpp
ModuleDebugInfoPrinter.cpp
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp
OrderedBasicBlock.cpp
PHITransAddr.cpp [opaque pointer types] [breaking-change] [NFC] SimplifyGEPInst: take the source element type of the GEP as an argument. 2016-01-17 22:46:43 +00:00
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp Change ConstantFoldInstOperands to take Instruction instead of opcode and type. NFC. 2016-01-21 06:33:22 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp rangify; NFCI 2016-01-13 18:37:28 +00:00
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp [WebAssembly] Re-enable loop idiom recognition for memcpy et al. 2016-01-19 14:49:23 +00:00
TargetTransformInfo.cpp Implemented cost model for masked gather and scatter operations 2015-12-28 20:10:59 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp fix typo 2016-01-13 16:34:10 +00:00
ValueTracking.cpp [opaque pointer types] [NFC] GEP: replace get(Pointer)ElementType uses with get{Source,Result}ElementType. 2016-01-19 17:28:00 +00:00
VectorUtils.cpp [opaque pointer types] [NFC] GEP: replace get(Pointer)ElementType uses with get{Source,Result}ElementType. 2016-01-19 17:28:00 +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))

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