DirectXShaderCompiler/lib/Analysis
Chris B 2168dcb4fb
Clean up and rework DXIL library depencencies (#4877)
* Clean up and rework DXIL library depencencies

This change reworks the dependency specifications for the DXIL*
libraries. Many of these libraries had over and under specified
dependencies.

This also collapses the DxilRDATBuidlder into the DxilContainer library
to remove the cyclic dependency between the two libraries.

* Break assert dependency between DXIL and Analysis

In assert builds the DXILModule constructor was creating forced bindings
to debugging methods that are often used from the debugger. This forced
binding is useful, but doesn't need to live in the DXIL library.

To break the dependency I've moved the code into Analysis. I've also
made that code only included when building with MSVC. When using other
compilers `__attribute__((used))` can be applied to the function via the
`LLVM_DUMP_METHOD` annotation to have the same effect.
2023-01-03 10:04:22 -06:00
..
IPA Backport -ftime-trace from upstream llvm & clang (#4873) 2022-12-14 10:15:28 -06:00
AliasAnalysis.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
AliasAnalysisCounter.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
AliasAnalysisEvaluator.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
AliasDebugger.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
AliasSetTracker.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
Analysis.cpp Clean up and rework DXIL library depencencies (#4877) 2023-01-03 10:04:22 -06:00
AssumptionCache.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
BasicAliasAnalysis.cpp Fallthrough (#4843) 2022-12-09 10:13:56 -08:00
BlockFrequencyInfo.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
BlockFrequencyInfoImpl.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
BranchProbabilityInfo.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
CFG.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
CFGPrinter.cpp fix dot-cfg so it doesn't act like dot-cfg-only (#556) 2017-08-15 12:13:24 -07:00
CFLAliasAnalysis.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
CGSCCPassManager.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
CMakeLists.txt Clean up and rework DXIL library depencencies (#4877) 2023-01-03 10:04:22 -06:00
CaptureTracking.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
CodeMetrics.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
ConstantFolding.cpp [linux-port] Evade unused in LLVM code (#1327) 2018-06-05 14:07:51 -04:00
CostModel.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
Delinearization.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
DependenceAnalysis.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
DivergenceAnalysis.cpp Merge DivergenceAnalysis from llvm3.8. (#528) 2017-08-07 12:14:46 -07:00
DomPrinter.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
DominanceFrontier.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
DxilConstantFolding.cpp Give Asdouble some love (i64 cast and folding) (#3666) 2021-05-27 15:41:43 -07:00
DxilConstantFoldingExt.cpp Add hooks for constant folding extensions (#209) 2017-04-13 15:04:14 -07:00
DxilSimplify.cpp Change umax(a,0) to a. (#3922) 2021-08-30 22:18:19 -07:00
DxilValueCache.cpp Taught DxilValueCache to handle complex switch statements. (#4403) 2022-04-21 11:53:45 -07:00
IVUsers.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
InstCount.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
InstructionSimplify.cpp Fallthrough (#4843) 2022-12-09 10:13:56 -08:00
Interval.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
IntervalPartition.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
IteratedDominanceFrontier.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
LLVMBuild.txt Clean up and rework DXIL library depencencies (#4877) 2023-01-03 10:04:22 -06:00
LazyCallGraph.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
LazyValueInfo.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
LibCallAliasAnalysis.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
LibCallSemantics.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
Lint.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
Loads.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
LoopAccessAnalysis.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
LoopInfo.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
LoopPass.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
MemDepPrinter.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
MemDerefPrinter.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
MemoryBuiltins.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
MemoryDependenceAnalysis.cpp Fallthrough (#4843) 2022-12-09 10:13:56 -08:00
MemoryLocation.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
ModuleDebugInfoPrinter.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
NoAliasAnalysis.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
PHITransAddr.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
PostDominators.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
PtrUseVisitor.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
README.txt Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
ReducibilityAnalysis.cpp Fix Validation for RDAT and other issues with Subobjects (#1706) 2018-11-13 14:49:32 -08:00
RegionPass.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
ScalarEvolution.cpp Fallthrough (#4843) 2022-12-09 10:13:56 -08:00
ScalarEvolutionAliasAnalysis.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
ScalarEvolutionExpander.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
ScalarEvolutionNormalization.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
ScopedNoAliasAA.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
SparsePropagation.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
StratifiedSets.h Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
TargetLibraryInfo.cpp [linux-port] Fix GCC build on alpine Linux (and others) (#1378) 2018-06-26 15:15:32 -04:00
TargetTransformInfo.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
Trace.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
TypeBasedAliasAnalysis.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
ValueTracking.cpp Fallthrough (#4843) 2022-12-09 10:13:56 -08:00
VectorUtils.cpp Minor refactoring to reduce size of dxilconv.dll (#3240) 2020-11-05 15:39:09 -08:00
VectorUtils2.cpp Minor refactoring to reduce size of dxilconv.dll (#3240) 2020-11-05 15:39:09 -08:00
regioninfo.cpp Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
regionprinter.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00

README.txt

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))

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