1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/lib/Analysis
Sanjay Patel a12bf57077 [InstSimplify] fixed (?) to not mutate icmps
As Eli noted in the post-commit thread for r288833, the use of
swapOperands() may not be allowed in InstSimplify, so I'm 
removing those calls here pending further review. 

The swap mutates the icmp, and there doesn't appear to be precedent
for instruction mutation in InstSimplify.

I didn't actually have any tests for those cases, so I'm adding
a few here. 

llvm-svn: 288855
2016-12-06 22:09:52 +00:00
..
AliasAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
AliasAnalysisEvaluator.cpp
AliasAnalysisSummary.cpp Update a comment. 2016-08-25 01:29:55 +00:00
AliasAnalysisSummary.h Make some LLVM_CONSTEXPR variables const. NFC. 2016-08-25 01:05:08 +00:00
AliasSetTracker.cpp [AliasSetTracker] Make AST smarter about assume intrinsics that don't actually affect memory. 2016-11-07 14:11:45 +00:00
Analysis.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
AssumptionCache.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
BasicAliasAnalysis.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +00:00
BlockFrequencyInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
BlockFrequencyInfoImpl.cpp [GraphTraits] Replace all NodeType usage with NodeRef 2016-08-22 21:09:30 +00:00
BranchProbabilityInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
CallGraph.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
CallGraphSCCPass.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
CallPrinter.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp [PM] Port CFGViewer and CFGPrinter to the new Pass Manager 2016-09-15 18:35:27 +00:00
CFLAndersAliasAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
CFLGraph.h
CFLSteensAliasAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
CGSCCPassManager.cpp [PM] Basic cleanups to CGSCC update code, NFC. 2016-12-06 10:06:06 +00:00
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
CodeMetrics.cpp
ConstantFolding.cpp ConstantFolding: Factor code into helper function 2016-12-02 02:26:02 +00:00
CostModel.cpp
Delinearization.cpp
DemandedBits.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
DependenceAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
DivergenceAnalysis.cpp
DominanceFrontier.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
DomPrinter.cpp
EHPersonalities.cpp [tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit during unwinding), LLVM part 2016-11-14 21:41:13 +00:00
GlobalsModRef.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
IndirectCallPromotionAnalysis.cpp
InlineCost.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +00:00
InstCount.cpp
InstructionSimplify.cpp [InstSimplify] fixed (?) to not mutate icmps 2016-12-06 22:09:52 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp [LCG] Add some much needed asserts and verify runs to uncover 2016-12-06 10:29:23 +00:00
LazyValueInfo.cpp [LVI] Remove dead code in mergeIn 2016-12-06 03:34:33 +00:00
Lint.cpp
LLVMBuild.txt Restore "[ThinLTO] Prevent exporting of locals used/defined in module level asm" 2016-11-14 17:12:32 +00:00
Loads.cpp [Loads] Fix crash in is isDereferenceableAndAlignedPointer() 2016-10-28 15:32:28 +00:00
LoopAccessAnalysis.cpp [LAA] Prevent invalid IR for loop-invariant bound in loop body 2016-12-05 21:25:03 +00:00
LoopInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
LoopPass.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LoopPassManager.cpp
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp Make some LLVM_CONSTEXPR variables const. NFC. 2016-08-25 01:05:08 +00:00
MemoryDependenceAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
MemoryLocation.cpp
ModuleDebugInfoPrinter.cpp Re-commit "Use StringRef in Support/Darf APIs (NFC)" 2016-10-05 05:59:29 +00:00
ModuleSummaryAnalysis.cpp Object: Extract a ModuleSymbolTable class from IRObjectFile. 2016-12-01 06:51:47 +00:00
ObjCARCAliasAnalysis.cpp
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp Create llvm.addressofreturnaddress intrinsic 2016-10-12 22:13:19 +00:00
OptimizationDiagnosticInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
OrderedBasicBlock.cpp
PHITransAddr.cpp
PostDominators.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
ProfileSummaryInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp IR: Change PointerType to derive from Type rather than SequentialType. 2016-12-02 03:05:41 +00:00
ScalarEvolutionAliasAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
ScalarEvolutionExpander.cpp Fix comment typos. NFC. 2016-11-20 13:47:59 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
SparsePropagation.cpp
StratifiedSets.h Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00
TargetLibraryInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
TargetTransformInfo.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
TypeMetadataUtils.cpp
ValueTracking.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +00:00
VectorUtils.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +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))

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