[all-commits] [llvm/llvm-project] 102232: [ctx_prof] Move the "from json" logic more central...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Tue Aug 27 16:57:12 PDT 2024


  Branch: refs/heads/users/arichardson/spr/compiler-rt-simplify-definition-of-uptr
  Home:   https://github.com/llvm/llvm-project
  Commit: 1022323c9b7cd4b9506e25f8f353da632761801e
      https://github.com/llvm/llvm-project/commit/1022323c9b7cd4b9506e25f8f353da632761801e
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M llvm/include/llvm/ProfileData/PGOCtxProfWriter.h
    M llvm/lib/ProfileData/PGOCtxProfWriter.cpp
    M llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp

  Log Message:
  -----------
  [ctx_prof] Move the "from json" logic more centrally to reuse it from test. (#106129)

Making the synthesis of a contextual profile file from a JSON descriptor more reusable, for unittest authoring purposes.

The functionality round-trips through the binary format - no reason, currently, to support other ways of loading contextual profiles.


  Commit: de687eac24a3f4bac8b5ff9975f51ab98775f2d5
      https://github.com/llvm/llvm-project/commit/de687eac24a3f4bac8b5ff9975f51ab98775f2d5
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M lldb/source/Host/common/Socket.cpp
    M lldb/source/Host/windows/ConnectionGenericFileWindows.cpp
    M lldb/source/Host/windows/FileSystem.cpp
    M lldb/source/Host/windows/HostProcessWindows.cpp
    M lldb/source/Host/windows/HostThreadWindows.cpp

  Log Message:
  -----------
  [lldb] Update Host/windows to new Status API


  Commit: 016e1eb9c86923bf6a9669697f6be8309d12b78c
      https://github.com/llvm/llvm-project/commit/016e1eb9c86923bf6a9669697f6be8309d12b78c
  Author: Fabian Mora <fmora.dev at gmail.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M mlir/include/mlir-c/Dialect/GPU.h
    M mlir/include/mlir/Dialect/GPU/IR/CompilationAttrs.td
    M mlir/include/mlir/Target/LLVM/ROCDL/Utils.h
    M mlir/lib/Bindings/Python/DialectGPU.cpp
    M mlir/lib/CAPI/Dialect/GPU.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Target/LLVM/CMakeLists.txt
    M mlir/lib/Target/LLVM/NVVM/Target.cpp
    M mlir/lib/Target/LLVM/ROCDL/Target.cpp
    A mlir/lib/Target/LLVM/ROCDL/Utils.cpp
    M mlir/lib/Target/SPIRV/Target.cpp
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/GPU/ops.mlir
    M mlir/test/python/dialects/gpu/dialect.py
    M mlir/unittests/Target/LLVM/SerializeROCDLTarget.cpp
    M mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp

  Log Message:
  -----------
  [mlir][gpu] Add metadata attributes for storing kernel metadata in GPU objects (#95292)

This patch adds the `#gpu.kernel_metadata` and `#gpu.kernel_table`
attributes. The `#gpu.kernel_metadata` attribute allows storing metadata
related to a compiled kernel, for example, the number of scalar
registers used by the kernel. The attribute only has 2 required
parameters, the name and function type. It also has 2 optional
parameters, the arguments attributes and generic dictionary for storing
all other metadata.

The `#gpu.kernel_table` stores a table of `#gpu.kernel_metadata`,
mapping the name of the kernel to the metadata.

Finally, the function `ROCDL::getAMDHSAKernelsELFMetadata` was added to
collect ELF metadata from a binary, and to test the class methods in
both attributes.

Example:
```mlir
gpu.binary @binary [#gpu.object<#rocdl.target<chip = "gfx900">, kernels = #gpu.kernel_table<[
    #gpu.kernel_metadata<"kernel0", (i32) -> (), metadata = {sgpr_count = 255}>,
    #gpu.kernel_metadata<"kernel1", (i32, f32) -> (), arg_attrs = [{llvm.read_only}, {}]>
  ]> , bin = "BLOB">]

```
The motivation behind these attributes is to provide useful information
for things like tunning.

---------

Co-authored-by: Mehdi Amini <joker.eph at gmail.com>


  Commit: 73c3b7337b0a3a8cb447f9801341d5648aebe9b2
      https://github.com/llvm/llvm-project/commit/73c3b7337b0a3a8cb447f9801341d5648aebe9b2
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/CtxProfAnalysis.h
    M llvm/include/llvm/IR/IntrinsicInst.h
    M llvm/include/llvm/ProfileData/PGOCtxProfReader.h
    M llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
    M llvm/lib/Analysis/CtxProfAnalysis.cpp
    M llvm/lib/IR/IntrinsicInst.cpp
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
    M llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp

  Log Message:
  -----------
  [ctx_prof] Add support for ICP (#105469)

An overload of `llvm::promoteCallWithIfThenElse` that updates the contextual profile.

High-level, this is very simple: after creating the `if... then (direct call) else (indirect call)` structure, we instrument the new callsites and BBs (the instrumentation will help with tracking for other IPO transformations, and, ultimately, to match counter values before flattening to `MD_prof`).

In more detail:

- move the callsite instrumentation of the indirect call to the `else` BB, before the indirect call
- create a new callsite instrumentation for the direct call
- create instrumentation for both the `then` and `else` BBs - we could instrument just one (MST-style) but we're not running the binary with this instrumentation, and at most this would save some space (less counters tracked). For simplicity instrumenting both at this point
- update each context belonging to the caller by updating the counters, and moving the indirect callee to the new, direct callsite ID

Issue #89287


  Commit: d22bee143f4a1d867103571e23c992bf97f8e4b3
      https://github.com/llvm/llvm-project/commit/d22bee143f4a1d867103571e23c992bf97f8e4b3
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M lldb/source/Host/windows/PipeWindows.cpp

  Log Message:
  -----------
  [lldb] Update PipeWindows.cpp to new Status API


  Commit: 51aceb5b30ff9934c476eeb5cd7ff584c3e27049
      https://github.com/llvm/llvm-project/commit/51aceb5b30ff9934c476eeb5cd7ff584c3e27049
  Author: Tyler Nowicki <tyler.nowicki at amd.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroEarly.cpp
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp

  Log Message:
  -----------
  [llvm/llvm-project][Coroutines] Improve debugging and minor refactoring (#104642)

No Functional Changes

* Fix comments in several places
* Instead of using BB-getName() (in dump methods) use
getBasicBlockLabel. This fixes the poor output of the dumped info that
resulted in missing BB labels.
* Use RPO when dumping SuspendCrossingInfo. Without this the dump order
is determined by the ptr addresses and so is not consistent from run to
run making IR diffs difficult to read.
* Inference -> Interference
* Pull the logic that determines insertion location out of insertSpills
and into getSpillInsertionPt, to differentiate between these two
operations.
* Use Shape getters for CoroId instead of getting it manually.

---------

Co-authored-by: tnowicki <tnowicki.nowicki at amd.com>


  Commit: aaed5573634f20e985a18f880bed7267dc89a5dc
      https://github.com/llvm/llvm-project/commit/aaed5573634f20e985a18f880bed7267dc89a5dc
  Author: Fabian Mora <fmora.dev at gmail.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
    M mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp

  Log Message:
  -----------
  [mlir][GPU] Fix docs modified by #94910 (#106295)

Fix docs modified by #94910 by adding information about the `module`
argument in `gpu::TargetAttrInterface::createObject`.

---------

Co-authored-by: Mehdi Amini <joker.eph at gmail.com>


  Commit: 91e09c37da6a03a3575678f4c955a6a0ef861ede
      https://github.com/llvm/llvm-project/commit/91e09c37da6a03a3575678f4c955a6a0ef861ede
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M llvm/unittests/Transforms/Utils/CMakeLists.txt

  Log Message:
  -----------
  Fix dynamic linking bots after PR #105469


  Commit: 0b1c8fd162aa1be66332d57d7da68416a9acb5ef
      https://github.com/llvm/llvm-project/commit/0b1c8fd162aa1be66332d57d7da68416a9acb5ef
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2024-08-28 (Wed, 28 Aug 2024)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

  Log Message:
  -----------
  [lldb][ClangExpressionParser] Remove duplicate construction of ExternalASTSourceWrapper

This is an oversight from https://github.com/llvm/llvm-project/pull/104817 where the intention
was to hoist the ExternalASTSourceWrapper construction out of the
conditional so it can be set on both the `SemaSourceWithPriorities` and
be added as an external source to Sema. But the inner
`ExternalASTSourceWrapper` allocation wasn't actually removed.

This currently all works fine because all these AST sources are
refcounted and point to the same underlying AST sources. But this
patch cleans this up regardless.


  Commit: d2b2defc2d3901f5c94485ea377a3f894bd53a83
      https://github.com/llvm/llvm-project/commit/d2b2defc2d3901f5c94485ea377a3f894bd53a83
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M compiler-rt/lib/interception/interception_type_test.cpp
    M lldb/source/Host/common/Socket.cpp
    M lldb/source/Host/windows/ConnectionGenericFileWindows.cpp
    M lldb/source/Host/windows/FileSystem.cpp
    M lldb/source/Host/windows/HostProcessWindows.cpp
    M lldb/source/Host/windows/HostThreadWindows.cpp
    M lldb/source/Host/windows/PipeWindows.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    M llvm/include/llvm/Analysis/CtxProfAnalysis.h
    M llvm/include/llvm/IR/IntrinsicInst.h
    M llvm/include/llvm/ProfileData/PGOCtxProfReader.h
    M llvm/include/llvm/ProfileData/PGOCtxProfWriter.h
    M llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
    M llvm/lib/Analysis/CtxProfAnalysis.cpp
    M llvm/lib/IR/IntrinsicInst.cpp
    M llvm/lib/ProfileData/PGOCtxProfWriter.cpp
    M llvm/lib/Transforms/Coroutines/CoroEarly.cpp
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
    M llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp
    M llvm/unittests/Transforms/Utils/CMakeLists.txt
    M llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp
    M mlir/include/mlir-c/Dialect/GPU.h
    M mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
    M mlir/include/mlir/Dialect/GPU/IR/CompilationAttrs.td
    M mlir/include/mlir/Target/LLVM/ROCDL/Utils.h
    M mlir/lib/Bindings/Python/DialectGPU.cpp
    M mlir/lib/CAPI/Dialect/GPU.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Target/LLVM/CMakeLists.txt
    M mlir/lib/Target/LLVM/NVVM/Target.cpp
    M mlir/lib/Target/LLVM/ROCDL/Target.cpp
    A mlir/lib/Target/LLVM/ROCDL/Utils.cpp
    M mlir/lib/Target/SPIRV/Target.cpp
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/GPU/ops.mlir
    M mlir/test/python/dialects/gpu/dialect.py
    M mlir/unittests/Target/LLVM/SerializeROCDLTarget.cpp
    M mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp

  Log Message:
  -----------
  [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.6-beta.1

[skip ci]


  Commit: dec0256b487bd15aaa92594f32bccb8ba138ee9e
      https://github.com/llvm/llvm-project/commit/dec0256b487bd15aaa92594f32bccb8ba138ee9e
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M compiler-rt/lib/interception/interception_type_test.cpp
    M lldb/source/Host/common/Socket.cpp
    M lldb/source/Host/windows/ConnectionGenericFileWindows.cpp
    M lldb/source/Host/windows/FileSystem.cpp
    M lldb/source/Host/windows/HostProcessWindows.cpp
    M lldb/source/Host/windows/HostThreadWindows.cpp
    M lldb/source/Host/windows/PipeWindows.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    M llvm/include/llvm/Analysis/CtxProfAnalysis.h
    M llvm/include/llvm/IR/IntrinsicInst.h
    M llvm/include/llvm/ProfileData/PGOCtxProfReader.h
    M llvm/include/llvm/ProfileData/PGOCtxProfWriter.h
    M llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
    M llvm/lib/Analysis/CtxProfAnalysis.cpp
    M llvm/lib/IR/IntrinsicInst.cpp
    M llvm/lib/ProfileData/PGOCtxProfWriter.cpp
    M llvm/lib/Transforms/Coroutines/CoroEarly.cpp
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
    M llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp
    M llvm/unittests/Transforms/Utils/CMakeLists.txt
    M llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp
    M mlir/include/mlir-c/Dialect/GPU.h
    M mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td
    M mlir/include/mlir/Dialect/GPU/IR/CompilationAttrs.td
    M mlir/include/mlir/Target/LLVM/ROCDL/Utils.h
    M mlir/lib/Bindings/Python/DialectGPU.cpp
    M mlir/lib/CAPI/Dialect/GPU.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Target/LLVM/CMakeLists.txt
    M mlir/lib/Target/LLVM/NVVM/Target.cpp
    M mlir/lib/Target/LLVM/ROCDL/Target.cpp
    A mlir/lib/Target/LLVM/ROCDL/Utils.cpp
    M mlir/lib/Target/SPIRV/Target.cpp
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/GPU/ops.mlir
    M mlir/test/python/dialects/gpu/dialect.py
    M mlir/unittests/Target/LLVM/SerializeROCDLTarget.cpp
    M mlir/unittests/Target/LLVM/SerializeToLLVMBitcode.cpp

  Log Message:
  -----------
  rebase

Created using spr 1.3.6-beta.1


Compare: https://github.com/llvm/llvm-project/compare/153d70a4c158...dec0256b487b

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list