[all-commits] [llvm/llvm-project] 8bb634: Add !annotation metadata and remarks pass.

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Nov 13 05:26:05 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8bb6347939b7a1f0dab6361e3a0f5cc4c75f5d3d
      https://github.com/llvm/llvm-project/commit/8bb6347939b7a1f0dab6361e3a0f5cc4c75f5d3d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-11-13 (Fri, 13 Nov 2020)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
    M llvm/include/llvm/IR/FixedMetadataKinds.def
    M llvm/include/llvm/InitializePasses.h
    M llvm/include/llvm/Transforms/Scalar.h
    A llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
    M llvm/lib/IR/Verifier.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
    A llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
    M llvm/lib/Transforms/Scalar/CMakeLists.txt
    M llvm/lib/Transforms/Scalar/Scalar.cpp
    M llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-lto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
    M llvm/test/Other/opt-LTO-pipeline.ll
    M llvm/test/Other/opt-O2-pipeline.ll
    M llvm/test/Other/opt-O3-pipeline-enable-matrix.ll
    M llvm/test/Other/opt-O3-pipeline.ll
    M llvm/test/Other/opt-Os-pipeline.ll
    A llvm/test/Transforms/Util/annotation-remarks.ll
    A llvm/test/Verifier/annotation-metadata.ll

  Log Message:
  -----------
  Add !annotation metadata and remarks pass.

This patch adds a new !annotation metadata kind which can be used to
attach annotation strings to instructions.

It also adds a new pass that emits summary remarks per function with the
counts for each annotation kind.

The intended uses cases for this new metadata is annotating
'interesting' instructions and the remarks should provide additional
insight into transformations applied to a program.

To motivate this, consider these specific questions we would like to get answered:

* How many stores added for automatic variable initialization remain after optimizations? Where are they?
* How many runtime checks inserted by a frontend could be eliminated? Where are the ones that did not get eliminated?

Discussed on llvm-dev as part of 'RFC: Combining Annotation Metadata and Remarks'
(http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html)

Reviewed By: thegameg, jdoerfert

Differential Revision: https://reviews.llvm.org/D91188




More information about the All-commits mailing list