DirectXShaderCompiler/lib/Analysis
Chris B 37ed613864
[NFC] Clang-format DXC sources (#5602)
This change applies clang-format to all of the sources added in DXC that
were not part of the original LLVM/Clang 3.7 release when DXC forked.
This provides consistent code formatting across the codebase.

Fixes #5591.
2023-09-19 07:49:22 -05: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 [NFC] Remove SAL annotations from internal APIs (#5639) 2023-09-14 08:59:49 -05: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 [C++17] Merge Replace uses of std::iterator with explicit using (#5485) 2023-08-09 14:04:01 -04: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 [NFC] Remove SAL annotations from internal APIs (#5639) 2023-09-14 08:59:49 -05: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 [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05:00
DxilConstantFoldingExt.cpp [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05:00
DxilSimplify.cpp [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05:00
DxilValueCache.cpp [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05: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 Fix asan container-overflow (#5619) 2023-09-14 10:04:26 -04: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 [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05: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 [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05:00
regioninfo.cpp [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05:00
regionprinter.cpp [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05: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))

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