llvm-6502/lib/Analysis
Duncan P. N. Exon Smith b056aa798d DebugInfo: Move new hierarchy into place
Move the specialized metadata nodes for the new debug info hierarchy
into place, finishing off PR22464.  I've done bootstraps (and all that)
and I'm confident this commit is NFC as far as DWARF output is
concerned.  Let me know if I'm wrong :).

The code changes are fairly mechanical:

  - Bumped the "Debug Info Version".
  - `DIBuilder` now creates the appropriate subclass of `MDNode`.
  - Subclasses of DIDescriptor now expect to hold their "MD"
    counterparts (e.g., `DIBasicType` expects `MDBasicType`).
  - Deleted a ton of dead code in `AsmWriter.cpp` and `DebugInfo.cpp`
    for printing comments.
  - Big update to LangRef to describe the nodes in the new hierarchy.
    Feel free to make it better.

Testcase changes are enormous.  There's an accompanying clang commit on
its way.

If you have out-of-tree debug info testcases, I just broke your build.

  - `upgrade-specialized-nodes.sh` is attached to PR22564.  I used it to
    update all the IR testcases.
  - Unfortunately I failed to find way to script the updates to CHECK
    lines, so I updated all of these by hand.  This was fairly painful,
    since the old CHECKs are difficult to reason about.  That's one of
    the benefits of the new hierarchy.

This work isn't quite finished, BTW.  The `DIDescriptor` subclasses are
almost empty wrappers, but not quite: they still have loose casting
checks (see the `RETURN_FROM_RAW()` macro).  Once they're completely
gutted, I'll rename the "MD" classes to "DI" and kill the wrappers.  I
also expect to make a few schema changes now that it's easier to reason
about everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 17:24:31 +00:00
..
IPA Analysis: Canonicalize access to function attributes, NFC 2015-02-14 00:12:15 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp Remove the Forward Control Flow Integrity pass and its dependencies. 2015-02-27 19:03:38 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp [BasicAA] Try to disambiguate GEPs through arrays of structs into 2015-02-07 17:04:29 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp Fixed a bug where CFLAA would crash the compiler. 2015-02-12 03:07:07 +00:00
CGSCCPassManager.cpp
CMakeLists.txt Remove the Forward Control Flow Integrity pass and its dependencies. 2015-02-27 19:03:38 +00:00
CodeMetrics.cpp
ConstantFolding.cpp
CostModel.cpp [multiversion] Thread a function argument through all the callers of the 2015-02-01 12:01:35 +00:00
Delinearization.cpp
DependenceAnalysis.cpp Add missing includes. make_unique proliferated everywhere. 2015-03-01 21:28:53 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp InstSimplify: simplify 0 / X if nnan and nsz 2015-02-23 18:30:25 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp Reduce double set lookups. 2015-02-27 21:43:14 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp Unify the two EH personality classification routines I wrote 2015-02-14 00:21:02 +00:00
Lint.cpp [PM] Remove the old 'PassManager.h' header file at the top level of 2015-02-13 10:01:29 +00:00
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [LV/LoopAccesses] Backward dependences are not safe just because the 2015-02-26 17:58:48 +00:00
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp MemDepPrinter: Fix some nits introduced in r228596 2015-02-25 23:55:00 +00:00
MemDerefPrinter.cpp MemDerefPrinter: Require DataLayoutPass for higher accuracy 2015-02-09 21:50:03 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Revert 229175 2015-02-15 19:07:31 +00:00
ModuleDebugInfoPrinter.cpp DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
NoAliasAnalysis.cpp
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp Fix bug 22641 2015-02-24 01:02:42 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp SCEVExpander incorrectly marks generated subtractions as nuw/nsw 2015-02-26 19:51:35 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp TLI: Factor out sanitizeFunctionName. NFC. 2015-03-02 23:24:40 +00:00
TargetTransformInfo.cpp Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity. 2015-02-23 19:15:16 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp Correctly combine alias.scope metadata by a union instead of intersecting 2015-02-08 17:07:14 +00:00
ValueTracking.cpp Fix really obscure bug in CannotBeNegativeZero() (PR22688) 2015-02-25 18:00:15 +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))

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