llvm/lib/Analysis
Zachary Turner ece9b23b54 Fix many -Wsign-compare and -Wtautological-constant-compare warnings.
Most of the -Wsign-compare warnings are due to the fact that
enums are signed by default in the MS ABI, while the
tautological comparison warnings trigger on x86 builds where
sizeof(size_t) is 4 bytes, so N > numeric_limits<unsigned>::max()
is always false.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 22:07:03 +00:00
..
AliasAnalysis.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
AliasAnalysisEvaluator.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp Modify ModRefInfo values using static inline method abstractions [NFC]. 2017-12-05 20:12:23 +00:00
Analysis.cpp
AssumptionCache.cpp
BasicAliasAnalysis.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
BlockFrequencyInfo.cpp Revert r320104: infinite loop profiling bug fix 2017-12-08 19:38:07 +00:00
BlockFrequencyInfoImpl.cpp Irreducible loop metadata for more accurate block frequency under PGO. 2017-11-02 22:26:51 +00:00
BranchProbabilityInfo.cpp [BranchProbabilityInfo] Handle irreducible loops. 2017-11-01 15:16:50 +00:00
CallGraph.cpp
CallGraphSCCPass.cpp
CallPrinter.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAndersAliasAnalysis.cpp
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp
CMakeLists.txt
CmpInstAnalysis.cpp
CodeMetrics.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
ConstantFolding.cpp
CostModel.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
Delinearization.cpp
DemandedBits.cpp
DependenceAnalysis.cpp
DivergenceAnalysis.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
EHPersonalities.cpp
GlobalsModRef.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
IndirectCallPromotionAnalysis.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
InlineCost.cpp [InlineCost] Tracking Values through PHI Nodes 2017-12-14 14:36:18 +00:00
InstCount.cpp
InstructionSimplify.cpp Fix many -Wsign-compare and -Wtautological-constant-compare warnings. 2017-12-14 22:07:03 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
Lint.cpp [Lint] Don't warn about passing alloca'd value to tail call if using byval 2017-11-15 07:46:48 +00:00
LLVMBuild.txt
Loads.cpp Modify ModRefInfo values using static inline method abstractions [NFC]. 2017-12-05 20:12:23 +00:00
LoopAccessAnalysis.cpp [SLP] Vectorize jumbled memory loads. 2017-12-13 03:08:29 +00:00
LoopAnalysisManager.cpp Add MemorySSA as loop dependency, disabled by default [NFC]. 2017-11-21 15:45:46 +00:00
LoopInfo.cpp IR printing improvement for loop passes - handle -print-module-scope 2017-12-01 18:33:58 +00:00
LoopPass.cpp [PM/Unswitch] Teach SimpleLoopUnswitch to do non-trivial unswitching, 2017-11-17 19:58:36 +00:00
LoopUnrollAnalyzer.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
MemDepPrinter.cpp
MemDerefPrinter.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Hardware-assisted AddressSanitizer (llvm part). 2017-12-09 00:21:41 +00:00
MemoryLocation.cpp
MemorySSA.cpp Modify ModRefInfo values using static inline method abstractions [NFC]. 2017-12-05 20:12:23 +00:00
MemorySSAUpdater.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
ModuleDebugInfoPrinter.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
ModuleSummaryAnalysis.cpp [ThinLTO] Remove too aggressive assertion in building function call graph. 2017-11-17 18:28:05 +00:00
ObjCARCAliasAnalysis.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
ObjCARCAnalysisUtils.cpp Mark all library options as hidden. 2017-12-01 00:53:10 +00:00
ObjCARCInstKind.cpp
OptimizationRemarkEmitter.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
OrderedBasicBlock.cpp
PHITransAddr.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp Remove redundant includes from lib/Analysis. 2017-12-13 21:30:41 +00:00
RegionPrinter.cpp
ScalarEvolution.cpp [LV] Support efficient vectorization of an induction with redundant casts 2017-12-14 07:56:31 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp [ScalarEvolution] Fix base condition in isNormalAddRecPHI. 2017-12-14 14:47:52 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
StratifiedSets.h
TargetLibraryInfo.cpp
TargetTransformInfo.cpp [PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg rather than result 2017-11-27 21:15:43 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [ModRefInfo] Make enum ModRefInfo an enum class [NFC]. 2017-12-07 22:41:34 +00:00
TypeMetadataUtils.cpp
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp Infer lowest bits of an integer Multiply when the low bits of the operands are known 2017-12-09 23:25:57 +00:00
VectorUtils.cpp Add an @llvm.sideeffect intrinsic 2017-11-08 21:59:51 +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))

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