DirectXShaderCompiler/lib/Analysis
Tex Riddell f4965b71dd Integrate dxcapi v2 and other changes from internal (#2575)
* Integrate changes from internal.

- dxcapi v2
- new dxc options
- DxilValueCache
- PDB and NoOpt improvements
- noop / llvm::donothing() support

* Update dxrfallbacklayer for dxcapi internal changes

* Reorder diag block based on whether pDiag is set first.

* llvm::donothing() requires dxil 1.6 / SM 6.6 for now, lib as well.

* Fixes for spir-v, non-VC compiler and non-Windows builds

- DEFINE_CROSS_PLATFORM_UUIDOF for new interfaces
- add SAL annotations
- turn output argument validation for -P into warning
- handle warnings without concatenating them to main output
- update spirv preprocessing and compilation paths
- return E_NOTIMPL from IDxcUtils::CreateReflection
- cleanup: DxcContainerBuilder back to uft8, DxcTestUtils: remove comment

* Fix some warnings from clang/gcc.

* Fix unicode conversion problems on linux, where sizeof(wchar_t) == 4

Note this is an intermediate fix.
On linux, what we are calling utf16 is actually a wide string
that's probably utf32.  This change fixes issues introduced by
the new interface changes so things are consistent and pass tests.

A future fix should correct the encodings so they are correctly labeled
on platforms where wchar_t doesn't mean UTF16.

* Return false for IsBufferNullTerminated when CP_ACP.

One test for Disassembler was crashing because it created a pinned blob
with a size of 1 << 31 + 1 without actual memory backing this.  The
IsBufferNullTerminated would attempt to see if this was null terminated,
causing AV.

This change also removes CP_UTF8 from this test when it was creating
binary blobs, not UTF8 text blobs.
2019-11-13 16:16:45 -08:00
..
IPA Integration from OS repo (#2541) 2019-10-22 15:43:26 -07: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 Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
AssumptionCache.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
BasicAliasAnalysis.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -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 Fix dependency on HL/DxilModule from llvm::Module (#1651) 2018-10-31 19:18:28 -07: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 const folding on dxil.convergent.marker. (#2523) 2019-10-16 16:56:03 -07:00
DxilConstantFoldingExt.cpp Add hooks for constant folding extensions (#209) 2017-04-13 15:04:14 -07:00
DxilSimplify.cpp Move DxilModule into DXIL directory. (#1599) 2018-10-16 00:28:35 -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 Integrate dxcapi v2 and other changes from internal (#2575) 2019-11-13 16:16:45 -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 Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08: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 Fixed issues that change codegen when there's debug info. (#2190) 2019-05-17 13:35:08 -07: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 Add support for custom allocators (#390) 2017-07-06 16:45:48 -07: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 Add support for custom allocators (#390) 2017-07-06 16:45:48 -07:00
VectorUtils.cpp Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -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))

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