1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/lib/Analysis
Nikita Popov ab6e561d30 [BasicAA] Make sure types match in constant offset heuristic
This can only happen if offset types that are larger than the
pointer size are involved. The previous implementation did not
assert in this case because it initialized the APInts to the
width of one of the variables -- though I strongly suspect it
did not compute correct results in this case.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32621
reported by fhahn.
2021-03-28 21:38:09 +02:00
..
models/inliner [MLInliner] Simplify TFUTILS_SUPPORTED_TYPES 2020-08-25 14:19:39 -07:00
AliasAnalysis.cpp [AA] Cache (optionally) estimated PartialAlias offsets. 2021-03-02 19:04:15 +03:00
AliasAnalysisEvaluator.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
AliasAnalysisSummary.cpp AliasAnalysisSummary.h - cleanup includes and forward declarations. NFC. 2020-04-21 11:32:58 +01:00
AliasAnalysisSummary.h AliasAnalysisSummary.h - cleanup includes and forward declarations. NFC. 2020-04-21 11:32:58 +01:00
AliasSetTracker.cpp Reapply [LICM] Make promotion faster 2021-03-11 10:50:28 +01:00
Analysis.cpp [NPM] Port module-debuginfo pass to the new pass manager 2020-10-19 14:31:17 -07:00
AssumeBundleQueries.cpp [FIX] Allow non-constant assume operand bundle operands. 2021-03-11 23:31:09 -06:00
AssumptionCache.cpp Revert "[AssumptionCache] Avoid dangling llvm.assume calls in the cache" 2021-02-11 12:17:38 -06:00
BasicAliasAnalysis.cpp [BasicAA] Make sure types match in constant offset heuristic 2021-03-28 21:38:09 +02:00
BlockFrequencyInfo.cpp [BFI][CGP] Add limited support for detecting missed BFI updates and fix one in CodeGenPrepare. 2020-05-07 11:58:00 -07:00
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
CallGraph.cpp Option to ignore llvm[.compiler].used uses in hasAddressTaken() 2021-02-25 10:06:24 -08:00
CallGraphSCCPass.cpp [Analysis] Use ListSeparator (NFC) 2021-02-22 20:17:15 -08:00
CallPrinter.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
CaptureTracking.cpp Update basic deref API to account for possiblity of free [NFC] 2021-03-19 11:17:19 -07:00
CFG.cpp [Analysis] Use is_contained (NFC) 2020-12-11 21:19:31 -08:00
CFGPrinter.cpp [llvm] Use llvm::all_of (NFC) 2021-01-06 18:27:36 -08:00
CFLAndersAliasAnalysis.cpp [MemLoc] Use hasValue() method (NFC) 2020-11-19 21:53:50 +01:00
CFLGraph.h [CFLGraph] Fix a crash due to missing handling of freeze 2021-03-21 02:14:13 +09:00
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp Reapply "[NPM][CGSCC] FunctionAnalysisManagerCGSCCProxy: do not clear immutable function passes" 2021-03-18 09:44:34 -07:00
CMakeLists.txt [mlgo] Fetch models from path / URL 2021-02-16 22:47:14 -08:00
CmpInstAnalysis.cpp
CodeMetrics.cpp Revert "[AssumptionCache] Avoid dangling llvm.assume calls in the cache" 2021-02-11 12:17:38 -06:00
ConstantFolding.cpp Reapply [ConstantFold] Handle vectors in ConstantFoldLoadThroughBitcast() 2021-03-21 17:48:21 +01:00
ConstraintSystem.cpp [llvm] Remove redundant string initialization (NFC) 2021-01-12 21:43:46 -08:00
CostModel.cpp [Support] Introduce a new InstructionCost class 2020-12-11 08:12:54 +00:00
DDG.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
DDGPrinter.cpp [DDG] Data Dependence Graph - DOT printer - recommit 2020-12-16 12:37:36 -05:00
Delinearization.cpp [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00
DemandedBits.cpp [DCE] Don't remove non-willreturn calls 2021-02-19 12:35:40 +01:00
DependenceAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
DependenceGraphBuilder.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
DevelopmentModeInlineAdvisor.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
DivergenceAnalysis.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
DominanceFrontier.cpp
DomPrinter.cpp [CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo 2020-04-06 17:42:54 +00:00
DomTreeUpdater.cpp [Target, Transforms] Use *Set::contains (NFC) 2021-01-08 18:39:54 -08:00
EHPersonalities.cpp [XCOFF][AIX] Generate LSDA data and compact unwind section on AIX 2020-12-02 18:42:44 +00:00
FunctionPropertiesAnalysis.cpp [llvm] Ensure newlines at the end of files (NFC) 2021-01-10 09:24:57 -08:00
GlobalsModRef.cpp [BasicAA] Always strip single-argument phi nodes 2021-02-18 23:07:50 +01:00
GuardUtils.cpp
HeatUtils.cpp [CallPrinter] Remove static constructor. 2020-06-17 13:02:58 +02:00
ImportedFunctionsInliningStatistics.cpp Reland "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor" 2021-01-20 13:33:43 -08:00
IndirectCallPromotionAnalysis.cpp [SampleFDO] Another fix to prevent repeated indirect call promotion in 2021-03-04 18:44:12 -08:00
InlineAdvisor.cpp [NFC] Use llvm::raw_string_ostream instead of std::stringstream 2021-03-12 18:43:59 +01:00
InlineCost.cpp Reapply [InlineCost] Enable the cost benefit analysis on FDO 2021-03-25 21:51:38 -07:00
InlineSizeEstimatorAnalysis.cpp [MLGO] Fix build break as result of new InstructionCost (D91174) 2020-12-11 20:28:39 -08:00
InstCount.cpp [NFC] Port InstCount pass to new pass manager 2020-08-21 12:39:42 +03:00
InstructionPrecedenceTracking.cpp [IPT] Don't use OrderedInstructions (NFC) 2020-04-20 18:25:31 +02:00
InstructionSimplify.cpp [InstSimplify] Fix unused variable warning (NFC) 2021-03-24 09:56:36 +08:00
Interval.cpp [Analysis/Interval] Remove isLoop (NFC) 2020-12-12 10:09:35 -08:00
IntervalPartition.cpp
IRSimilarityIdentifier.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
IVDescriptors.cpp [Analysis][LoopVectorize] rename "Unsafe" variables/methods; NFC 2021-03-04 08:53:04 -05:00
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp Only verify LazyCallGraph under expensive checks 2021-02-22 20:18:59 -08:00
LazyValueInfo.cpp [LVI] Simplify and generalize handling of clamp patterns 2021-03-06 10:42:41 +01:00
LegacyDivergenceAnalysis.cpp [NewPM] Introduce (GPU)DivergenceAnalysis in the new pass manager 2021-02-16 10:26:45 +05:30
Lint.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
Loads.cpp Make FindAvailableLoadedValue TBAA aware 2021-03-24 17:20:26 +00:00
LoopAccessAnalysis.cpp Fix a miscompile introduced by 99203f2. 2021-03-25 16:53:58 -07:00
LoopAnalysisManager.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
LoopCacheAnalysis.cpp [Analysis] Use llvm::append_range (NFC) 2021-01-22 23:25:01 -08:00
LoopInfo.cpp [LCSSA] Extract a utility for deciding if a new use requires a new lcssa phi [NFC] 2021-03-17 12:14:01 -07:00
LoopNestAnalysis.cpp Revert "[LoopInterchange] Replace tightly-nesting-ness check with the one from LoopNest" 2021-03-11 01:24:43 +08:00
LoopPass.cpp [Analysis] Use llvm::erase_value (NFC) 2020-12-14 22:40:13 -08:00
LoopUnrollAnalyzer.cpp ScalarEvolution.h - reduce LoopInfo.h include to forward declarations. NFC. 2020-06-17 15:48:23 +01:00
MemDepPrinter.cpp [Analysis] Remove dead function getInstTypePair (NFC) 2020-12-19 10:57:35 -08:00
MemDerefPrinter.cpp Minor format tweak to deref analysis printer 2021-03-22 18:44:18 -07:00
MemoryBuiltins.cpp [Analysis] Support AIX vec_malloc routines 2021-01-22 16:03:01 -05:00
MemoryDependenceAnalysis.cpp [MemDepAnalysis] Remove redundant comment. 2021-03-16 15:51:17 +00:00
MemoryLocation.cpp [MemLoc] Fix debug print for LocationSize 2020-12-20 17:52:48 +01:00
MemorySSA.cpp [MSSA] Extending IsGuaranteedLoopInvariant to support an instruction defined in the entry block 2021-03-23 21:50:56 +00:00
MemorySSAUpdater.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
MLInlineAdvisor.cpp Reland "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor" 2021-01-20 13:33:43 -08:00
ModuleDebugInfoPrinter.cpp [NPM] Port module-debuginfo pass to the new pass manager 2020-10-19 14:31:17 -07:00
ModuleSummaryAnalysis.cpp [ModuleSummaryAnalysis] Avoid duplicate elements in Worklist. NFC 2021-03-06 14:19:22 -08:00
MustExecute.cpp [MustExecute] Use ListSeparator (NFC) 2021-01-28 22:21:16 -08:00
ObjCARCAliasAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
ObjCARCAnalysisUtils.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
ObjCARCInstKind.cpp [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
OptimizationRemarkEmitter.cpp [BPI] Improve static heuristics for "cold" paths. 2020-12-23 22:47:36 +07:00
PHITransAddr.cpp
PhiValues.cpp [PhiValues] Use SetVector to avoid non-determinism 2020-10-23 20:14:02 +02:00
PostDominators.cpp
ProfileSummaryInfo.cpp [CSSPGO][llvm-profgen] Use profile summary based threshold for context trimming and merging 2021-03-22 08:56:59 -07:00
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp RegionInfo.cpp - remove duplicate includes that already exist in RegionInfo.h. NFC. 2020-07-23 17:50:22 +01:00
RegionPass.cpp [NFC] Clean up always false variables 2020-10-21 10:54:55 -07:00
RegionPrinter.cpp [CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo 2020-04-06 17:42:54 +00:00
ReleaseModeModelRunner.cpp static const char *const foo => const char foo[] 2020-12-01 10:33:18 -08:00
ReplayInlineAdvisor.cpp [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks 2021-01-25 15:38:57 -08:00
ScalarEvolution.cpp [SCEV] Improve handling of not expressions in isImpliedCond() 2021-03-24 21:53:02 +01:00
ScalarEvolutionAliasAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
ScalarEvolutionDivision.cpp [SCEV] Generalize SCEVParameterRewriter to accept SCEV expression as target. 2020-09-18 10:05:02 +01:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [llvm] Use set_is_subset (NFC) 2021-02-28 10:59:20 -08:00
StackLifetime.cpp When dumping results of StackLifetime, it will print the following 2020-09-07 11:43:16 +08:00
StackSafetyAnalysis.cpp [llvm] Drop unnecessary make_range (NFC) 2021-01-09 09:25:00 -08:00
StratifiedSets.h
SyncDependenceAnalysis.cpp [Analysis] Use ListSeparator (NFC) 2021-02-14 08:36:14 -08:00
SyntheticCountsUtils.cpp [CallSite removal] Remove unneeded includes of CallSite.h. NFC 2020-04-22 00:07:13 -07:00
TargetLibraryInfo.cpp [NVPTX] CUDA does provide malloc/free since compute capability 2.X 2021-03-15 22:45:56 -05:00
TargetTransformInfo.cpp Revert "[Passes] Add relative lookup table converter pass" 2021-03-24 18:59:33 +00:00
TFUtils.cpp [Analysis] Use ListSeparator (NFC) 2021-02-21 19:58:04 -08:00
Trace.cpp
TypeBasedAliasAnalysis.cpp [llvm] Ensure newlines at the end of files (NFC) 2021-02-17 23:58:44 -08:00
TypeMetadataUtils.cpp TypeMetadataUtils.h - reduce Instructions.h include to forward declaration. NFC. 2020-06-05 17:40:33 +01:00
ValueLattice.cpp [ValueLattice] Distinguish between constant ranges with/without undef. 2020-03-31 12:50:20 +01:00
ValueLatticeUtils.cpp [ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC). 2020-07-09 18:33:09 +01:00
ValueTracking.cpp [ValueTracking] Handle shl pair in isKnownNonEqual() 2021-03-26 20:21:05 +01:00
VectorUtils.cpp [Analysis] Use range-based for loops (NFC) 2021-02-22 20:17:18 -08:00
VFABIDemangling.cpp [llvm] Use the default value of drop_begin (NFC) 2021-01-18 10:16:36 -08: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))

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